Automation to turn on to lights


#1

Hi All

I am just stating to figure how to carry out automations however I want to turn on two lights on one automation

I am using the below but it give me an error

Can you assist please

alias: Lights on
trigger:
platform: time
at: ‘00:00:00’
action:

service: homeassistant.turn_on
entity_id: switch.04200488b4e62d15d544
entity_id: switch.04200488dc4f22310bec


#2

Please edit your post and format your code as per the blue banner at the top of the page.

However, you will need to use the list token ‘-’ for your entity ids to tell HA that there is a list of entities to turn on.

service: homeassistant.turn_on
  - entity_id: switch.04200488b4e62d15d544
  - entity_id: switch.04200488dc4f22310bec

Also, in future providing the actual error message in your post can assist in debugging.


#3

Alternatively add the two lights to a group and turn the group on and off.


#4

Hi Tom

I tried this approach and that did not switch on both entities

unfortunately I cannot give you the error message at the moment as HA has decided to tell me that I have a database image error now

I did have a stable system before I started to start on automation, so looking for a soloution to my other problem also

Thanks for the reply though
Paul


#5

I don’t think that’s right. As far as I know you can’t have two “entity_id:” lines.

It should be like this:

alias: Lights on
trigger:
  platform: time
  at: '00:00:00'
action:
  service: homeassistant.turn_on
  entity_id: 
    - switch.04200488b4e62d15d544
    - switch.04200488dc4f22310bec