I’m trying to build a component from the UI that will allow me to input a sunrise offset value in an automation.
My input_text is defined as:
morning_light_offset:
name: Sunrise Offset
icon: mdi:timer
initial: '00:15:00'
pattern: '^[+-]\d{2}:\d{2}:\d{2}$
And my automation is configure as such:
- alias: 'Turn off Living Room lights after sunrise'
initial_state: true
trigger:
- platform: sun
event: sunrise
offset: template
value_template: "{{ states.input_text.morning_light_offset.state }}"
action:
- service: light.turn_off
entity_id: light.lr1_3, light.lr2_34
I’ve also tried using just offset: "{{ states.input_text.morning_light_offset.state }}"
as well as a number of other attempts. But regardless of what I try I get the same error when I validate the configuration:
Invalid config for [automation]: extra keys not allowed @ data['trigger'][0]['value_template']. Got None
offset template should be format 'HH:MM' or 'HH:MM:SS' for dictionary value @ data['trigger'][0]['offset']. Got None. (See /home/homeassistant/.homeassistant/configuration.yaml, line 70). Please check the docs at https://home-assistant.io/components/automation/