glenndehaan / ikea-tradfri-coap-docs

How can you communicate to your ikea tradfri gateway/hub through coap-client
MIT License
189 stars 21 forks source link

Transition Time is not a Float #16

Closed domjancik closed 3 years ago

domjancik commented 4 years ago

Hi,

Transitions are ignored when sending commands to Tradfri lights with transition times as float values eg. 10.5 - the light jumps to the specified setting instantly. Integer values work fine.

This leads me to believe that the Transition Time (key 5712) is of type Int and not Float (as written in the documentation), like most of the other parameters.

Joey-1970 commented 4 years ago

Hello Dominik,

for which device this parameter shows a result? I try this, but I don' see a effect..

Joachim

domjancik commented 4 years ago

I've tried it with the TRADFRI E27 600lm color bulb.

The parameter doesn't do anything in itself, it just sets the duration it will take the light to get to the setting you send along with it (brigthness, hex or xy color, ...).

For example, the following command changes the bulb to medium brightness immediately: coap-client -m put -u "$TF_USERNAME" -k "$TF_PRESHARED_KEY" -e '{ "3311": [{ "5851": 127 }] }' "coaps://$TF_GATEWAYIP:5684/15001/$TF_DEVICEID"

Whereas adding the transition time parameter will result in the bulb fading smoothly into the new value: coap-client -m put -u "$TF_USERNAME" -k "$TF_PRESHARED_KEY" -e '{ "3311": [{ "5851": 127, "5712": 10 }] }' "coaps://$TF_GATEWAYIP:5684/15001/$TF_DEVICEID"

From my observation the unit seems to be a 1/10 of a second.

glenndehaan commented 4 years ago

Hi @dominikjancik,

Thats indeed the intended use case. Just sending the fade time will indeed do nothing.

Now the float value worked in the previous version of the hub firmware. But is is possible that they changed this back to just an int.

I will update the documentation. Tnx for your feedback.

Joey-1970 commented 4 years ago

Hello Dominik and Glenn,

thanks for your note - now the fade time works!

Joachim