How to handle a Modbus sensor that is sometimes unavailable?

I have a Modbus sensor that reads power and voltage values from an Energy Meter (EM24) via a USB-Serial dongle. This all works well until there is a power-failure - the HomeAssistant box is on a UPS , but the Energy Meter goes off.

I start seeing the following errors in the HA log:
"Pymodbus: Modbus Error: [Input/Output] Modbus Error: [Invalid Message] No response received, expected at least 2 bytes (0 received)"

My question is how best to handle this situation when no Modbus data is returned from the Energy Meter (during a power failure)?

I don’t mind having these errors in the HA log, but it appears that these Modbus errors causes parts of the HA UI to become unresponsive (e.g. History, Developer Tools, Supervisor etc.).

1 Like

same problem

I have the same problem. When all the 5 devices I have are online everything is ok. When I turn one of them off (or it’s broken) the whole polling stops. As I think there must be some “timeouts” counter that causes HA to “forget” irresponsive device and stop its polling until counter to be reset or HA restart. Is there any workaround found?

1 Like