I am trying to create an IF statement to change brightness of my lights between 23:00-08:00. I have come up with below, but do not get my if statement to successfully work.
What am I doing wrong?
# If there is motion and its dark turn on the hall lights
#
- action:
- alias: Lights on
data_template:
entity_id: group.hall
brightness: >-
{% if (states.sensor.time.state > "23:00") and (states.sensor.time.state < "8:00") %}
255
{% else %}
20
{% endif %}
service: light.turn_on
alias: 'Hall: If there is motion and its dark turn on the lights'
id: '1510180396101'
condition:
- condition: state
entity_id: group.hall
state: 'off'
trigger:
platform: state
entity_id: binary_sensor.motion_sensor_158d0001d87910
to: 'on'