Commit Graph
18 Commits
Author SHA1 Message Date
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 412accc003 Fix grid meter sign: positive reading is export
The assumption meter1_power positive = import was wrong. Evidence
from the recorded data: sustained +2kW meter readings at high PV
with a full battery in maximize-self-consumption mode (exports,
not imports), and a single -2.5kW sample at 17:54 with only 600W
PV - a kettle import, physically impossible as an export under
the old assumption. house_load was inflated by adding export on
top of production, which made PV and consumption look swapped.

All derived flow fields follow the single METER_IMPORT_POSITIVE
constant; tests now describe the observed kettle/export patterns.
2026-10-10 17:32:37 +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
dj7nt 34e77991e6 GridState 2026-10-10 16:25:11 +02:00
dj7nt 4b22f4f034 More data 2026-10-10 16:13:58 +02:00
dj7nt b168e2da43 Replace MQTT output with direct InfluxDB writes
Polls now cover meter 1, battery 1 and storage control blocks,
plus inverter event registers for off-grid detection (vendor
event bit 0). Register layout validated by probing a
SE10K-RWB48BFN4 with fw 0004.0025.0011; battery and storage
floats are word-swapped on this device.

Failed Influx writes spool to disk and replay on the next
success (Influx reached over WAN). Modbus blocks that fail to
read are skipped for that cycle; the flaky gateway must not
kill the daemon. Battery lifetime counters at 0xE176/0xE17A
hang the device and are never read.

BREAKING CHANGE: config.yaml 'mqtt:' section replaced by
'influx:', Home Assistant discovery removed.
2026-10-10 15:42:48 +02:00
Marijn Koesen 7f91aabd3a Add instructions how to docker build other platform 2024-06-09 20:24:57 +02:00
Marijn Koesen 1ba415153b Don't autodiscover string fields
As these are not valid sensors in home assistant
2024-06-09 20:12:17 +02:00
Marijn Koesen c20ceb25c1 Add update steps to README 2022-03-14 09:54:02 +01:00
Marijn Koesen debf01e220 Read all registers at once
When you read the registers one-by-one, which is what the solaredge_mobus
library is doing, you run into the issue where the value and the scale
are sometimes out of sync.

This happens mostly when the values go up or down a lot, like at the
beginning and at the end of the day. At these times the SolarEdge
inverter can change the scale of the values it's returning.

When you read the value register, the scale might be -2, but in the
time between that request, and the request for the scale, the inverter
has changed the scale to -3. So in the next register read, you will get
-3 for the scale, but have a value in the scale of -2. Now when you do
the value calculation, you end up with a factor 10 difference.

So it's better, and also _much_ faster to read out all the registers
at once and then parse the values from this bigger read out.

I'm planning to do a MR back to solaredge_modbus with this change, so
for now i've just included that code into this project.
2020-06-06 18:40:00 +02:00
Marijn Koesen 20ff709e96 Add info how to uninstall 2020-06-04 21:49:53 +02:00
Marijn Koesen 8fe07da944 Get poll interval from config 2020-06-04 21:49:44 +02:00
Marijn Koesen 94b265751c Pin python to 3.8 2020-06-04 21:41:08 +02:00
Marijn Koesen 69abaee5e2 Make mqtt topic configurable 2020-06-04 21:34:54 +02:00
Marijn Koesen e6196b91cf Add MIT license 2020-06-04 21:28:38 +02:00
Marijn Koesen 79a28d169e Replace the ENV variable with a config file
So it's safer to configure, as we don't need to pass env variables
to a docker run service. Also it's easier to configure without
needing to pass a whole lot of env vars.
2020-06-04 21:27:14 +02:00
Marijn Koesen f436385f67 Initial commit 2020-06-04 21:08:49 +02:00