Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ValueError: Value 0 failed validation (>0) #191

Open
Maikel-K opened this issue Aug 28, 2023 · 2 comments
Open

ValueError: Value 0 failed validation (>0) #191

Maikel-K opened this issue Aug 28, 2023 · 2 comments

Comments

@Maikel-K
Copy link

Hello,

The intergration has worked perfectly for some time and now is not reading all the data all the time with these errors in the log:

Traceback (most recent call last):
File "/config/custom_components/solaredge_modbus/init.py", line 216, in async_refresh_modbus_data
update_result = self.read_modbus_data()
^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/solaredge_modbus/init.py", line 276, in read_modbus_data
and self.read_modbus_data_meter1()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/solaredge_modbus/init.py", line 286, in read_modbus_data_meter1
return self.read_modbus_data_meter("m1_", 40190)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/solaredge_modbus/init.py", line 435, in read_modbus_data_meter
exported = validate(self.calculate_value(exported, energywsf), ">", 0)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/solaredge_modbus/init.py", line 148, in validate
raise ValueError(f"Value {value} failed validation ({comparison}{against})")
ValueError: Value 0 failed validation (>0)

@Maikel-K
Copy link
Author

I found another post regarding same error, #114 involved this so i did what that post said. I now have to wait if the error returns.

I still have problems that not all values update everytime, sometimes there are a few hours between updates.
How can i see if there is an issue between my meter and the inverter or the inverter and this intergration?

I also have this error after turning debug logging on.

Entity sensor.solaredgemodbus_m1_imported_kwh from integration solaredge_modbus has state class total_increasing, but its state is not strictly increasing. Triggered by state 252.982 (254.402) with last_updated set to 2023-08-30T19:50:18.861421+00:00. Please report it to the custom integration author.

@ChristophCaina
Copy link
Contributor

raise ValueError(f"Value {value} failed validation ({comparison}{against})")
ValueError: Value 0 failed validation (>0)

the integration is trying to validate the "m1 exported" value.
The sensor value should be greater than 0 -> but the inverter is sending a 0 value, therefore, the validation failed.

THe problem here is, that if we would validate for > = 0 - the integration would allow the zero value, and then the integration will fail when the inverter is sending a value greater zero, because it would just add the new value to the previous one, causing issues with the energy dashboard and statistics.

MAYBE a solution to this would be, not to write this into the logs... at least, when this behave is expected.

the second error indicates, that the inverter has sent a smaller value for the imported_kwh sensor, than earlier... which should not happen, based on the fact, that this sensor is continously increasing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants