Error in Condition

Hi all,

When I try to add this to my automation, I get an error. But when I test it in the template tester, I get True/False correctly. Am I doing something wrong? Thanks!

# Sun Rise and Sun Set Switch Lights 
- alias: 'Turn Off Lights When Sun Rises'
  trigger:
    platform: sun
    event: sunrise
    offset: '+00:00:00'
  condition:
    condition: template
    value_template: {{ states('input_slider.cloudcover_lights') > states('sensor.yr_cloudiness') }}
  action:
    - service: switch.turn_off
      entity_id: switch.outside_lights_switch

try adding ‘single quotes’ around your value_template

1 Like

Hi!

Nope, crashes HA:

2017-07-26 20:53:50 ERROR (Thread-1) [homeassistant.util.yaml] while parsing a block mapping
in “/home/homeassistant/.homeassistant/automations.yaml”, line 8, column 5
expected , but found ‘’
in “/home/homeassistant/.homeassistant/automations.yaml”, line 9, column 33
2017-07-26 20:53:50 ERROR (MainThread) [homeassistant.bootstrap] Error loading /home/homeassistant/.homeassistant/configuration.yaml: while parsing a block mapping
in “/home/homeassistant/.homeassistant/automations.yaml”, line 8, column 5
expected , but found ‘’
in “/home/homeassistant/.homeassistant/automations.yaml”, line 9, column 33

Try “double quotes”

1 Like

That seems to get accepted. Not let’s test the function :).

Thanks!