Open ragg987 opened 5 months ago
I wouldn’t call this an intermediate fault/error, it’s a missing key error. You need to reverse engineer the Libbi API to solve this issue.
Are you referring to the API key? If missing would not ALL of the myenergi sensors fail to update? What I see is that most keep working but a few fail - for instance 4 (from memory) on the Zappi fail from a full list of about 20. I have not checked on the Libbi or Eddi side. Apologies if these are dumb questions but I don't know how the API works, I rely on the ME add-on to "shield" me from the inner workings...
The error report shows a JSON key is missing, so either ME changed the API or whoever created the Libbi integration needs to cater for the situation when the key isn’t present, as this is what ME do when there is no data to report, plus it exposed poor programming in not covering erroneous responses.
The error report shows a JSON key is missing, so either ME changed the API or whoever created the Libbi integration needs to cater for the situation when the key isn’t present, as this is what ME do when there is no data to report, plus it exposed poor programming in not covering erroneous responses.
For libbi we are waiting for 442 to merge in.
Maybe try the pre-release from here https://github.com/CJNE/ha-myenergi/issues/442#issuecomment-2088313488 ?
Ff you are referring to this error in the above logs, this appears to be a Libbi error. However my issue is about a Zappi issue whereby the Zappi sensor becomes unavailable after a period of days. I cannot see Zappi being directly referenced in the log.
KeyError: 'BALANCE'
Whatever the cause the code needs to cater for the event of a missing JSON key BALANCE
Can you retest with the latest version of this integration, BALANCE is now a key, see https://github.com/CJNE/ha-myenergi/blob/de5a7bef0e9448381d9dd780d4d94e4432597bbc/custom_components/myenergi/select.py#L13
Version of the custom_component
0.0.27
HA OS for amd64 version 2024.5.4
Configuration
Describe the bug
This is an intermittent error. Some of the standard sensors will show as unavailable, usually about 1-2 days after the integration has been started. Prior to this they work well. I have shown images of one example, the Zappi Charge Mode. If I restart the integration the problem will go away, then about 1-2 days later it will stop working. I have used the integration for a few months now and I believe the issue started relatively recently - maybe 2 months ago.
Debug log
The Charge Mode sensor failed at timestamp 2024-05-20 15:12:42 as seen in the development tab against sensor history. I enclose the logs for a few minutes prior to this timestamp. Some personal data is obfuscated.