Commit Graph
4 Commits
Author SHA1 Message Date
dj7nt 154f953109 feat: mark Modbus connection loss in InfluxDB
SolarEdge firmware is known to silently drop the Modbus TCP listener
(port refuses connections while still shown as enabled). Write a
connection_state=1 point on first failed poll and 0 on recovery so the
outage is visible in Grafana instead of just a data gap.

ConnectionException is re-raised from read() - it is fatal for the
whole cycle, not a flaky single block. Marker points carry no tags
(registers unreadable during outage), so the tile query skips the
serial filter.

Also includes threshold tweaks on the power stat tiles.
2026-10-11 07:33:44 +02:00
dj7nt d1aa17c05a Show battery power as positive when discharging
The battery register reads negative on discharge (raw since day
one), but the tile label promised '+ Entladen / - Laden'. Flip the
three raw battery1_power/current queries with * -1 so positive
means power flowing into the house - the same mental model as the
grid tile (+ Bezug). Full history renders consistently; surplus
panels already use the correctly-signed derived fields.
2026-10-10 17:51:48 +02:00
dj7nt 0ec3bcb8ef Fix battery sign and separate PV from inverter output
Verified against simultaneous SolarEdge app readings (PV 40 W,
battery discharge 520 W, house 560 W): battery1_power negative
means discharge, and power_ac on this DC-coupled Energy Hub is
the inverter's TOTAL AC output - it already contains the battery
contribution. The old formula double-counted the battery, so
house_load collapsed (44 W shown vs 560 W real) and the PV tile
showed battery-inflated totals, which looked like PV and house
consumption were swapped.

New derived fields: house_load = power_ac + grid, and
pv_power = power_ac - battery (true PV production). Dashboard PV
tiles and both yield panels now use pv_power / integral(pv_power)
- the energy_total lifetime counter also counts battery
throughput and is not a PV yield.
2026-10-10 17:48:23 +02:00
dj7nt d266654696 Harden Modbus/Influx paths, add Grafana dashboard
Short or garbled gateway responses are rejected on register count
instead of half-decoding (previously: 'unpack requires a buffer',
OverflowError on garbage scale factors). Scale factors outside
+/-10 and non-finite floats are dropped before they reach line
protocol.

offgrid is written as integer offgrid_state: the existing DB
cannot be migrated (mixed inmem/tsi1 shards block all deletes)
and the old boolean field conflicts with integer writes, which
poisoned the spool - HTTP 400 now drops the batch and logs the
InfluxDB error body instead of re-spooling it forever.

grafana_dashboard.json: fully German dashboard (InfluxQL,
InfluxDB 1.x) with off-grid state, SoC (SoE*SoH/100) and
consumption-source panels; status tiles use integers plus value
mappings because Grafana drops string/boolean fields from
InfluxQL time series.
2026-10-10 16:58:44 +02:00