Could you use these new Python3 event scripts for Domoticz's Python plugin system to observe state changes?moroen wrote:Yes, I've checked it out, and considered making the COAP-adaptor using the aiocoap, but decided to stick with the plain pytradfri-module for now, since there are quite a lot of hoops to jump through to get aiocoap working at the moment.Hedda wrote: Did you checkout the new aiocoap implementation option that they added to pytradfri?
Aiocoap experimentation => https://github.com/ggravlingen/pytradfri/pull/28
Also relatest to https://github.com/ggravlingen/pytradfri/issues/29 but not required?
Could you get around not using Twisted with that new aiocoap implementation option?
As to get rid of the need for the adaptor, Dnpwwo has clearly stated that plugins doesn't support spinning off threads or using asynchronous calls. The adaptor takes care of the asynchronous communication with the gateway, which is needed to support notifications of state-changes.
I think it's possible to create a module that controls lights without depending on a external service, but not one that allows for observing state changes (which I think will be even more important down the way, in order to support the motion sensor etc). Until (if ever) plugins support coap+dtls as a native protocol, I fail to see how to support the plugin-system's methods for communication (onConnect, onMessage etc) without some kind of external service that asynchronously observe states and then sends the message about changes to the plugin. I might be completely wrong on that account, naturally...
Checkout => https://github.com/domoticz/domoticz/pull/1571
Like if the plugin could 'subscribe' to specific state events which could be triggered if a state is changed? I understand dnpwwo refer to that new feature as "remote-tracking" which was just added 2-weeks ago.