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.
This commit is contained in:
dj7nt committed 2026-10-10 15:42:48 +02:00
1 parent 7f91aabd3a
commit b168e2da43
7 files changed
+544 -216

No files matched your search

+37
View File
@@ -13,6 +13,43 @@ cp config.yaml-dist /etc/solaredge_modbus_mqtt/config.yaml
docker run --detach --name=solaredge_modbus_mqtt --restart=always --volume=/etc/solaredge_modbus_mqtt/config.yaml:/app/config.yaml marijnkoesen/solaredge_modbus_mqtt:latest
```
### Configuration
```yaml
modbus:
host: 192.168.178.28 # inverter (SunSpec over Modbus TCP)
port: 1502
timeout: 1
unit: 1
influx:
url: http://influx.example.com:8086
db: solaredge
user: ~ # optional basic-auth user with WRITE on the db
pass: ~
measurement: solaredge
poll_interval: 3
```
The daemon polls the inverter and writes one line-protocol point per cycle directly
to InfluxDB. If InfluxDB is unreachable, points are spooled to `spool.txt` and
replayed on the next successful write (capped at 20000 lines). Mount a volume for
`/app/spool.txt` if backlog across container restarts matters.
`model` and `serialnumber` are written as tags; everything else as fields.
### Off-grid / fail-over
- `offgrid` — boolean, true while the inverter runs islanded (off-grid) — vendor event bit
- `error_code` — inverter vendor error bitmask (0 = none), LCD-style codes
- `storage_control_mode_text` — e.g. `Backup Only`, `Maximize Self Consumption`
- `battery1_*` — SOE/SOH, power, voltage, temperatures, status of battery 1
Register addresses were validated by probing a SE10K-RWB48BFN4 (fw 0004.0025.0011)
with one battery and one meter. Blocks that fail to read (flaky gateway) are
skipped for that cycle; the fields are simply absent from the point.
### Uninstall