Replies: 3 comments 1 reply
-
I'm facing the exact same issue. My solar inverter shuts down when there is no sun, leaving the last read output power value around 12 W until the next day. I would rather like to see Unknown or 0 when esphome device cannot read from modbus. |
Beta Was this translation helpful? Give feedback.
-
You could use a script that waits a certain amount of time and then publishes 0 to the sensor. You would trigger it from the |
Beta Was this translation helpful? Give feedback.
-
I had success using a template binary sensor, and executing a lambda un its |
Beta Was this translation helpful? Give feedback.
-
Hi!
Get successfully running ESPHome with Modbus that connected to solar inverter (have loaded ESPHome to original inverter monitoring device, based on ESP8266).
No problem with configuration and reading, but I can’t find any configuration option to recognize that there is no Modbus response. For example, If I switch power off from ESP device, then after some time I see Unknown value of sensors in Home Assistant, and its logical - device switched off. But if I keep ESP power ON and brake Modbus connection, ESP keep sending to HA last read value for each sensor until power on. In ESP log will be errors - “Modbus command to device=1 … no response received - removed from send queue”, but list of sensors kept as it was before brake. If Modbus device lost due some problem, and ESP keep sending last values to HA - it’s not possible to understood that something wrong with device + energy statistics will collect wrong data.
In case of MQTT settings, there is “expire_after:” for sensors that. In original HA Modbus configuration also “retries:” option + and if reply’s are no received - sensors will be set as unknown.
But is it something like that for Modbus in ESPHome?
Thanks you!
Beta Was this translation helpful? Give feedback.
All reactions