I’ve created an automation to turn a few things off at a certain time, while it runs it stops after the first and doesn’t contine. Any ideas what changes i require?
I had a go with a couple of options, the first i get issues with the first.
Configuration invalidError loading /config/configuration.yaml: while parsing a block mapping in “/config/automations.yaml”, line 114, column 5 expected , but found ‘-’ in “/config/automations.yaml”, line 118, column 5
# Working Week Everything off at 01:00
- id: weekday_off_1AM
alias: 'Weekday everything off 1AM'
trigger:
platform: time
at: '01:00:00'
condition:
condition: time
weekday:
- fri
- sat
- platform: state
entity_id:
- switch.front_room_tv
- switch.front_room_heater
- switch.front_room_light
- switch.kitchen_lightsdown
- switch.kitchen_lightsup
- switch.garden_lights
to: 'home'
condition:
- condition: state
entity_id: group.all_devices
state: 'home'
action:
service: homeassistant.turn_off
entity_id:
- switch.front_room_tv
- switch.front_room_heater
- switch.front_room_light
- switch.kitchen_lightsdown
- switch.kitchen_lightsup
- switch.garden_lights
The 2nd does seem to be accepted, but if you check the automation in HA then it doens’t show the indavidual switches so i don’t have much faith in it working correctly.
# Working Week Everything off at 01:00
- id: weekday_off_11pm
alias: 'Weekday everything off 1AM'
trigger:
platform: time
at: '01:00:00'
condition:
condition: time
weekday:
- sun
- fri
- sat
action:
service: homeassistant.turn_off
entity_id: switch.front_room_tv
action:
service: homeassistant.turn_off
entity_id: switch.front_room_heater
action:
service: homeassistant.turn_off
entity_id: switch.front_room_light
action:
service: homeassistant.turn_off
entity_id: switch.kitchen_lightsdown
action:
service: homeassistant.turn_off
entity_id: switch.kitchen_lightsup
action:
service: homeassistant.turn_off
entity_id: switch.garden_lights
It did accept zarthan’s entries but i didn’t test the automation yet. I’ll have a look at yours, i ended up using some groups rather than individual switches, so i’m hoping that will also work to make the code a bit easier to read. I’ll play around with it later on.
While this looks correct, it is only slightly wrong (the worst kind) and i had a space before the dash, for i guess all but one of the entries. When i removed this dash, the automation run in full, and all devices switched off. Like below;