I am trying to attempt the following:
When the (Skybell 2.0) doorbell is pressed, I want to flash a light for a short amount of time.
This is the config I have set up:
- alias: 'doorbell flashing lights'
trigger:
- platform: state
entity_id: binary_sensor.skybell_front_door_button
to: 'on'
action:
- data:
entity_id: light.fibaro_system_fgd212_dimmer_2_level_6
flash: short
service: light.turn_on
It doesn’t work. What do I need to change to get it working? I’ve tried it with both a Fibaro dimmer and a hue light bulb.
I would be curious if you got this working as you wanted it to. I tried to do some automations based on Skybell button and the motion, but the events received by Home Assistant were very delayed.
When I test the automation @ Services, the automation works. Tomorrow during daytime I will press the button of the Skybell and see if the automation is quick enough.
This is the code I am using.
- alias: 'doorbell flashing lights'
trigger:
- platform: state
entity_id: binary_sensor.skybell_front_door_button
to: 'on'
action:
- service: light.turn_on
data:
entity_id: light.rechts
rgb_color: [224,1,102]
flash: short
- service: light.turn_on
data:
entity_id: light.links
rgb_color: [224,1,102]
flash: short
What I want to find out is how I can turn the lights back to the initial state as before the automation started. I’m testing it with Hue lightbulbs.
When you run an automation from the Services page, it skips the automation’s trigger and condition sections and simply executes the action.
BTW, the code you posted still contains indenting errors. If I attempt to use it exactly as it’s shown it fails to pass Config Check.
Everything below the first line is incorrectly indented (the image below is from Visual Studio Code editor). Those lines need to be indented by an additional 2 spaces (i.e. alias, trigger, and action should be aligned vertically).
As for the code. I took it over like you mentioned it. When I press the validate-button, it’s all good. Is there a difference in the yaml config and the build in config over the web page? Lately I’ve been using the web configurator. Before I used Brackets to change the yaml files.
Below the code as it is, copied out of the yaml file:
- alias: 'doorbell flashing lights'
trigger:
- platform: state
entity_id: binary_sensor.skybell_front_door_button
to: 'on'
action:
- service: light.turn_on
data:
entity_id: light.rechts
rgb_color: [224,1,102]
flash: short
- service: light.turn_on
data:
entity_id: light.links
rgb_color: [224,1,102]
flash: short
Yes that part I know! But for example with the hue lights, when flashing a certain colour (doorbell rings) the bulbs stay that colour afterwards. Instead I want them back to soft white just like normal. That part I don’t know how to “code”.
If someone has a source on this or knows how to make this happen, please let me know.
I don’t know the rgb_color for ‘soft white’. However, if we refer to the CSS Color chart, the colorname called ‘floralwhite’ is 255,250,240. You can experiment with these rgb values to get something that approximates ‘soft white’.
The action, of whatever automation your are using to turn off the light, would set the color back to white before turning off the light.
@stephano90 is this still working for you? Below is my config, but it doesn’t seem to work when the button is pressed. I can manually execute the automation and lights turn on, but its like the “to:” is wrong or something, idk.
alias: Doorbell lights on
description: ''
trigger:
- platform: state
entity_id: binary_sensor.skybell_front_door_button
to: 'on'
condition: []
action:
- service: switch.turn_on
data: {}
entity_id: switch.led_lights
mode: single