Automaton issue with switches

Hi,

Get error in my config when trying to trigger switches at different times, any ideas?

ERROR:

while parsing a block mapping
in “”, line 106, column 5:
- alias: Turn on heat when cold mo …
^
expected , but found ‘’
in “”, line 112, column 6:
condition:
^

automation:

  • alias: Turn on lights at sunset
    trigger:
    platform: sun
    event: sunset
    offset: “-01:00:00”
    condition:
    condition: state
    entity_id: group.all_devices
    state: ‘home’
    action:
    service: homeassistant.turn_on
    entity_id: group.all_switches

  • alias: Turn off lights at sunrise
    trigger:
    platform: sun
    event: sunrise
    action:
    service: homeassistant.turn_off
    entity_id: group.windows

  • alias: Turn on heat when cold morning
    trigger:
    platform: numeric_state
    entity_id: sensor.utetemp_temperature
    value_template: ‘{{ states.sensor.utetemp_temperature.state }}’
    below: 4
    condition:
    condition: time
    after: ‘04:15:00’
    action:
    service: homeassistant.turn_on
    entity_id: switch.ute_1

  • alias: Turn of heat morning
    trigger:
    platform: time
    after: ‘09:00:00’
    action:
    service: homeassistant.turn_off
    entity_id: switch.ute_1

  • alias: Turn on heat when cold afternoon
    trigger:
    platform: numeric_state
    entity_id: sensor.utetemp_temperature
    value_template: ‘{{ states.sensor.utetemp_temperature.state }}’
    below: 4
    condition:
    condition: time
    after: ‘14:00:00’
    action:
    service: homeassistant.turn_on
    entity_id: switch.ute_1

  • alias: Turn of heat afternoon
    trigger:
    platform: time
    after: ‘17:00:00’
    action:
    service: homeassistant.turn_off
    entity_id: switch.ute_1

Can you repost the code in between three ` symbols (backtick) on either side so we can see the spacing?

automation:
  - alias: Turn on lights at sunset
    trigger:
      platform: sun
      event: sunset
      offset: "-01:00:00"
    condition:
      condition: state
      entity_id: group.all_devices
      state: 'home'
    action:
      service: homeassistant.turn_on
      entity_id: group.all_switches

  - alias: Turn off lights at sunrise
    trigger:
      platform: sun
      event: sunrise
    action:
      service: homeassistant.turn_off
      entity_id: group.windows
      
  - alias: Turn on heat when cold morning
    trigger:
      platform: numeric_state
      entity_id: sensor.utetemp_temperature
      value_template: '{{ states.sensor.utetemp_temperature.state }}'
      below: 4
     condition:
        condition: time
        after: '04:15:00' 
    action:
      service: homeassistant.turn_on
      entity_id: switch.ute_1
      
  - alias: Turn of heat morning
    trigger:
      platform: time
      after: '09:00:00'
    action:
      service: homeassistant.turn_off
      entity_id: switch.ute_1
      
  - alias: Turn on heat when cold afternoon
    trigger:
      platform: numeric_state
      entity_id: sensor.utetemp_temperature
      value_template: '{{ states.sensor.utetemp_temperature.state }}'
      below: 4
     condition:
        condition: time
        after: '14:00:00' 
    action:
      service: homeassistant.turn_on
      entity_id: switch.ute_1
      
  - alias: Turn of heat afternoon
    trigger:
      platform: time
      after: '17:00:00'
    action:
      service: homeassistant.turn_off
      entity_id: switch.ute_1
```

The spacing of your action blocks under:

  • alias: Turn on heat when cold morning
    and
  • alias: Turn on heat when cold afternoon

aren’t inline with the rest of the block?

Thank you!

Missed that when checking, get blind after a while :slight_smile: