Excuse me for the late reaction, nice to hear the you used my experience as a motivation!
Preheps it is also posible (for @GGravelingen ) to look at the libcoap install script, i had some problems whit installing it.
Regards
dzjr
Moderator: leecollings
Excuse me for the late reaction, nice to hear the you used my experience as a motivation!
Removing the dependency on libcoap is the next big thing on the list, I just need to decide whether to keep using python for the adapter or switch it to something that supports COAPS a bit more natively.
Could I as you a question, as I do not have access to a synolgy? How easy (or difficult) would it be to compile and run a golang application on a synology nas? I am currently experimenting with other implementations of the plugin.MichaelvK wrote: ↑Sunday 09 September 2018 19:54 Thanks!
Got it working indeed , missed an update of Domoticz, but as this is handled as a package, had to pick a beta from Jadahl.
Great!
All I now have to figure out is to have the "python3 tradfri.tac" as a daemon / service on Synology.
Not as easy as it sounds..
Great stuff this plugin!!
Hello Moroen (and others here)moroen wrote: ↑Tuesday 04 September 2018 22:38 The latest version of the plugin's development branch now has a rather major change, a change that will break a current installation of the plugin, though rather easy to fix.
Instead of generating a (or using a known) IDENT/PSK pair, and then entering this information on the plugin setup page, the IDENT/PSK is handled by the adaptor, and generated using a configure.py python scipt, which need to be executed once before the adapter starts.
Anyone updating to the newest version are encouraged to the check out the readme for instructions, and report errors, problems or suggestions in this thread. Hopefully this change will alleviate a rather common problem getting the adapter to run, as you only need to supply the gateway IP and master-key on setup, no more manually using the coap-client directly to generate the IDENT/PSK-pair.
Regards,
M
I am not familiar with golang, sorry about that.
Code: Select all
sudo /volume1/@entware-ng/opt/bin/python3 /usr/local/domoticz/var/plugins/IKEA-Tradfri/tradfri.tac
Code: Select all
Initializing gateway
Unhandled Error
Traceback (most recent call last):
File "/opt/lib/python3.6/site-packages/twisted/python/log.py", line 103, in callWithLogger
return callWithContext({"system": lp}, func, *args, **kw)
File "/opt/lib/python3.6/site-packages/twisted/python/log.py", line 86, in callWithContext
return context.call({ILogContext: newCtx}, func, *args, **kw)
File "/opt/lib/python3.6/site-packages/twisted/python/context.py", line 122, in callWithContext
return self.currentContext().callWithContext(ctx, func, *args, **kw)
File "/opt/lib/python3.6/site-packages/twisted/python/context.py", line 85, in callWithContext
return func(*args,**kw)
--- <exception caught here> ---
File "/opt/lib/python3.6/site-packages/twisted/internet/posixbase.py", line 614, in _doReadOrWrite
why = selectable.doRead()
File "/opt/lib/python3.6/site-packages/twisted/internet/tcp.py", line 243, in doRead
return self._dataReceived(data)
File "/opt/lib/python3.6/site-packages/twisted/internet/tcp.py", line 249, in _dataReceived
rval = self.protocol.dataReceived(data)
File "/usr/local/domoticz/var/plugins/IKEA-Tradfri/tradfri.tac", line 88, in dataReceived
self.factory.initGateway(self, command)
File "/usr/local/domoticz/var/plugins/IKEA-Tradfri/tradfri.tac", line 287, in initGateway
self.devices = self.api(self.api(self.gateway.get_devices()))
File "/opt/lib/python3.6/site-packages/pytradfri-5.5.1-py3.6.egg/pytradfri/api/libcoap_api.py", line 96, in request
File "/opt/lib/python3.6/site-packages/pytradfri-5.5.1-py3.6.egg/pytradfri/api/libcoap_api.py", line 85, in _execute
pytradfri.error.RequestTimeout:
Unfortunately, the tradfri outlets are still not available here in Norway, and until I get my hands on a couple of these things, I don't think I'll be able to implement support for them in the plugin. If someone could post the model description I might be able to get it working without having a real outlet, but I wouldn't be to hopeful.rwijbenga wrote: ↑Monday 17 September 2018 13:13 @moroen
Ikea has now the new Control Outlet plugs in store, and I have them here.![]()
But the are not yet working with this plugin, the work in the Ikea app.
I guess the device code/name must be added to devices.ini.....
Or are you planning an update for support of the Control Outlet?
Adding controllers would be a high priority, but as far as I know, it's not currently possible to monitor these devices using the coap-api, but I haven't checked this in a while...heggink wrote: ↑Monday 01 October 2018 10:42 @moroen: many thanks for the plugin. Took a bit of reading thru the entire thread to figure out which combination of components I needed but works great now.
Couple remaining questions:
- any thoughts on adding the controllers as devices in domoticz? motion sensors and so on? Would be great to use tradfri actuators in domoticz for other purposes...
Again, great work and cannot wait to see the wall plugs included.
- what is a workable polling frequency? Especially if the actuators are also available as deives, any thoughts on the possibility of a notification (from the coap adapter) rather than a polling approach?
H
Hi!Stimpy68 wrote: ↑Monday 01 October 2018 13:21 Hi guys, I can't get the plugin updated. I want to use the beta of Domoticz because of a bug in Hue that is fixed in the beta. But after updating domoticz to beta the Tradfri plugin stops working. Updated that to the development branch version. But now the plugin won't connect to libcoap because it broke. It won't start. Anyone else having this problem (and a solution maybe)
Code: Select all
domoticz/plugins/IKEA-Tradfri$ sudo systemctrl stop domoticz
domoticz/plugins/IKEA-Tradfri$ sudo systemctrl stop ikea-tradfri
domoticz/plugins/IKEA-Tradfri$ ./configure.py IP GATEWAY-KEY
domoticz/plugins/IKEA-Tradfri$ sudo systemctrl start ikea-tradfri
domoticz/plugins/IKEA-Tradfri$ sudo systemctrl stop domoticz
Hi Moroen,moroen wrote:Adding controllers would be a high priority, but as far as I know, it's not currently possible to monitor these devices using the coap-api, but I haven't checked this in a while...heggink wrote: ↑Monday 01 October 2018 10:42 @moroen: many thanks for the plugin. Took a bit of reading thru the entire thread to figure out which combination of components I needed but works great now.
Couple remaining questions:
- any thoughts on adding the controllers as devices in domoticz? motion sensors and so on? Would be great to use tradfri actuators in domoticz for other purposes...
Again, great work and cannot wait to see the wall plugs included.
- what is a workable polling frequency? Especially if the actuators are also available as deives, any thoughts on the possibility of a notification (from the coap adapter) rather than a polling approach?
H
As far as a workable polling interval, I would generally recommend as long an interval as possible, as to frequent polling seems to crash the gateway from time to time. Getting proper observation has proven to be a major stumbling block, as I've been unable to implement this in any kind of reliable way. Either the gateway stops sending notifications after a variable number of observations or after a variable amount of time. I've even tried to implement the adapter in other languages (where the one using golang is the most complete) to get reliable observations, but to no avail. I'm not giving up, but it's currently not a high priority.
I'm very interested in you experience in getting the plugin to work. I've been toying with various version of the plugin for so long now, that I'm probably completely blind to the different steps needed in getting it to work. I try to install it "on a clean system" (actually a debian docker-image) when something in the setup changes, but I'm probably making way to many assumptions along the way. So if you would be as kind as to point out what you found difficult, I could try to make the readme/instructions a bit clearer, or if you feel so inclined, update the readme and issue a pull request!
Regards,
M
Code: Select all
Failed to connect to IKEA tradfri COAP-adapter! Status: 111 Description: Connection refused
Code: Select all
python3 tradfri.tac
Code: Select all
pi@domoticz:~/domoticz/plugins/IKEA-Tradfri $ sudo systemctl status ikea-tradfri.service
● ikea-tradfri.service - IKEA Tradfri COAP-adapter
Loaded: loaded (/lib/systemd/system/ikea-tradfri.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Fri 2018-10-05 23:18:03 CEST; 10min ago
Main PID: 2999 (code=exited, status=1/FAILURE)
Oct 05 23:18:03 domoticz systemd[1]: ikea-tradfri.service: Failed with result 'exit-code'.
Oct 05 23:18:03 domoticz systemd[1]: ikea-tradfri.service: Service hold-off time over, scheduling restart.
Oct 05 23:18:03 domoticz systemd[1]: Stopped IKEA Tradfri COAP-adapter.
Oct 05 23:18:03 domoticz systemd[1]: ikea-tradfri.service: Start request repeated too quickly.
Oct 05 23:18:03 domoticz systemd[1]: Failed to start IKEA Tradfri COAP-adapter.
Oct 05 23:18:03 domoticz systemd[1]: ikea-tradfri.service: Unit entered failed state.
Oct 05 23:18:03 domoticz systemd[1]: ikea-tradfri.service: Failed with result 'exit-code'.
Users browsing this forum: No registered users and 1 guest