Transition for scenes is back! 0.109

  • @frenck re-introduced support for transitions in scenes. Both the scene.turn_on and scene.apply services now accept a transition option to make your scene transition on lights look smooth as butter.

source: https://rc.home-assistant.io/blog/2020/04/21/release-109/

yes! this is one of the most anticipated features ever since transition was deprecated for scenes.
a huge thank you for this, is has been such s struggle without it, having lights transition to ‘off’ with the replacing scripts we had to make…

hope this will bring back the scene transition in all its glory.
cool.

btw, and almost ashamed to ask: isn’t there a dedicated thread/chapter on this forum for the Beta’s?

2 Likes

Not on the forum, but the Discord server has a Beta channel for those participating in testing it.

Here: https://discord.gg/evzjFE

1 Like

Is that in the 109.2 release? what is the syntax?
The following does not work in 109.2:

- id: 'xyz'
  alias: sometest
  description: ''
  trigger:
  - platform: time_pattern
    seconds: /10
  condition: []
  action:
  - data:
      entity_id: scene.test1
      transition: 2.5
    service: scene.apply
  - timeout: 00:00:05
    wait_template: ''
  - data:
      entity_id: scene.test2
      transition: 2.5
    service: scene.apply

I’d try it like this.

  trigger:
    platform: time_pattern
    seconds: "/10"
  action:
    - service: scene.turn_on
      data:
        entity_id: scene.test1
        transition: 2.5
    - delay: '00:00:05'
    - service: scene.turn_on
      data:
        entity_id: scene.test2
        transition: 2.5

I used the automation editor in 108. there transition didn’t work.
Then I updated to 109.2 and then probably the Wait was the problem.
Now it works.
Thanks!

1 Like

yea, not sure what or how you got to that wait, but it might be worth creating an issue for that, since it is abracadabra, and not functional at that…

do note a difference with the original scene transitions though: before we could set a transition per entity (lights in my case) within the scene itself which could be different for each light in that scene.

with the new, restored, scene transition, we have to set it for the whole scene, in the service calling that scene.

@frenck, is that correct? and if so, would the original option of setting transition in the scene be something you could have a go at? It was rather nice to be able to set different transitions (eg for the on and off lights) in 1 scene, and simply call that scene.

It is a service property, and thus not part of the scene itself. In other words; transition is a property on how a scene is applied, not the scene itself.

Short course about the original issue: A scene represents a collection of states to restore.

The problem with the “old” solution was, transition isn’t a state. It is not like you walk up to your light blub that is in this state for an hour already and think: “Wow, that is a nice 2.5 second transition on there”!? So, actually it never should have been part of the scene in the first place (like a bunch of other ones, nobody misses apparently :P). While it worked somewhat, it caused issues as well. This has now been removed, because well… it isn’t a state.

So to answer the question of @Mariusthvdb; You can’t apply multiple transition on a single scene. A scene has options on how to apply it as a whole.

Furthermore, it has been build to be extensible now as well. So a media player could technically also apply the transition. e.g., by slowly bringing up/down the volume for the transition period. And any other integration can implement logic on how to process these scene setting options. Furthermore, new scene apply / transition option (other than a transition time) can now be introduced.

So for the long run, we splitted state from the options on how to apply them (for design and removing hacks), while introducing more future proof options that can be used more broadly.

3 Likes

Thanks Franck, good to know, and again , thanks for bringing it back.

Note: after a transition to off, will the lights in the scene have their brightness set to 0%, or will they still be able to be turned on with their original brightness from before the scene transition.

This was my main gripe with using scripts with transition instead of the original scenes.

Had to take out transition on scripts turning off lights because of that. Lights turning on with brightness 0%…
Hoping the new way will allow for transition to off again and still have the lights turn on after that in their previous setting

That depends. From a Home Assistant perspective, light do not have a brightness when they are turned off.

So from a scene perspective, what brightness does the light have? Well usually, that depends on the integration that implements the light and how the scene is build.

For example, if a scene set the brightness to 0, it is likely the light brightness will be 0 when turning it on again, however that behavior is not standardized in this industry, so it depends a bit on the device and integration.

As a matter of fact, there are light that don’t have an on/off state, but solely depends on brightness even (where 0 = off).

So even for Home Assistant, this is a puzzle, impossible to be solved. In general, always apply the brightness in a scene on when turning on a light. That is the only method to ensure consistent behavior across all.

Yes, the latter is what I do now, and I have even set a default config file in the /config root so Ha alway uses that if nothing is specified in the service data.

The main issue is with lights that are also turned on by means of motion sensors, like the IKEA and Hue lights. Hue can set a default value in the app, IKEA simply uses the last recorded brightness .

With the old scene transition, that worked fine. With the scripts we had to use after the demise of the old scene technique, it killed that functionality. At least , for the lights I use in the ikea configuration.

Haven’t yet tested the new scene implementation. So my fingers are still crossed :crossed_fingers::wink:

Though reading this 0.109: New integrations page and weather card, frontend lost weight - #347 by Niklas_G worries me somewhat…

update

well, I just did a very simple test with 2 Ikea lights, and 2 hue lights, in 2 test scenes, and I am not happy…

was feared the brightness of the lights is set to 0%, so when turning them on again afterwards via a motion sensor, or a google turn on light command, they turn on at 0%…!

only turning them on via a HA interface works alright, apparently using the default setting in the light_profiles.csv.

It would really be very nice if this could be fixed, since the ‘improvement’ of the change Franck explained, might be an improvement on a theoretical level.

further more:

this doesn’t seem to be true. From a HA perspective, lights have brightness 0% when they are turned off. As a matter of fact, the HA interface shows the lights to be off even while still in the transition. I have set that to be 10 seconds, especially to be able to check that.
this is what happens after a transition to off, and turning on the light again:

Schermafbeelding 2020-05-03 om 22.49.56

or the core light in an entities card with a slider:

Schermafbeelding 2020-05-03 om 22.55.02

so, it’s safe to use transitions to turn on lights, turning off lights with a transition is still rather unusable I am afraid, unless you are able to control every light and the turning on of that light.

Which excludes all lights triggered my motion sensors (which is what many people use in a Home automation system) and all lights turned on through Google assistant, and not explicitly state the brightness (which really is a pain, and not very natural)

to illustrate my point this might be more insightful:

Schermafbeelding 2020-05-03 om 23.01.16

imagine being a hurry and needing to set the brightness first before being able to let go :wink:

And, though I agree with you this is now the case, it wasn’t like that before the change. We could set the transition in the scene, and the lights would go on after that, without being set to brightness 0%.
Though I am in no way asking you to go back and bring all that apparently erroneous logic back to scenes, this brightness 0% issue should really be mitigated.

This is integration specific.

So where does that leave color, effect? Those are the same things as brightness. It is another property.
There is no difference in that.

I dont question what you’re saying at all.
All I can say is with the ‘old’ scene transition, the lights in my setup (Hue and Tradfri) could be transitioned to ‘off’ and when a motion sensor kicked them back on, brightness was as before.

With the ‘new’ transition scene, these lights are turned-on again, but have brightness 0%. Since these sensors are not controlled by HA, we have an issue …

Knowing this was not an issue before, am I incorrect in assuming it should be possible to bring that back?

tbh, I wouldn’t really know, technically. Again, all I can say is that before, the color settings where not affected either, and lights turned on by motions sensors, be it Hue or Tradfri, retained their value from before transitioning to ‘off’.
Haven’t used effect, so can’t comment on that.
Ive used brightness, color_temp, rgb_color and hs_color in my scenes, all of which were respected on turn_on

Scenes set a state. If the scene sets the state of the brightness to zero, it should be zero. The current behavior is correct.

fear there’s no hope then.
we have to go to the loo in darkness going forward… :upside_down_face:

might very well be correct from a digital computers perspective, humanly speaking there’s another world entirely

also, my previous excitement from the first post is somewhat calmed down, because with this new way of using scene transitions there is exactly zero difference compared to using the scripts we had to use when the original scene transitions were taken out.

Just to be exact:

my scenes don’t set the lights to brightness zero, it uses

- name: Test Ikea off
  entities:
    light.hobby_tafel: off
    light.tv_backlight: off
    light.toilet_hall: off

hoping that wouldn’t have set brightness to zero, and allow for turning on to their original state…

thanks, will keep an eye on the development of scenes…

1 Like