Integration fails to read data during "Battery Backup" situation
I do have a power outage right now at my house and the solaredge_modbus integration does not show any values. After looking into the logs I see this:
2021-11-09 10:06:11 ERROR (MainThread) [custom_components.solaredge_modbus] Error reading modbus data Traceback (most recent call last): File "/config/custom_components/solaredge_modbus/init.py", line 187, in async_refresh_modbus_data update_result = self.read_modbus_data() File "/config/custom_components/solaredge_modbus/init.py", line 230, in read_modbus_data and self.read_modbus_data_meter2() File "/config/custom_components/solaredge_modbus/init.py", line 247, in read_modbus_data_meter2 return self.read_modbus_data_meter("m2_", 40364) File "/config/custom_components/solaredge_modbus/init.py", line 405, in read_modbus_data_meter exported = validate(self.calculate_value(exported, energywsf), ">", 0) File "/config/custom_components/solaredge_modbus/init.py", line 124, in validate raise ValueError(f"Value {value} failed validation ({comparison}{against})") ValueError: Value 0 failed validation (>0)
I think in a battery backup case this value could be negative or at least 0 (zero).
Line 405 should be (409 probably as well):
exported = validate(self.calculate_value(exported, energywsf), ">=", 0)
(please excuse if python has a different way of saying "greater or equal" - I am a c# guy :))
EDIT: changing the validation does not remove the error