Page 29 of 48
Re: [REQUEST] Ikea Trådfri Gateway (smart lights hub controller) plugin?
Posted: Tuesday 02 April 2019 20:20
by schulpr
Hi M.,
It fine now! I kept you quite busy
. Thanks for your great plugin!
Kind regards, Rob
Re: [REQUEST] Ikea Trådfri Gateway (smart lights hub controller) plugin?
Posted: Tuesday 02 April 2019 21:32
by moroen
schulpr wrote: ↑Tuesday 02 April 2019 20:20
Hi M.,
It fine now! I kept you quite busy
. Thanks for your great plugin!
Kind regards, Rob
Glad it worked out, you helped me identify a rather gaping hole in my testing procedures!
Regards,
M
Re: [REQUEST] Ikea Trådfri Gateway (smart lights hub controller) plugin?
Posted: Friday 05 April 2019 19:46
by nigels0
Hi,
Would this work with XIAOMI MIJIA SENSOR. It seems to use Zigbee, but I’d want it to trigger when humidity gets to a certain level (for a shower to switch on a fan)
https://www.ebay.co.uk/itm/DOMOTICA-XIA ... 2749.l2649
Re: [REQUEST] Ikea Trådfri Gateway (smart lights hub controller) plugin?
Posted: Sunday 07 April 2019 13:08
by nigels0
In addition to the question about checking the value of a sensor, I found that it was necessary to run at the beginning (one for the instructions):
Code: Select all
sudo apt-get install build-essential autoconf automake libtool
Re: [REQUEST] Ikea Trådfri Gateway (smart lights hub controller) plugin?
Posted: Sunday 07 April 2019 13:37
by moroen
I know next to nothing about how zigbee actually works, buy I guess it would be possible to add some kind of support for this, provided it's at all possible to add it to the Ikea-gateway. As long as it's possible to to add it, and it shows up in the coap-api of the gateway, it might be possible to at least read the value of the sensor.
nigels0 wrote: ↑Sunday 07 April 2019 13:08
In addition to the question about checking the value of a sensor, I found that it was necessary to run at the beginning (one for the instructions):
Code: Select all
sudo apt-get install build-essential autoconf automake libtool
Thanks! I've updated the readme...
Regards,
M
Re: [REQUEST] Ikea Trådfri Gateway (smart lights hub controller) plugin?
Posted: Tuesday 23 April 2019 0:02
by Toolman
Hi, I don't know what caused my Domoticz-system to give the following problems (it was working perfectly before) but since a short time it is logging the following (maybe because I changed my router?):
2019-04-22 23:56:17.106 (Tradfri) Device has disconnected
2019-04-22 23:56:31.332 (Tradfri) Connected successfully to: 127.0.0.1
and this keeps repeating.
I've stopped te service and did a manual start and this is the output:
pi@raspberrypi:~/domoticz/plugins/IKEA-Tradfri $ sudo systemctl stop ikea-tradfri
pi@raspberrypi:~/domoticz/plugins/IKEA-Tradfri $ python3 tradfri.tac
IKEA-tradfri COAP-adaptor version 0.8.3 started (command line)!
Connected from IPv4Address(TCP, '127.0.0.1', 54634)
Data received: b'{"observe": "False", "pollinterval": "30", "action": "initGateway", "groups": "True"}'
Initializing gateway
Unhandled Error
Traceback (most recent call last):
File "/usr/local/lib/python3.5/dist-packages/twisted/python/log.py", line 103, in callWithLogger
return callWithContext({"system": lp}, func, *args, **kw)
File "/usr/local/lib/python3.5/dist-packages/twisted/python/log.py", line 86, in callWithContext
return context.call({ILogContext: newCtx}, func, *args, **kw)
File "/usr/local/lib/python3.5/dist-packages/twisted/python/context.py", line 122, in callWithContext
return self.currentContext().callWithContext(ctx, func, *args, **kw)
File "/usr/local/lib/python3.5/dist-packages/twisted/python/context.py", line 85, in callWithContext
return func(*args,**kw)
--- <exception caught here> ---
File "/usr/local/lib/python3.5/dist-packages/twisted/internet/posixbase.py", line 614, in _doReadOrWrite
why = selectable.doRead()
File "/usr/local/lib/python3.5/dist-packages/twisted/internet/tcp.py", line 205, in doRead
return self._dataReceived(data)
File "/usr/local/lib/python3.5/dist-packages/twisted/internet/tcp.py", line 211, in _dataReceived
rval = self.protocol.dataReceived(data)
File "tradfri.tac", line 90, in dataReceived
self.factory.initGateway(self, command)
File "tradfri.tac", line 366, in initGateway
self.devices = self.api(self.api(self.gateway.get_devices()))
File "/usr/local/lib/python3.5/dist-packages/pytradfri/api/libcoap_api.py", line 96, in request
return self._execute(api_commands, timeout=timeout)
File "/usr/local/lib/python3.5/dist-packages/pytradfri/api/libcoap_api.py", line 85, in _execute
raise RequestTimeout() from None
pytradfri.error.RequestTimeout:
Disconnected
Connected from IPv4Address(TCP, '127.0.0.1', 54636)
Data received: b'{"observe": "False", "pollinterval": "30", "action": "initGateway", "groups": "True"}'
Initializing gateway
------------
This keeps repeating.
Any advice would be welcome.
Regards,
Michel
Re: [REQUEST] Ikea Trådfri Gateway (smart lights hub controller) plugin?
Posted: Tuesday 23 April 2019 0:49
by moroen
Toolman wrote: ↑Tuesday 23 April 2019 0:02
Hi, I don't know what caused my Domoticz-system to give the following problems (it was working perfectly before) but since a short time it is logging the following (maybe because I changed my router?):
2019-04-22 23:56:17.106 (Tradfri) Device has disconnected
2019-04-22 23:56:31.332 (Tradfri) Connected successfully to: 127.0.0.1
and this keeps repeating.
I've stopped te service and did a manual start and this is the output:
pi@raspberrypi:~/domoticz/plugins/IKEA-Tradfri $ sudo systemctl stop ikea-tradfri
pi@raspberrypi:~/domoticz/plugins/IKEA-Tradfri $ python3 tradfri.tac
IKEA-tradfri COAP-adaptor version 0.8.3 started (command line)!
---
pytradfri.error.RequestTimeout:
Disconnected
Connected from IPv4Address(TCP, '127.0.0.1', 54636)
Data received: b'{"observe": "False", "pollinterval": "30", "action": "initGateway", "groups": "True"}'
Initializing gateway
------------
This keeps repeating.
Any advice would be welcome.
Regards,
Michel
The adapter can't connect to the gateway. Are you sure the gateway have the same IP-address as before the change of the router? Can you ping the gateway from the computer running the adapter? If you have the correct IP and can ping the device, I would try to run the configure-script again, generating a new ident/psk-pair...
Regards,
M
Re: [REQUEST] Ikea Trådfri Gateway (smart lights hub controller) plugin?
Posted: Tuesday 23 April 2019 20:31
by Toolman
Thanks for the quick reply Moroen. The IP-address of the gateway hasn't changed and is reachable through ping.
I will run the config script again and see what happens. I'll let you know.
Michel
Re: [REQUEST] Ikea Trådfri Gateway (smart lights hub controller) plugin?
Posted: Tuesday 23 April 2019 23:21
by Toolman
Updated the plugin folder and rerun the config-script. Still a problem. A liitle bit different from last time. The last couple of logging-lines:
--- <exception caught here> ---
File "/usr/local/lib/python3.5/dist-packages/twisted/internet/posixbase.py", line 614, in _doReadOrWrite
why = selectable.doRead()
File "/usr/local/lib/python3.5/dist-packages/twisted/internet/tcp.py", line 205, in doRead
return self._dataReceived(data)
File "/usr/local/lib/python3.5/dist-packages/twisted/internet/tcp.py", line 211, in _dataReceived
rval = self.protocol.dataReceived(data)
File "tradfri.tac", line 100, in dataReceived
self.factory.initGateway(self, command)
File "tradfri.tac", line 214, in initGateway
if command['transitiontime'] == "":
builtins.KeyError: 'transitiontime'
Re: [REQUEST] Ikea Trådfri Gateway (smart lights hub controller) plugin?
Posted: Wednesday 24 April 2019 0:56
by moroen
Toolman wrote: ↑Tuesday 23 April 2019 23:21
Updated the plugin folder and rerun the config-script. Still a problem. A liitle bit different from last time. The last couple of logging-lines:
--- <exception caught here> ---
File "/usr/local/lib/python3.5/dist-packages/twisted/internet/posixbase.py", line 614, in _doReadOrWrite
why = selectable.doRead()
File "/usr/local/lib/python3.5/dist-packages/twisted/internet/tcp.py", line 205, in doRead
return self._dataReceived(data)
File "/usr/local/lib/python3.5/dist-packages/twisted/internet/tcp.py", line 211, in _dataReceived
rval = self.protocol.dataReceived(data)
File "tradfri.tac", line 100, in dataReceived
self.factory.initGateway(self, command)
File "tradfri.tac", line 214, in initGateway
if command['transitiontime'] == "":
builtins.KeyError: 'transitiontime'
On the hardware page of domoticz, for the IKEA-tradfri plugin, make sure that the field "Transition time (tenth of a second):" is not empty and press update. I would guess you've updated from a previous version of the plugin, but haven't updated the settings in Domoticz...
Regards,
M
Re: [REQUEST] Ikea Trådfri Gateway (smart lights hub controller) plugin?
Posted: Wednesday 24 April 2019 20:17
by Toolman
Many thanks Moroen. The Transition Time wasn't visible in Domoticz for my Tradfri. Restarted Domoticz and it was visible, put in a value and now everything is working as it should.
Thanks again.
Regards,
Michel
Re: [REQUEST] Ikea Trådfri Gateway (smart lights hub controller) plugin?
Posted: Wednesday 08 May 2019 21:16
by Varazir
I keep gett this
Code: Select all
2019-05-08 21:14:05.825 Error: CConnection_connect, connect request from 'IKEA' ignored. Transport is connecting.
Anyone know why ?
I get this when I turn off the IKEA hardware /plugin
Code: Select all
2019-05-08 21:17:39.559 (IKEA) Failed to connect to IKEA tradfri COAP-adapter! Status: 125 Description: Operation canceled
2019-05-08 21:17:39.560 (IKEA) Device has disconnected
I have another domoticz running that works fine.
i'm working on setting up a new one.
Re: [REQUEST] Ikea Trådfri Gateway (smart lights hub controller) plugin?
Posted: Thursday 09 May 2019 3:37
by Dnpwwo
@Varazir,
The plugin framework will throw an error like that if you try to connect to something a 2nd time when the 1st request to connect to it has not completed yet. The fact that when you shut the plugin down the framework has to abort the in progress connection backs this up (although I haven't looked at the plugin code).
There are only a couple of things that I can think of that would cause this:
- DNS name resolution is taking a long time (can take up to 30 seconds). Are you using a name or an IP address? If this is a new machine DNS may not be working properly.
- Is there a firewall on your network? Firewalls tend to 'drop' connection requests they don't like 'silently' i.e. they don't inform the requester which can make them wait a long time.
Re: [REQUEST] Ikea Trådfri Gateway (smart lights hub controller) plugin?
Posted: Thursday 09 May 2019 6:56
by Varazir
Dnpwwo wrote:@Varazir,
The plugin framework will throw an error like that if you try to connect to something a 2nd time when the 1st request to connect to it has not completed yet. The fact that when you shut the plugin down the framework has to abort the in progress connection backs this up (although I haven't looked at the plugin code).
There are only a couple of things that I can think of that would cause this:
- DNS name resolution is taking a long time (can take up to 30 seconds). Are you using a name or an IP address? If this is a new machine DNS may not be working properly.
- Is there a firewall on your network? Firewalls tend to 'drop' connection requests they don't like 'silently' i.e. they don't inform the requester which can make them wait a long time.
I'm using IP and I can ping it from the RPi.
No firewall on LAN.
Skickat från min Nokia 7 plus via Tapatalk
Re: [REQUEST] Ikea Trådfri Gateway (smart lights hub controller) plugin?
Posted: Thursday 09 May 2019 21:35
by moroen
Varazir wrote: ↑Thursday 09 May 2019 6:56
Dnpwwo wrote:@Varazir,
The plugin framework will throw an error like that if you try to connect to something a 2nd time when the 1st request to connect to it has not completed yet. The fact that when you shut the plugin down the framework has to abort the in progress connection backs this up (although I haven't looked at the plugin code).
There are only a couple of things that I can think of that would cause this:
- DNS name resolution is taking a long time (can take up to 30 seconds). Are you using a name or an IP address? If this is a new machine DNS may not be working properly.
- Is there a firewall on your network? Firewalls tend to 'drop' connection requests they don't like 'silently' i.e. they don't inform the requester which can make them wait a long time.
I'm using IP and I can ping it from the RPi.
No firewall on LAN.
Skickat från min Nokia 7 plus via Tapatalk
The timeout might be happening in the adapter, to make sure the adapter can communicate with the gateway, try a dry-run:
Regards,
M
Re: [REQUEST] Ikea Trådfri Gateway (smart lights hub controller) plugin?
Posted: Thursday 09 May 2019 21:42
by Varazir
moroen wrote: ↑Thursday 09 May 2019 21:35
The timeout might be happening in the adapter, to make sure the adapter can communicate with the gateway, try a dry-run:
Regards,
M
I get this
Code: Select all
IKEA-tradfri COAP-adaptor version 0.8.8 started (command line)!
Initializing gateway
Transitiontime: 10
Adding light with ID: 65538
Adding light with ID: 65542
Adding light with ID: 65546
Adding light with ID: 65540
Adding light with ID: 65539
Adding light with ID: 65543
Adding light with ID: 65537
Adding light with ID: 65544
Device settings not found for TRADFRI bulb GU10 W 400lm. Creating defaults!
{"action": "getLights", "result": [{"Dimmable": true, "HasRGB": false, "Name": "Taklampa Sovrum", "Type": "Light", "DeviceID": 65537, "HasWB": false}, {"Dimmable": true, "HasRGB": false, "Name": "Taklampa Hall", "Type": "Light", "DeviceID": 65538, "HasWB": false}, {"Dimmable": true, "HasRGB": false, "Name": "Spotlight 1 Hall", "Type": "Light", "DeviceID": 65539, "HasWB": true}, {"Dimmable": true, "HasRGB": false, "Name": "Spotlight 2 Hall", "Type": "Light", "DeviceID": 65540, "HasWB": true}, {"Dimmable": true, "HasRGB": false, "Name": "Spotlight 3 Hall", "Type": "Light", "DeviceID": 65542, "HasWB": true}, {"Dimmable": true, "HasRGB": false, "Name": "Spotlight 1 Tvrum", "Type": "Light", "DeviceID": 65543, "HasWB": true}, {"Dimmable": true, "HasRGB": false, "Name": "Spotlight 2 Tvrum", "Type": "Light", "DeviceID": 65544, "HasWB": true}, {"Dimmable": true, "HasRGB": false, "Name": "Spotlight 3 Tvrum", "Type": "Light", "DeviceID": 65546, "HasWB": true}], "status": "Ok"}
Announcing changed devices!
Failed to set state
Traceback (most recent call last):
File "tradfri.tac", line 441, in <module>
AdaptorFactory()).addErrback(error)
File "tradfri.tac", line 156, in __init__
self.setState(None, "65548", False)
File "tradfri.tac", line 405, in setState
client.transport.write(json.dumps(answer).encode(encoding='utf_8'))
AttributeError: 'NoneType' object has no attribute 'transport'
Re: [REQUEST] Ikea Trådfri Gateway (smart lights hub controller) plugin?
Posted: Friday 10 May 2019 10:45
by moroen
Varazir wrote: ↑Thursday 09 May 2019 21:42
moroen wrote: ↑Thursday 09 May 2019 21:35
The timeout might be happening in the adapter, to make sure the adapter can communicate with the gateway, try a dry-run:
Regards,
M
I get this
Code: Select all
IKEA-tradfri COAP-adaptor version 0.8.8 started (command line)!
Initializing gateway
Transitiontime: 10
Adding light with ID: 65538
Adding light with ID: 65542
Adding light with ID: 65546
Adding light with ID: 65540
Adding light with ID: 65539
Adding light with ID: 65543
Adding light with ID: 65537
Adding light with ID: 65544
Device settings not found for TRADFRI bulb GU10 W 400lm. Creating defaults!
{"action": "getLights", "result": [{"Dimmable": true, "HasRGB": false, "Name": "Taklampa Sovrum", "Type": "Light", "DeviceID": 65537, "HasWB": false}, {"Dimmable": true, "HasRGB": false, "Name": "Taklampa Hall", "Type": "Light", "DeviceID": 65538, "HasWB": false}, {"Dimmable": true, "HasRGB": false, "Name": "Spotlight 1 Hall", "Type": "Light", "DeviceID": 65539, "HasWB": true}, {"Dimmable": true, "HasRGB": false, "Name": "Spotlight 2 Hall", "Type": "Light", "DeviceID": 65540, "HasWB": true}, {"Dimmable": true, "HasRGB": false, "Name": "Spotlight 3 Hall", "Type": "Light", "DeviceID": 65542, "HasWB": true}, {"Dimmable": true, "HasRGB": false, "Name": "Spotlight 1 Tvrum", "Type": "Light", "DeviceID": 65543, "HasWB": true}, {"Dimmable": true, "HasRGB": false, "Name": "Spotlight 2 Tvrum", "Type": "Light", "DeviceID": 65544, "HasWB": true}, {"Dimmable": true, "HasRGB": false, "Name": "Spotlight 3 Tvrum", "Type": "Light", "DeviceID": 65546, "HasWB": true}], "status": "Ok"}
Announcing changed devices!
Failed to set state
Traceback (most recent call last):
File "tradfri.tac", line 441, in <module>
AdaptorFactory()).addErrback(error)
File "tradfri.tac", line 156, in __init__
self.setState(None, "65548", False)
File "tradfri.tac", line 405, in setState
client.transport.write(json.dumps(answer).encode(encoding='utf_8'))
AttributeError: 'NoneType' object has no attribute 'transport'
The adapter communicates with the IKEA-gateway. The error is due to a bug, but it is irrelevant to your problem. So the problem is, in accordance with Dnpwwo's analysis, probably a timeout between domoticz and the adapter. I'll try to help you, but could you please try running the adapter from the command-line, and provide the output from the adapter and relevant parts of the domoticz log.
Code: Select all
$ sudo systemctl stop ikea-tradfri
$ python3 tradfri.tac
Regards,
M
Re: [REQUEST] Ikea Trådfri Gateway (smart lights hub controller) plugin?
Posted: Friday 10 May 2019 13:22
by Varazir
moroen wrote: ↑Friday 10 May 2019 10:45
The adapter communicates with the IKEA-gateway. The error is due to a bug, but it is irrelevant to your problem. So the problem is, in accordance with Dnpwwo's analysis, probably a timeout between domoticz and the adapter. I'll try to help you, but could you please try running the adapter from the command-line, and provide the output from the adapter and relevant parts of the domoticz log.
Code: Select all
$ sudo systemctl stop ikea-tradfri
$ python3 tradfri.tac
Regards,
M
I get nothing when running that command, just a blank line
Code: Select all
pi@zwave2:~/domoticz/IKEA-Tradfri $ python3 tradfri.tac
IKEA-tradfri COAP-adaptor version 0.8.8 started (command line)!
I have symlinked the folder into the plugin folder so domoticz can see it but it shouldn't matter when running this command.
Re: [REQUEST] Ikea Trådfri Gateway (smart lights hub controller) plugin?
Posted: Friday 10 May 2019 21:56
by moroen
Varazir wrote: ↑Friday 10 May 2019 13:22
moroen wrote: ↑Friday 10 May 2019 10:45
The adapter communicates with the IKEA-gateway. The error is due to a bug, but it is irrelevant to your problem. So the problem is, in accordance with Dnpwwo's analysis, probably a timeout between domoticz and the adapter. I'll try to help you, but could you please try running the adapter from the command-line, and provide the output from the adapter and relevant parts of the domoticz log.
Code: Select all
$ sudo systemctl stop ikea-tradfri
$ python3 tradfri.tac
Regards,
M
I get nothing when running that command, just a blank line
Code: Select all
pi@zwave2:~/domoticz/IKEA-Tradfri $ python3 tradfri.tac
IKEA-tradfri COAP-adaptor version 0.8.8 started (command line)!
I have symlinked the folder into the plugin folder so domoticz can see it but it shouldn't matter when running this command.
The adapter is running and waiting for a connection from domoticz. What does the domoticz log show?
Regards,
M
Re: [REQUEST] Ikea Trådfri Gateway (smart lights hub controller) plugin?
Posted: Friday 10 May 2019 22:48
by Varazir
moroen wrote: ↑Friday 10 May 2019 21:56
Varazir wrote: ↑Friday 10 May 2019 13:22
moroen wrote: ↑Friday 10 May 2019 10:45
The adapter communicates with the IKEA-gateway. The error is due to a bug, but it is irrelevant to your problem. So the problem is, in accordance with Dnpwwo's analysis, probably a timeout between domoticz and the adapter. I'll try to help you, but could you please try running the adapter from the command-line, and provide the output from the adapter and relevant parts of the domoticz log.
Code: Select all
$ sudo systemctl stop ikea-tradfri
$ python3 tradfri.tac
Regards,
M
I get nothing when running that command, just a blank line
Code: Select all
pi@zwave2:~/domoticz/IKEA-Tradfri $ python3 tradfri.tac
IKEA-tradfri COAP-adaptor version 0.8.8 started (command line)!
I have symlinked the folder into the plugin folder so domoticz can see it but it shouldn't matter when running this command.
The adapter is running and waiting for a connection from domoticz. What does the domoticz log show?
Regards,
M
I didn't get it I should enable the plugin well here is logs with debug
Code: Select all
2019-05-10 22:49:15.521 (IKEA) Debug logging mask set to: PYTHON PLUGIN QUEUE IMAGE DEVICE CONNECTION MESSAGE ALL
2019-05-10 22:49:15.521 (IKEA) Pushing 'PollIntervalDirective' on to queue
2019-05-10 22:49:15.522 (IKEA) Pushing 'ProtocolDirective' on to queue
2019-05-10 22:49:15.522 (IKEA) Pushing 'ConnectDirective' on to queue
2019-05-10 22:49:15.522 (IKEA) Processing 'PollIntervalDirective' message
2019-05-10 22:49:15.522 (IKEA) Heartbeat interval set to: 5.
2019-05-10 22:49:15.522 (IKEA) Processing 'ProtocolDirective' message
2019-05-10 22:49:15.522 (IKEA) Protocol set to: 'JSON'.
2019-05-10 22:49:15.522 (IKEA) Processing 'ConnectDirective' message
2019-05-10 22:49:15.522 (IKEA) Transport set to: 'TCP/IP', 172.0.0.1:1234.
2019-05-10 22:49:15.522 (IKEA) Connect directive received, action initiated successfully.
2019-05-10 22:49:15.191 Status: (IKEA) Stopping threads.
2019-05-10 22:49:15.191 Status: (IKEA) Stopped.
2019-05-10 22:49:15.191 Status: (IKEA) Started.
2019-05-10 22:49:15.517 Status: (IKEA) Entering work loop.
2019-05-10 22:49:15.517 Status: (IKEA) Initialized version 1.1.1, author 'moroen'
2019-05-10 22:49:25.519 (IKEA) Pushing 'onHeartbeatCallback' on to queue
2019-05-10 22:49:25.550 (IKEA) Processing 'onHeartbeatCallback' message
2019-05-10 22:49:25.550 (IKEA) Calling message handler 'onHeartbeat'.
2019-05-10 22:49:25.551 (IKEA) Not connected - nextConnect: 3
2019-05-10 22:49:30.520 (IKEA) Pushing 'onHeartbeatCallback' on to queue
2019-05-10 22:49:30.561 (IKEA) Processing 'onHeartbeatCallback' message
2019-05-10 22:49:30.561 (IKEA) Calling message handler 'onHeartbeat'.
2019-05-10 22:49:30.562 (IKEA) Not connected - nextConnect: 2
2019-05-10 22:49:35.521 (IKEA) Pushing 'onHeartbeatCallback' on to queue
2019-05-10 22:49:35.522 (IKEA) Processing 'onHeartbeatCallback' message
2019-05-10 22:49:35.522 (IKEA) Calling message handler 'onHeartbeat'.
2019-05-10 22:49:35.522 (IKEA) Not connected - nextConnect: 1
2019-05-10 22:49:35.523 Error: CConnection_connect, connect request from 'IKEA' ignored. Transport is connecting.
The shell still shows nothing.