Just to be sure, and before re-starting to use scenes again, please let me ask if we can safely use groups as entities in scene definitions. we could before, but since I cant find any reference to a group on https://www.home-assistant.io/integrations/scene/ I thought it safer to ask any of you who already have used the new scene implementation
thanks for having a look and confirming/negating my question…
If possible I think it would be better to setup a group in the native application (ie. outside HA; Hue and MiLight support this) and have a single light entity to use in scenes as it would turn on/off instantly (even if all the lights in a HA group change their state within a few mili-seconds, it still might be observable/annoying).
yes, I am aware the light groups would fit the bill here and work fine. I was actually wondering about hand made groups, with several lights. Did work in scenes before, and though I am now not using scenes anymore because of the demise of transition (and transitions in scripts to 0% cause the lights to turn on again afterwards with brightness 0%, so cant use that either anymore…) I was re-investigating scenes for some dedicated purposes.
In my case I always use transitions to and from minimum brightness - level 1 or 1%, depending on scale.
I think it is easier on the eyes to ramp up brightness from 1% to 60% rather than to turn on at 100% and then decrease to 60% (even if the desired brightness level at turning on is the same as the one prior to turning off, I still prefer to start with brightness at 1%); also, with brightness at 1% there will be very little flickering case desired color after the turn on is completely different than the one before turning off (vs. the turning on from a higher brightness level).
well, I might not have explained myself clearly enough. I am still looking for a true and full replacement of what we could do with scenes before the change.
We could simply do
- name: Uit huis off
entities:
group.all_inside_light_groups: off
transition: 6
and have all light slowly turn_off.
Turning on any of the lights after that, would turn on that light with the last brightness setting it was set to before the scene was called.
transition has been taken out of the scene configuration, and we are supposed to replace that with scripts. And yes we can use transition with scripts. However, doing so, causes the brightness of these lights to be set to 0%.
Turning on a light after the script has run, makes it turn_on at 0%… which of course is useless.
Because of that we are forced to use a light_profiles.csv, which holds default settings for each light, but, this only works for lights that are turned_on from within HA. Unfortunately this does not work for lights that are turned_on by a motion sensor. Yes, Hue motion sensors and lights can be set in the Hue app, so their brightness can be controlled somewhat, and have a default setting (which is not always the setting you want them to be on in a specific scene) or the last setting (which I have described above already, as being 0%). And, Tradfri lights don’t have that at all, so are simply set to the last recorded brightness…
Long story short, we have lost a major functionality in HA because the scenes were changed.
Turning on with a transition works fine, and doesn’t suffer from this behavior of course. It’s the transition to turning off that causes unwanted operation. Ive winged Balloon on this, he has noted it could be looked into, but we haven’t heard of it ever since.
I’m sorry, but I don’t understand what the expected behavior at turn on should be. You want the lights to turn on with the previous known value? Or with a predefined value (ie. regardless what was the brightness prior to turning off)?
As mentioned, whenever I turn the lights on, I start from 1% brightness and my lights (MiLight; I have also several RGB Hue but I prefer the MiLight ones) only support turning on with the last known value (prior to turning off, I set them at 1% brightness, so the last known value is 1%). There have been some power outages in the middle of the night lately and this has been quite fine as the lights turned on dimmed, not at full brightness.
I use different ways to turn on lights: motion sensors (mainly 433 Mhz, but there wouldn’t be any difference with other RF environment as long as they’re integrated in HA), smart switches (Zigbee) and HA frontend buttons and they function pretty much the same (although recently implemented for MiLight MQTT emulator, transition is a feature of the hub, not of the bulbs → hub determines when a new command for turning up/down the brightness is to be sent):
if there is no sufficient light in the room (determined by light sensor or through sun position) and motion sensor is triggered, then lights turn on at 1%, then they are going to the level I specify through an input number (so I can use different target brightness levels depending on the time of the day); a script then sets a timer for turning off (again, configurable - i.e from 1-5 minutes after dark to a maximum of 1-2 hour during the sunset);
if the lights are on (turned on by the motion sensor) and there is motion detected, then the timer set above is reset;
if the lights are off and the smart switch (or HA button) is pressed, then the lights turn on at 1% brightness and then go the required brightness level; a script sets another timer (different than the one for the motion sensor so that when I press the switch, the lights will stay on much longer than if triggered by the motion sensors) after which the lights turn to brightness 1% and then to off;
if the lights are on and the smart switch is pressed, then all the scripts are cancelled, the lights are going to 1% brightness and then to off;
if the lights are on (turned on by switch) and the motion sensor triggers, then the remaining timer for the switch is compared to the nominal value of the timer for the motion sensor; if lower, the motion sensor then sets a new timer and from this point the motion sensor controls the light; if higher, the motion sensor is ignored;
all scripts that are run prior to turning the lights to off first set the brightness to 1% and then to off;
if I only want to use the switches for controlling the lights (instead of the motion sensors) I have an override switch for the motion sensor.
I use light sensors integrated in HA (vs. using motion sensors that can be set to trigger only with low light level) as, case the motion sensor is triggered during the day, it won’t turn on the lights (but motion sensor is still be used by the alarm system).
I included also details on the hardware to point that it doesn’t really matter the brand of devices used.
Sorry if the explanation turned out a little bit complicated but this works well for me and the flickering is kept at minimal, or even none. You can have a look at the scripts I use (automations are basically duplicated for RGB and CCT modes):