eemceebee
(Sebastian)
September 10, 2019, 7:24am
1
Hi,
I start to feel stupid. I am not able to get a simple script to work that could turn on or off a light. I am able to toggle it but turning it specifically on or off does not work.
- service: light.turn_on
data:
entity_id: light.tv
The same script with light.toggle works.
Any idea what I am doing wrong ?
Thanks,
mcb
tom_l
September 10, 2019, 8:08am
2
Is that your full script?
It should have a few more things like this:
script:
tv_light_on:
sequence:
service: light.turn_on
entity_id: light.tv
petro
(Petro)
September 10, 2019, 12:47pm
3
@tom_l ’s solution is correct. I just wanted to point out that the reason your yaml was not working is because your spacing is off.
- service: light.turn_on
data:
entity_id: light.tv
^
|
Remove indent
- service: light.turn_on
data:
entity_id: light.tv
eemceebee
(Sebastian)
September 10, 2019, 8:27pm
4
So here is the full file /config/scripts.yaml
:
'1568061272142':
alias: 'Testscript #2 - v1.16'
sequence:
- alias: ''
data:
entity_id: light.lightstrip
service: light.toggle
So the light.toggle
works, but neither light.turn_on
nor light.turn_off
does switch the light
123
(Taras)
September 10, 2019, 10:20pm
5
What kind of light is is? Which integration is being used to control it?
eemceebee
(Sebastian)
September 11, 2019, 12:50pm
6
I tried this with 3 lights:
Philips HUE lightstrip
OSRAM LightStrip
Dresden Electronics Lightstrip
The Hue and Osram are connected through the HUE bridge and the other through a Dresden Electronics ConBee II
123
(Taras)
September 11, 2019, 12:56pm
7
Are you able to turn the lights on and off using the Services page?
1 Like
eemceebee
(Sebastian)
September 11, 2019, 8:29pm
8
@123 I have no idea why and how, but since I tried this on the dev tools and copied the json part into my script it works.
123
(Taras)
September 11, 2019, 8:31pm
9
Glad to hear it, even though the solution is seemingly inexplicable.