⏭ Simple Scene Toggle

I’ve reinstalled the script and unfortunetly scene transitions are still very slow ale take minutes :confused:

It seems transition time is not ms but seconds. (Scenes - Home Assistant)

Please update, check the transition time and test again. Thank you!

Hi panhans, script sill does not work like it is supposed to. I have selected 2 Hue scenes:

1st is “night light” 10% brightness
2nd Is “concentration” 100 brightness

After running the script light turns on quickly - but not the scene I selected as first. Previous color of light turns on that was active before turning off the light - color blue 50% brightness in my case), switching scene does not work at all ;-(

The order you selected the scenes has no impact to the order itself. Selecting the next scene is based on its state (timestamp). So the next scene that will be activated is the one that was activated before the others.

I’m using your script and it works great, thank you for that!
But I’m also tending to like the idea that the scenes should have a fixed order with a timeout. For example if the script hasn’t been called for 10s, start again with the first scene.
What do you think?

Hey, thanks four your thoughts. I think it’s an idea for a new blueprint. Maybe I’ll find time in the next few days.

Works a charm, thank you kindly!!

1 Like

Hello @panhans, I was really excited to give your bp a go as I’ve been trying to create a toggle for HA scripts but unfortunately it looks like your bp works on HA scenes only? Do you have any thoughts about extending your bp to cater for scripts as well? Thanks.

Came here via google for something slightly different that I ended up making. To toggle between a scene and undoing a scene.

This is exactly what I have been looking for to integrate a Shelly Button to activate various Philips Hue scenes but it appears either the blueprint no longer works or I’m not doing something right.

I have added the blueprint and created a script with multiple scenes added to it. When I tie the script to an action such as a button press, the outcome is unpredictable. A random scene will be activated, sometimes one that is in the included scenes, sometimes not. Most of the time after this first scene activates, no other scenes will be cycled through even though several are in the included list. I’m at a loss as to where to go from here, does anyone have a suggestion?

I am running the following versions of Home Assistant.

Home Assistant 2022.12.6
Supervisor 2022.11.2
Operating System 9.4
Frontend 20221213.0 - latest

same here. triggering random scenes.
Home Assistant 2023.1.4
Frontend 20230110.0 - latest

I’ve created 4 test scenes and a script with the blueprint in order to toggle through the scenes. When triggering the script the scenes get activated as expected. I cant recreate that issue. Did you also get the issue when triggering the script manually in home assistant or just when you do a button press? Can you set transition time to 0 for testing?

Hey, thanks four your thoughts. I think it’s an idea for a new blueprint. Maybe I’ll find time in the next few days.

That would be a great one! Maybe alphabetic order?
Thanks for your script, its great!

1 Like

Hi,

First off all great script :+1: I know absoloutly nothing about code of any description so rely on community members like yourself to get my system/automations running as I would like. I’m 71 but love playing with HA even though I find it very frustrating at times.:rage:

The help I need is, I have 2 scenes for my group of outside lights one for on and one for off.
I am using the button card for this and the script works fine with any combination of the scenes apart from one thing.
When I toggle the button (the icon allways indicates its off) the icon briefly changes colour and indicates on but then turns back to off although the actual lights are operating as they should.
Have I done somthing wrong or am I expectiing to much?
Any help appreciated😏

This is normal behaviour, the script changes state to indicate if it is running. That is why it turns on during execution and off when it is done.

Ah, I’m expecting too much then , I was rarther hopeing that I woulď see the actual state so I would be alerted if they were left on.
Thanks for your assistance and quick reply. :slightly_smiling_face:

Hey, maybe there is a better way. If you just want to toggle lights you can directly map your group entity on the button. If you want some dimming you have to go with scenes. But you also can map your light group on the button and override you tap action where you can call the script. Then you are able to call the script but the button represents the state of your light group.

1 Like

Thankyou very much,
There’s an awful lot to take in with HA and the older you get the harder it becomes.

Hi @panhans

Great bp, and something I instantly got value from but now that I have created a whole series controlling all lights in my house, I can only get half of them to work well. Those that doesn’t work instantly after setup either only turns on a single scene or maybe just shifts between two scenes.

I have both tried to define the Area and let HA pick the Hue scenes by it self, define both the Area and insert the included scenes, and last only defined the included scenes. Same result unfortunately.

The complete setup is with a Friend of Hue automation which linkes to the script which runs the command, but I have also tried to run the script on its own directly from HA. Same result.

Would you know how to debug this, so I can get this to work for all lights?

Thanks for a great contribution.

““solved”” : all scenes has to have a timestamp. If state is unknown, it will never be triggered.

1 Like

@panhans

Could I suggest to add an inclusion/exclusion entities - not scenes but the actual lights - in a dropdown?