Nick4
(Nick)
May 9, 2022, 9:40pm
1
When leaving the house I would like the light in the hallway to flash briefly and then go to on.
After flashing nothing happens.
When I run the action just for flashing, I get an error:
This is the full automation:
alias: 'Hall: test flash'
description: ''
trigger: []
condition: []
action:
- service: light.turn_on
data:
brightness_pct: 100
flash: short
target:
entity_id: light.hall
- delay:
hours: 0
minutes: 0
seconds: 5
milliseconds: 0
- service: light.turn_off
data: {}
target:
entity_id: light.hall
- delay:
hours: 0
minutes: 0
seconds: 2
milliseconds: 0
- service: light.turn_on
data:
brightness_pct: 50
target:
entity_id: light.hall
mode: single
Nick4:
data: {}
Try removing { } front he data line.
Nick4
(Nick)
May 9, 2022, 9:56pm
3
Hi @Coolie1101 , the system adds it again and it doesn’t make a difference.
The automation does not continue after the flashing action…
What happens if you remove the entire data: {} line?
Nick4
(Nick)
May 9, 2022, 10:24pm
5
Hi @rcblackwell , same result: automation stops after first action.
I also tried this:
- id: '1652131323463'
alias: 'Hall: test flash'
description: ''
trigger: []
condition: []
action:
- service: light.turn_on
data:
brightness_pct: 100
flash: short
target:
entity_id: light.hall
- service: light.turn_on
data:
brightness_pct: 50
target:
entity_id: light.hall
mode: single
What happens if you insert a short delay, a second or two, between the two operations?
Nick4
(Nick)
May 9, 2022, 11:29pm
7
That’s what I had before but somehow the automation always stops after flashing.
WallyR
(Wally)
May 9, 2022, 11:43pm
8
Why do you have the flash line in the data of the first service call?
It looks like the automation is doing a flash effect anyway.
Does the light actually flash?
Why not just use the turn_on turn_off service consecutively?
What is the idea of flashing then turn on?
Also, you don’t need data for the light.turn_off service since there is no additional parameters.
The following works for me.
action:
- service: light.turn_on
data:
brightness_pct: 100
flash: short
target:
entity_id: light.hall
- delay:
seconds: 5
- service: light.turn_off
target:
entity_id: light.hall
data: {}
- delay:
seconds: 2
- service: light.turn_on
data:
brightness_pct: 50
target:
entity_id: light.hall
Nick4
(Nick)
May 10, 2022, 3:52pm
10
It was put there by the UI
Yes and then the automation stops.
That could be a way to get similar effect but I noticed the flash option for lights so why make it ‘difficult’.
A notification/confirmation and then have light in hall without natural light.
I tried your code but still the same…
It must have something to do with that error in my first post.
Executed: May 10, 2022, 5:43:51 PM
Result:
params:
domain: light
service: turn_on
service_data:
brightness_pct: 100
flash: long
entity_id:
- light.hall
target:
entity_id:
- light.hall
running_script: false
limit: 10
Fair enough, flash never really did anything for me, even if I used it alone, the lights just turn on, maybe someone who knows more about this function can chime in.
The following is what I actually used for flashing some LED’s for new years on the midnight hour, with a repeat until condition, which worked out great, and similarly with multiple delays for the countdown,
action:
- service: light.turn_on
data: {}
target:
entity_id: light.living_room_led
- delay:
milliseconds: 500
- service: light.turn_off
data: {}
target:
entity_id: light.living_room_led
That’s where it belongs, as it’s a “Service data attribute ”
WallyR
(Wally)
May 10, 2022, 6:41pm
12
I know that, but your script is a flashing without the flash line, and that is probably the right way to go.
Not all products support flash.
Philips Hue did earlier, but changed it a few months back (Hue flash broken )
1 Like
Would still like some insight on how the flash service actually works though, I tried it with some LED’s connected via MagicHome and Hyperion, I currently don’t have any other light’s that would support that service.