I don’t know if we’re on the same wavelength or if it’s my poor explanation. You do state in that last comment however, that “there does not appear to be a way to get at the brightness of an entity that is set using a Home Assistant scene”. This therefore may be the unfortunate answer.
However, I’ll try and explain in another way. I have a scene called scene.dining_room_lights_dim that I use after sunset. Before sunset I would have a scene called scene.dining_room_lights_medium. My last automation would not activate this dim scene until after sunset and if we were still in the room, as occupancy was detected, it would wait until next time we were detected after sunset. This however ment that the lights could stay on medium brightness for hours after sunset and it didn’t quite work. We would reach for the switch and negate the first rule of a perfect automatic house: no manually intervention! If the lights gradually dimmed it would be perfect, but in other scenarios such as we left the room and then returned, I want it to set Dim straight away and not bother with fading, so I don’t want Circadian lighting. So this time around rewriting the automation, I wanted to try the transition option, set at 300secs, but it doesn’t work on most lights (a bit of a flaw somewhere with either the lights or HA??), and so the lights take about 1-2secs to reach dim, rather than 300secs. Now there are loads of ways to overcomplicate the process of moving from medium to dim over a set period of time, and I can create helpers for all the light entities and different scenes. I can even just set the target value to achieve ( value_template: “{{ (state_attr(‘light.bulbasaur’,‘brightness’)|int > 26 ) }}” ). But the scenes.yaml file have the values right there, visible in the yaml!!!
For example, below you can see that the fat shelly vintage called bulbasaur is already defined as brightness 26 in the scenes.yalm, without needing a helper, it’s just there for all to see, and I just want to use this stored information and see if bulbasaur is above, in this case, the value “26”:
- id: '2731358132781'
name: Dining Room Lights Dim
entities:
light.bulbasaur:
supported_color_modes:
- brightness
color_mode: brightness
brightness: 26 # IT'S RIGHT HERE!!!!!!!!
friendly_name: Bulbasaur
supported_features: 32
state: 'on'
light.shellybulbduo_e8db84a9f16c: #I know, It's on the to-do list to rename!!
min_color_temp_kelvin: 2700
max_color_temp_kelvin: 6500
min_mireds: 153
max_mireds: 370
supported_color_modes:
- color_temp
color_mode: color_temp
brightness: 64 # AGAIN RIGHT HERE!!!!!!
If at some point I change the scene, that value will change in the scenes.yaml file and the automation will reference this new value, without me needing to change anything else (helpers). This is why referencing this value is perfect!
All I want to do is compare this value stored in the scenes.yaml with the current light brightness, to save having to set up Circadian lighting or helpers or raw integers. This gradual decrease (or increase) will be used in many different scenarios for all the lighting throughout the house, and therefore the amount of helpers needed will be very, very large, so seems so illogical when the value I want is sat right here in scenes.yaml.
Can we not extract the value. I.e. ‘scene.dining_room_lights_dim.light.bulbasaur.attributes.brightness’ to compare to state_attr(‘light.bulbasaur’,‘brightness’), and if so, what is the correct code to replace ‘scene.dining_room_lights_dim.light.bulbasaur.attributes.brightness’ to get this value??
If you’re right that “there does not appear to be a way to get at the brightness of an entity that is set using a Home Assistant scene”, and HA doesn’t have a fully working transition option within the automation action ‘activate scene with 300sec transition’ for most smart lights, I’m down to a ridiculous amount of helpers to solve this. It just seems so much easier to access this value set within the scenes.yaml, I just can’t get my code to compare the value I can see within this bl**dy file!