I am working on automations to control my thermostat temp when the wife and I leave home and get home. I based them off ones I have to change the temp at night and in the morning. The problem is, I get “Invalid data for call_service at pos 1: must contain at least one of temperature, target_temp_high, target_temp_low.” when trying out the ones I have worked on so far. Here is one of the non-working automations as it sits right now.
alias: CT101 Heat Set Home
initial_state: True
trigger:
platform: state
entity_id: group.thermostatdevices
from: 'not_home'
to: 'home'
condition:
- condition: state
entity_id: climate.radio_thermostat_company_of_america_ct101_thermostat_mode
state: heat
action:
- service: climate.set_temperature
data_template:
data: >
{% if (strptime((states.sensor.time.state),"%H:%M") >= strptime(("22:00"),"%H:%M") and strptime((states.sensor.time.state),"%H:%M") < strptime(("07:30"),"%H:%M")) %}
entity_id: climate.radio_thermostat_company_of_america_ct101_thermostat_mode
temperature: "{{ states('input_number.heat_set_point_home_night') }}"
{% elif (strptime((states.sensor.time.state),"%H:%M") >= strptime(("07:30"),"%H:%M") and strptime((states.sensor.time.state),"%H:%M") < strptime(("22:00"),"%H:%M")) %}
entity_id: climate.radio_thermostat_company_of_america_ct101_thermostat_mode
temperature: "{{ states('input_number.heat_set_point_home_day') }}"
{% else %}
entity_id: climate.radio_thermostat_company_of_america_ct101_thermostat_mode
temperature: "{{ states('input_number.heat_set_point_home_night') }}"
{% endif %}
- service: notify.mobile_app_Shaun_iPhone
data:
title: "Home"
message: "Lowering heat due to phones getting home"