StephanJoubert / home_assistant_solarman

Home Assistant component for Solarman collectors used with a variety of inverters.
Apache License 2.0
508 stars 191 forks source link

Incorrect data on Inverter alert message for Sofar HYD #458

Open onetoomany opened 7 months ago

onetoomany commented 7 months ago

I seem to be getting an alert message (_sensor.solarman_inverter_alertmessage) as a proxy for the inverter running state. For example:

Inverter is a Sofar HYD 5000 ES in passive mode. I'm also running sofar2mqtt to control the inverter.

timlewy commented 5 months ago

I am also observing this with my HYD 3600 inverter. Its reassuring to hear someone getting the same

onetoomany commented 5 months ago

Digging into this, it looks like the Solarman add-in is reading a number from a register on the inverter and the code is then adding the error message. This add-in is reading from the wrong register so I'm not worried about all these scary looking alert codes as they are not generated on the inverter. This is how I'm turning this wrong data into something useful:

``

timlewy commented 5 months ago

This can be fixed by updating the YAML definition. The register exists in the spec, but the definition for the values is wrong in the integration. Most of these alerts seem to correspond to reserved values as well, but we can infer their usage. There is a limitation in this integration though - it treats the register values as single integers with decimal mappings, but in reality they are bit fields, with each bit representing a different alert. This allows any combination of the alerts to be represented. For the integration to be accurate, values would need to be provided for all 65535 combinations

timlewy commented 5 months ago

The spec gives us:

I've never seen any bar the last of those values in real life, so I can only trust the sofar protocol definition.

From my observations I also infer: