Hoping someone could give me a quick hand. I am setting up an automation to set my climate to a temperate pulled from a sensor at a specific time, also pulled from a sensor. Both the time and the temperature come from an input number. I have verified that the sensors return back correct values, so I am assuming it is my automation that has the issue, most likely with the action. Thanks for any help!
input_number:
ac_morning_hour: name: Hour icon: mdi:timer initial: 9 min: 5 max: 12 step: 1 mode: slider ac_morning_minutes: name: Minutes icon: mdi:timer initial: 30 min: 0 max: 55 step: 5 mode: slider ac_morning_temperature: name: Morning temperature icon: mdi:temperature-fahrenheit initial: 76 min: 68 max: 80 step: 1 mode: slider
sensors:
- platform: template
sensors:
ac_morning_time:
friendly_name: ‘A/C morning time’
value_template: ‘{% if states.input_number.ac_morning_hour.state| length < 4 %}0{{ states.input_number.ac_morning_hour.state | int }}{% endif %}{% if states.input_number.ac_morning_hour.state| length > 3 %}{{ states.input_number.ac_morning_hour.state | int }}{% endif %}:{% if states.input_number.ac_morning_minutes.state | length < 4 %}0{{ states.input_number.ac_morning_minutes.state | int }}{% endif %}{% if states.input_number.ac_morning_minutes.state | length > 3 %}{{ states.input_number.ac_morning_minutes.state | int }}{% endif %}’
Automation:
- id: Set_thermostat_morning
alias: ‘Set thermostat morning’
trigger:
platform: template
value_template: ‘{{ now().strftime(“%H:%M”) == states.sensor.ac_morning_time.state }}’
action:
- service: climate.set_temperature
data_template:
entity_id: climate.thermostat
temperature: ‘{{ states.sensor.ac_morning_temperature.state }}’