moroen wrote: ↑Sunday 17 September 2017 18:49
andi216 wrote: ↑Friday 15 September 2017 19:17
I've reproduced this error by specifying the wrong key, are you sure the key your using is correct?
key is correct !
I checked with the next order $ python3 -i -m pytradfri IP KEY (and it works)
Hm, I'm running out of ideas... coap-client must work from the command line, but since pytradfri works, I guess it somehow does... I'll think some more...
Regards,
M
First of all, hats off to Moroen. I used your instruction to get this plugin running in domoticz. I was up and running within one hour
However, I seem to be having the same problem as andi216, regarding groups. I have bought 4 bulbs, a hub and a controller. I first connected the controller to the hub and next I connected all 4 bulbs to the controller. Both the controller and the app were able to control the lights.
After that I installed the ikea-tradfri plugin using the supplied instructions. I can control the individual lights using domoticz then, however the group does not show up. Tradfri.tac shows:
Code: Select all
2017-10-09T23:04:19+0200 [stdout#info] Unable to iterate groups
2017-10-09T23:04:19+0200 [stdout#info] Error in annouce: 'Group' object is not iterable
If I enable "observe changes" in domoticz, the "Error in annouce: 'Group' object is not iterable" message pops up about every 2 seconds.
Domoticz shows:
Code: Select all
2017-10-09 23:09:43.398 PluginSystem: Starting I/O service thread.
2017-10-09 23:09:43.448 (IkeaTradfri1) Connected successfully to: 192.168.1.59
2017-10-09 23:09:43.449 (IkeaTradfri1) Received: b'{"action": "clientConnect", "version": "0.4", "status": "Ok"}'
2017-10-09 23:09:44.451 (IkeaTradfri1) Received: b'{"action": "setConfig", "status": "Ok"}'
2017-10-09 23:09:45.053 (IkeaTradfri1) Received: b'{"action": "getLights", "result": [{"Type": "Light", "HasWB": true, "Dimmable": true, "HasRGB": false, "DeviceID": 65537, "Name": "BuitenlampLinksVoor"}, {"Type": "Light", "HasWB": true, "Dimmable": true, "HasRGB": false, "DeviceID": 65538, "Name": "BuitenlampRechtsAchter"}, {"Type": "Light", "HasWB": true, "Dimmable": true, "HasRGB": false, "DeviceID": 65539, "Name": "BuitenlampRechtsVoor"}, {"Type": "Light", "HasWB": true, "Dimmable": true, "HasRGB": false, "DeviceID": 65540, "Name": "BuitenlampLinksAchter"}], "status": "Ok"}'
2017-10-09 23:09:45.055 (IkeaTradfri1) Received: b'{"action": "deviceUpdate", "result": [{"Level": 1, "Hex": null, "DeviceID": 65537, "Name": "BuitenlampLinksVoor", "State": false}], "status": "Ok"}'
2017-10-09 23:09:45.058 (IkeaTradfri1) Received: b'{"action": "deviceUpdate", "result": [{"Level": 1, "Hex": null, "DeviceID": 65538, "Name": "BuitenlampRechtsAchter", "State": false}], "status": "Ok"}'
2017-10-09 23:09:45.060 (IkeaTradfri1) Received: b'{"action": "deviceUpdate", "result": [{"Level": 1, "Hex": null, "DeviceID": 65539, "Name": "BuitenlampRechtsVoor", "State": false}], "status": "Ok"}'
2017-10-09 23:09:45.063 (IkeaTradfri1) Received: b'{"action": "deviceUpdate", "result": [{"Level": 1, "Hex": null, "DeviceID": 65540, "Name": "BuitenlampLinksAchter", "State": false}], "status": "Ok"}'
coap-client -k MY_KEY coaps://M.Y.I.P/.well-known/core gives:
Code: Select all
v:1 t:CON c:GET i:c0fd {} [ ]
<//15001/65536>;ct=0;obs,<//15001/65537>;ct=0;obs,<//15001/65538>;ct=0;obs,<//15001/65539>;ct=0;obs,<//15001/65540>;ct=0;obs,<//15004/160628>;ct=0;obs,<//15005/160628>;ct=0;obs,<//15005/160628/218479>;ct=0;obs,<//15005/160628/228749>;ct=0;obs,<//15005/160628/211235>;ct=0;obs,<//15001>;ct=0;obs,<//15001/reset>;ct=0,<//status>;ct=0;obs,<//15005>;ct=0;obs,<//15004>;ct=0;obs,<//15004/add>;ct=0,<//15004/remove>;ct=0,<//15006>;ct=0;obs,<//15011/15012>;ct=0;obs,<//15011/9034>;ct=0,<//15011/9030>;ct=0,<//15011/9031>;ct=0,<//15011/9063>;ct=0,<//15011/9033>;ct=0,<//15010>;ct=0;obs
So no groups are advertised. If I add a second group in the app and move one bulb to it, it does show groups.
Tradfri.tac does not show an error/warning about groups anymore, however another error pops up:
Code: Select all
2017-10-09T23:06:02+0200 [stdout#info] Connected from IPv4Address(TCP, '127.0.0.1', 44090)
2017-10-09T23:06:02+0200 [stdout#info] Error in annouce: 160628
The " Error in annouce: 160628" message pops up every 2 seconds if I enable "observe changes" in domoticz.
Domoticz log does show the two groups now:
Code: Select all
2017-10-09 23:06:02.175 (IkeaTradfri1) Initialized version 1.0.3, author 'moroen'
2017-10-09 23:06:02.177 PluginSystem: Starting I/O service thread.
2017-10-09 23:06:02.228 (IkeaTradfri1) Connected successfully to: 192.168.1.59
2017-10-09 23:06:02.228 (IkeaTradfri1) Received: b'{"action": "clientConnect", "status": "Ok", "version": "0.4"}'
2017-10-09 23:06:03.381 (IkeaTradfri1) Received: b'{"action": "setConfig", "status": "Ok"}'
2017-10-09 23:06:04.082 (IkeaTradfri1) Received: b'{"action": "getLights", "status": "Ok", "result": [{"Type": "Light", "Name": "BuitenlampLinksVoor", "Dimmable": true, "HasWB": true, "DeviceID": 65537, "HasRGB": false}, {"Type": "Light", "Name": "BuitenlampRechtsAchter", "Dimmable": true, "HasWB": true, "DeviceID": 65538, "HasRGB": false}, {"Type": "Light", "Name": "BuitenlampRechtsVoor", "Dimmable": true, "HasWB": true, "DeviceID": 65539, "HasRGB": false}, {"Type": "Light", "Name": "BuitenlampLinksAchter", "Dimmable": true, "HasWB": true, "DeviceID": 65540, "HasRGB": false}, {"DeviceID": 193834, "Name": "Group - BuitenGroup", "Dimmable": true, "HasWB": false, "Type": "Group"}, {"DeviceID": 160628, "Name": "Group - Buitenverlichting", "Dimmable": true, "HasWB": false, "Type": "Group"}]}'
2017-10-09 23:06:04.103 (IkeaTradfri1) Received: b'{"action": "deviceUpdate", "status": "Ok", "result": [{"DeviceID": 65537, "State": false, "Name": "BuitenlampLinksVoor", "Level": 1, "Hex": null}]}'
2017-10-09 23:06:04.106 (IkeaTradfri1) Received: b'{"action": "deviceUpdate", "status": "Ok", "result": [{"DeviceID": 65538, "State": true, "Name": "BuitenlampRechtsAchter", "Level": 254, "Hex": null}]}'
2017-10-09 23:06:04.109 (IkeaTradfri1) Received: b'{"action": "deviceUpdate", "status": "Ok", "result": [{"DeviceID": 65539, "State": false, "Name": "BuitenlampRechtsVoor", "Level": 1, "Hex": null}]}'
2017-10-09 23:06:04.111 (IkeaTradfri1) Received: b'{"action": "deviceUpdate", "status": "Ok", "result": [{"DeviceID": 65540, "State": false, "Name": "BuitenlampLinksAchter", "Level": 1, "Hex": null}]}'
2017-10-09 23:06:04.114 (IkeaTradfri1) Received: b'{"action": "deviceUpdate", "status": "Ok", "result": [{"DeviceID": 193834, "State": true, "Name": "BuitenGroup", "Level": 0}]}'
2017-10-09 23:06:04.117 (IkeaTradfri1) Received: b'{"action": "deviceUpdate", "status": "Ok", "result": [{"DeviceID": 160628, "State": false, "Name": "Buitenverlichting", "Level": 0}]}'
coap-client -k MY_KEY coaps://M.Y.I.P/.well-known/core gives:
Code: Select all
v:1 t:CON c:GET i:79c6 {} [ ]
<//15001/65536>;ct=0;obs,<//15001/65537>;ct=0;obs,<//15001/65538>;ct=0;obs,<//15001/65539>;ct=0;obs,<//15001/65540>;ct=0;obs,<//15004/160628>;ct=0;obs,<//15004/186448>;ct=0;obs,<//15005/160628>;ct=0;obs,<//15005/186448/209628>;ct=0;obs,<//15005/186448/228123>;ct=0;obs,<//15005/186448/207949>;ct=0;obs,<//15005/186448>;ct=0;obs,<//15005/160628/218479>;ct=0;obs,<//15005/160628/228749>;ct=0;obs,<//15005/160628/211235>;ct=0;obs,<//15001>;ct=0;obs,<//15001/reset>;ct=0,<//status>;ct=0;obs,<//15005>;ct=0;obs,<//15004>;ct=0;obs,<//15004/add>;ct=0,<//15004/remove>;ct=0,<//15006>;ct=0;obs,<//15011/15012>;ct=0;obs,<//15011/9034>;ct=0,<//15011/9030>;ct=0,<//15011/9031>;ct=0,<//15011/9063>;ct=0,<//15011/9033>;ct=0,<//15010>;ct=0;obs
So it looks like if there is only one group it does not advertise it as a group.
Moroen can you have a look at "Unable to iterate groups" error and the "Error in annouce: 160628"?