moroen / IKEA-Tradfri-plugin

A Python plugin for Domoticz to controll IKEA Gateway
68 stars 23 forks source link

error after upgrade #120

Closed MHagreis closed 3 years ago

MHagreis commented 3 years ago

2020-11-03 15:42:17.194 Error: (IKEA-Tradfri) ----> Line 773 in '/home/pi/domoticz/plugins/IKEA-Tradfri/plugin.py', function onHeartbeat 2020-11-03 15:42:17.194 Error: (IKEA-Tradfri) ----> Line 730 in '/home/pi/domoticz/plugins/IKEA-Tradfri/plugin.py', function onHeartbeat 2020-11-03 15:42:27.164 Error: (IKEA-Tradfri) 'onHeartbeat' failed 'NameError':'name 'close_connection' is not defined'. 2020-11-03 15:42:27.164 Error: (IKEA-Tradfri) ----> Line 773 in '/home/pi/domoticz/plugins/IKEA-Tradfri/plugin.py', function onHeartbeat 2020-11-03 15:42:27.164 Error: (IKEA-Tradfri) ----> Line 730 in '/home/pi/domoticz/plugins/IKEA-Tradfri/plugin.py', function onHeartbeat 2020-11-03 15:42:36.016 (Buienradar) General/Custom Sensor (Next Rainshower Leadtime) 2020-11-03 15:42:37.186 Error: (IKEA-Tradfri) 'onHeartbeat' failed 'NameError':'name 'close_connection' is not defined'. 2020-11-03 15:42:37.186 Error: (IKEA-Tradfri) ----> Line 773 in '/home/pi/domoticz/plugins/IKEA-Tradfri/plugin.py', function onHeartbeat 2020-11-03 15:42:37.186 Error: (IKEA-Tradfri) ----> Line 730 in '/home/pi/domoticz/plugins/IKEA-Tradfri/plugin.py', function onHeartbeat

MHagreis commented 3 years ago

fixed by re-installing setting key again and renaming the tradfricoap in the IKEA-Tradfri folder to tradfricoap-old (later will remove it :-) )

Bolten88 commented 3 years ago

Hello @MHagreis i receive these errors as well. Can you describe more detailed what you did to resolve it?

2020-11-06 03:39:25.994 Error: (IKEA Tradfri) 'onHeartbeat' failed 'JSONDecodeError'. 2020-11-06 03:39:25.994 Error: (IKEA Tradfri) ----> Line 773 in '/home/pi/domoticz/plugins/IKEA-Tradfri/plugin.py', function onHeartbeat 2020-11-06 03:39:25.994 Error: (IKEA Tradfri) ----> Line 728 in '/home/pi/domoticz/plugins/IKEA-Tradfri/plugin.py', function onHeartbeat 2020-11-06 03:39:25.994 Error: (IKEA Tradfri) ----> Line 210 in '/home/pi/domoticz/plugins/IKEA-Tradfri/plugin.py', function indexRegisteredDevices 2020-11-06 03:39:25.994 Error: (IKEA Tradfri) ----> Line 355 in '/usr/local/lib/python3.7/dist-packages/tradfricoap/device.py', function get_devices 2020-11-06 03:39:25.995 Error: (IKEA Tradfri) ----> Line 348 in '/usr/lib/python3.7/json/__init__.py', function loads 2020-11-06 03:39:25.995 Error: (IKEA Tradfri) ----> Line 337 in '/usr/lib/python3.7/json/decoder.py', function decode 2020-11-06 03:39:25.995 Error: (IKEA Tradfri) ----> Line 355 in '/usr/lib/python3.7/json/decoder.py', function raw_decode

@moroen or is there something else? Eveything is working fine besides these errors.

moroen commented 3 years ago

@Bolten88

Have you removed the tradfricoap directory from the plugin?

Bolten88 commented 3 years ago

@Bolten88

Have you removed the tradfricoap directory from the plugin?

Yes, i did that. That was one of the action with the upgrade right?

Knipsel

MHagreis commented 3 years ago

I did that that helped but also inserted the key once more via config (hub key) with the following command $ python3 plugin.py config gw IP KEY

Bolten88 commented 3 years ago

I did that that helped but also inserted the key once more via config (hub key) with the following command $ python3 plugin.py config gw IP KEY

I did that a few days ago allready because i added a new IKEA wall plug to the system. But i will do that again to be sure and see if the error returns or not. I see the error like once a day so i will look for it tomorrow.

moroen commented 3 years ago

@Bolten88

Looking closer at the error, you definitely have a different error than MHagreis! The plugin appears to chocke on a unknown reply from the gateway, I suspect it might be timeout of some sort. I'll take closer look at it, but I have understood correctly that the plugin otherwise works?

Bolten88 commented 3 years ago

@moroen i figured out what is causing the error. It is sort of a human error thing ;-).

There was a small change in my network. I connected the IKEA gateway directly to my router. This router restarts every night while i'm asleep. Offcourse during this reboot the gateway is not reachable and domoticz/plugin is complaining about that. I matched the times of the error witch the time of the reboot. I plugged the gateway back to the switch where domoticz is connected to and then the error did not return anymore.

moroen commented 3 years ago

So it was a kind of timeout... 👍