peterkappelt / Tradfri-FHEM

A Module for the FHEM Home-Control Software which enables connectivity to the IKEA Trådfri gateway
http://electronic.kappelt.net/wordpress/ikea-tradfri-module-for-fhem/
GNU General Public License v3.0
24 stars 8 forks source link

Tradfri switches as sensors #2

Closed cbergmann closed 7 years ago

cbergmann commented 7 years ago

I could not find a documentation how to use the switch/dimmer as fhem control device. I am new to fhem and it could absolutely be that I missed it. This should be possible because the group state is updated in the app in real-time. Therefore the gateway must send something to the network on which we should be able to react.

Have you done any work in this direction? Otherwise I will try to use wireshark to reverse the protocol.

Thanks in advance for any directions.

peterkappelt commented 7 years ago

Hi,

simple answer: You can't, at least not directly. We've already discussed that in the FHEM forum, but I suppose only in german.

Both the switch and the dimmer act transparently and just write their new states (like on/ off, brightness, ...) to a group. However, if you want to use an IKEA dimmer as an event source in FHEM to trigger some actions, but you don't want to control Tradfri-devices with that dimmer, you can do as follows: Just create a new group and only put the dimmer in it, no other devices. You can now define a TradfriGroup in FHEM, that should react to the actions of the dimmer.

If you use the mainstream version of this module, there will be some limitations. Due to the used software this module uses polling, i.e. reads the data once every x seconds from the gateway. You can set this period with the attribute "autoUpdateInterval". That means, that there might be some sort of latency between the dimmer action and the update in FHEM. If this is no problem for you - just try it. If this bothers you: be a bit patient. There is some functionality in development, it'll update the values almost instantly.

I hope I've unterstood your question the right way and my answer was helpful. Fell free to respnd if there are still open points.

Greetings, Peter

cbergmann commented 7 years ago

Hallo,

Wir können auch gerne auf deutsch weiter machen :) ich hab den thread noch nicht ganz gelesen. Er ist ja mittlerweile etwas länger.

Ich werde mich reinlesen und schauen ob ich was beitragen kann.

Danke erstmal.