I’m aware now that you cannot activate a script from inside a scene. Which is a bummer because some of my lights are controlled via the Harmony Hub send_command.
I tried switching my entire lighting scenes over to scripts. It works, but there’s a large delay compared to using scenes. Plus, it’s a pain to set switches and lights using scripts.
So I tried this:
scene_starlight:
alias: Starlight
sequence:
- service: remote.send_command
data:
entity_id: remote.harmonyhub
device: 41760987
command: Light1
- service: scene.turn_on
data:
entity_id: scene.starlight
However, this does not seem to work. Am I just screwing up the syntax, or can scenes not be turned on from within a script?
Bieniu
(Maciek)
April 3, 2017, 8:59am
2
Try:
- service: scene.turn_on
entity_id: scene.starlight
jono
(Jono)
April 3, 2017, 3:09pm
3
I run scripts as part of scenes, like this:
- scene:
- name: Bedtime
entities:
light.landing_light:
state: on
transition: 2
brightness: 1
light.office_light:
state: off
transition: 2
light.kitchen:
state: off
transition: 2
light.tv_light:
state: off
transition: 2
script.living_room_off_delayed:
state: on
With the script code elsewhere (in a different .yaml file). Is this the kind of thing you wanted to do?
1 Like
I had that originally. But I can give it another shot. It seemed like other commands wanted it to fall under Data:
Wait, so you CAN do that? If so, that’s great news. I’ll have to give that a try tonight!
jono
(Jono)
April 3, 2017, 6:04pm
6
Yes, I have a few scenes that run scripts in them
do it still working?
It stopped working here.
You can no longer call scripts from scenes.
1 Like
jono
(Jono)
December 16, 2019, 7:49am
9
Are there any workarounds, or do we have to just change our setups and remove all scripts from scenes?
francisp
(Francis)
December 16, 2019, 8:09am
10
You have to remove all scripts from scenes.
1 Like
jono
(Jono)
December 16, 2019, 8:15am
11
OK, thanks for the confirmation
Sara980710
(Sara Larsson)
March 18, 2020, 4:12pm
12
I created a input_boolean which triggers the script in an automation. That worked for me!
In the scene:
scene:
- name: my scene
entities:
input_boolean.random_color: on
jono
(Jono)
March 19, 2020, 7:00am
13
Yea, I have a few of those.
I ended up recreating my scenes with scripts.