I’m trying to specify different brightness based on time of day, but can’t even save the automation due to this error. Any help would be greatly appreciated.
alias: Motion Lights Study
description: ''
trigger:
- type: motion
platform: device
device_id: e21def2de54d327fb03eeebd05cc8991
entity_id: binary_sensor.study_pir
domain: binary_sensor
condition: []
action:
- type: turn_on
device_id: 8170e2530a33500b4f697173b77f848f
entity_id: light.s
domain: light
data_template:
brightness_pct: >
{% if now().hour > 20 %}50
{% elif now().hour < 5 %}30
{% elif now().hour < 8 %}50
{% else %}100
{% endif %}