deconz-rest-plugin: Transition (fading in/out of lights) stopped working in .76 in home assistant

Hello!

The transition feature is being ignored in .76. Works great in .75

Example from an automation in Home Assistant - it fades out over a time of 30 seconds (in .75) but just turns off in .76:

action:
  - data:
      entity_id:
        - light.lampa_taket_kontoret
        - light.lampa_ikea_rgb
        - light.ledstrip_skrivbordet
        - light.lampa_kontoret_bakom_monitorn
        - light.takpanel_kontor
        - light.lampa_kistan
        - light.led_panel_jormlien
      transition: 30
    service: light.turn_off

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 2
  • Comments: 16 (1 by maintainers)

Most upvoted comments

Ok, with https://github.com/ebaauw/deconz-rest-plugin/commit/56b3624200bf0b0ac334e363786b5709a84914a7, the behaviour should be:

Body Command(s)
{"on": false} Off with Effect (0, 0)
{"on": false, "transitiontime": t}
(Note that t is ignored)
Off with Effect (0, 0)
{"on": false, "bri": b} Move to Level (b, 4)
Off with Effect (0, 0)
{"on": false, "bri": b, "transitiontime": t}
Note that b is ignored)
Move to Level (with On/Off) (0, t)

This is the same as the Hue bridge, except for {"on": false, "transitiontime": t}, as per my remark above.

Note that Off with Effect is sent only to Hue lights; Off is sent to other lights.

A PUT to a light state with a body of {"on": false, "bri": 0, "transitiontime": 300} now results in a Move to Level (0, 300), followed by an Off with Effect (0, 0), effectively cancelling the transition. I think it used to result in a Move to Level (with On/Off) (0, 300).

The change was intentional, see https://github.com/dresden-elektronik/deconz-rest-plugin/issues/1111#issuecomment-456464872:

[…] except when turning the light off with a transitiontime. The light comes back on at bri 1 instead of at the previous or specified bri. It might be better to ignore the transitiontime when bri is not specified (similar to setting the light on) and to send Move to Level (b, t), followed by an Off with Effect (0, 1) when it is.

I don’t recall exactly what I was thinking back in January. Not all lights will actually turn off on Move to Level (with On/Off), so maybe that was my reasoning no longer to send Move to Level (with On/Off). But indeed, now it’s no longer possible to turn a light off slowly with one REST API call. I still think it’s a good idea to have changed the logic for {"on": false, "transitiontime": 300} to Off with Effect (0, 0), but {"on": false, "bri": 0, "transitiontime": 300} should still result in a Move to Level (with On/Off) (0, 300).