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

Error: 'onHeartbeat' failed 'KeyError'. #2

Open
Martial83 opened this issue Apr 10, 2021 · 10 comments
Open

Error: 'onHeartbeat' failed 'KeyError'. #2

Martial83 opened this issue Apr 10, 2021 · 10 comments

Comments

@Martial83
Copy link

Hi @aukedejong and a big thank you for that!
The plugin work very well, but, at night, i have errors like that, every 30s
2021-04-10 07:21:24.184 Error: (Mon onduleur) 'onHeartbeat' failed 'KeyError'.
2021-04-10 07:21:24.184 Error: (Mon onduleur) ----> Line 181 in '/home/pi/domoticz/plugins/domoticz-fronius-inverter-plugin/plugin.py', function onHeartbeat
2021-04-10 07:21:24.184 Error: (Mon onduleur) ----> Line 65 in '/home/pi/domoticz/plugins/domoticz-fronius-inverter-plugin/plugin.py', function onHeartbeat
2021-04-10 07:21:24.184 Error: (Mon onduleur) ----> Line 125 in '/home/pi/domoticz/plugins/domoticz-fronius-inverter-plugin/plugin.py', function updateDeviceCurrent

I don't understand why.
Can you help me?

@Moosbueffel
Copy link

Perhaps because you have energy saving mode on at night!?

@Martial83
Copy link
Author

Yes, you'r right.
Do I have to delete it?
There is no other solution?

@Moosbueffel
Copy link

Yes, you can try to switch it off. Id didn't use this plugin, because I have 2 devices, so my device ID is system, which is not supported by this plugin. But I use the same API-call. And I disabled energy saving at night and it works.

So give it a try!

@Moosbueffel
Copy link

Moosbueffel commented Apr 10, 2021

Other solution is only to disable the calls at night. I think, this can only be done by the developer. Or yoou change the code by yourself.

In my case I also collect the consuption, which is also running during night ;).

@Martial83
Copy link
Author

Thank you for your help.
I can't find the option on my fronius

@Moosbueffel
Copy link

I checked Settings and manual and also can't find. Perhaps its in the menue at the hardware. This setting was done from my installateur. Perhaps you can ask your installateur if you will not find the setting.

@Martial83
Copy link
Author

I've found Nightmode, but it is only for the display panel

@Martial83
Copy link
Author

No, it's not only for the display panel.
I'll try it

@Martial83
Copy link
Author

Hi,
I have found the problem:
We must test jsonObject["Body"]["Data"]["DeviceStatus"]["ErrorCode"] rather jsonObject["Head"]["Status"]["Code"] which one is always 0
In addition, I commented logDebugMessage("JSON: " + str(jsonData)) dans getInverterRealtimeData
To be clean, we should test jsonObject["Body"]["Data"]["DeviceStatus"]["ErrorCode"] (307 during night)

def isInverterActive(self, jsonObject):
return jsonObject["Body"]["Data"]["DeviceStatus"]["ErrorCode"] == 0

@sincze
Copy link
Contributor

sincze commented Apr 15, 2023

With the help from this thread I started to modify the plugin a bit so it continues to work for me with the necessary additional checks.
https://github.com/sincze/domoticz-fronius-inverter-plugin

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

3 participants