Doorbell - lights automation

Hi there, in Jeroen

I’m complete new to home assistant and I struggle with a automation script.

At the moment it’s working, but not as I want.
I made a automation that when someone presses the doorbell some of my colored lights will turn red for a few seconds, after that the lights go back to there previous color.

The first problem that I get:
The idea is that the lights only switch when they are on, so for now I only have 2 lights in the automation because when I did more lights “there not always on when I’m at home” the state of those lights are off, and that results in the problem that the whole automation does not work.

So how do I get the option to enter more lights, so that when there on or off, still the automation works for the lights that are on?

The second problem that I get:
For now the automation as a delay setting of 15 seconds, after that the lights go back to there previous color, for some some reason I can’t get a other trigger for it to work.

I have a automation for my light in the hallway, it works on a motion sensor, how do I get rid of the delay setting, so that the lights stay red for example, and when I go to the door the motion sensor triggers the part to call sene. Before?

I hope someone has the answer, for some reason I can’t copy my settings on my mobile… So I will upload a screenshot from the settings that I have now.

Yes, lights automation makes me also crazy :slight_smile: …and my family.

I never got familiar with scenes, but I create for each scenario a script. In automation my approach looks like this:

- id: '1609362401926'

  alias: Alarm Off

  description: ''

  trigger:

  - platform: state

    entity_id: alarm_control_panel.aqara_hub_a3a8

    to: disarmed

  condition: []

  action:

  - service: script.hub_light_green

    data: {}

    entity_id: light.aqara_hub_a3a8

  - delay: 00:00:05

  - service_template: script.{{is_state('binary_sensor.whendark_timer_active', 'on')

      and 'hub_light_warm_dark' or 'hub_light_off'}}

A second example with a “dummy” script, which contains only an empty array in “sequence”:

- id: motion_flur_nightlight

  alias: Motion flur nightlight

  trigger:

  - platform: state

    entity_id: binary_sensor.philmotion1

    to: 'on'

  condition:

  - condition: template

    value_template: '{% set is_dark =  is_state(''binary_sensor.whendark_timer_active'',

      ''on'') %} {% set is_nightlight_enabled =  is_state(''binary_sensor.tod_hub_nighlight'',

      ''on'') %} {% set is_alarm_disarmed =  is_state(''alarm_control_panel.aqara_hub_a3a8'',

      ''disarmed'') %} {{ is_dark and is_nightlight_enabled and is_alarm_disarmed

      }}'

  action:

  - service: script.hub_light_warm_dark

  - delay: 00:00:10

  - service_template: script.{{is_state('binary_sensor.ikea_motion', 'on') and 'dummy'

      or 'hub_light_off'}}

  mode: single

I hope this helps a bit…greetz Bob

Thank you for your reply, templates I’m not formiliar with.

Is it maby possible to add more condition state, en separate them like that in automation?

If you want to trigger any kind of light situation and you want to return to the previous state after that, you should take a look at this: https://www.home-assistant.io/integrations/scene/#creating-scenes-on-the-fly

  • create new scene and save current state of all desired entities
  • do you notification thing
  • restore freshly created scene from the first step