I’m working on some local side project that updates thermostat based on sensor values using automation. However when automation is triggered target thermostat temperature is updating but target temperature high and low not. I want this feature because it’s part of my university project where I would like to set up temperature ranges for thermostat. I don’t have any physicall thermostat yet, I just testing it on my local machine.
configuration.yaml:
sensor command_sensor:
- platform: command_line
command: "cat ~/.homeassistant/temp_sensor1.txt"
unit_of_measurement: "°C"
sensor command_sensor_2:
- platform: command_line
command: "cat ~/.homeassistant/temp_sensor2.txt"
unit_of_measurement: "°C"
automation:
trigger:
platform: state
entity_id: sensor.command_sensor
action:
service: climate.set_temperature
data_template:
temperature: '{{ states.sensor.command_sensor_2.state }}'
target_temp_high: '{{ states.sensor.command_sensor_2.state }}'
target_temp_low: '{{ states.sensor.command_sensor_2.state }}'
climate:
- platform: generic_thermostat
name: Study
heater: switch.study_heater
operation_mode: auto
target_sensor: sensor.command_sensor
target_temperature: 15
log:
17-02-08 07:20:01 INFO (Thread-5) [homeassistant.components.sensor.command_line] Running command: cat ~/.homeassistant/temp_sensor1.txt 17-02-08 07:20:01 INFO (MainThread) [homeassistant.core] Bus:Handling <Event state_changed[L]: old_state=<state sensor.command_sensor=32.4; friendly_name=Command Sensor, unit_of_measurement=°C @ 2017-02-08T07:19:00.828909+01:00>, entity_id=sensor.command_sensor, new_state=<state sensor.command_sensor=33.4; friendly_name=Command Sensor, unit_of_measurement=°C @ 2017-02-08T07:20:01.510726+01:00>> 17-02-08 07:20:01 INFO (Thread-10) [homeassistant.components.sensor.command_line] Running command: cat ~/.homeassistant/temp_sensor2.txt 17-02-08 07:20:01 INFO (MainThread) [homeassistant.components.automation] Executing automation 0 17-02-08 07:20:01 INFO (MainThread) [homeassistant.core] Bus:Handling <Event logbook_entry[L]: name=automation 0, entity_id=automation.automation_0, message=has been triggered, domain=automation> 17-02-08 07:20:01 INFO (MainThread) [homeassistant.helpers.script] Script automation 0: Running script 17-02-08 07:20:01 INFO (MainThread) [homeassistant.helpers.script] Script automation 0: Executing step call service 17-02-08 07:20:01 INFO (MainThread) [homeassistant.core] Bus:Handling <Event call_service[L]: service=set_temperature, service_data=temperature=21.5, target_temp_low=21.5, target_temp_high=21.5, service_call_id=140355251837864-1, domain=climate> 17-02-08 07:20:01 INFO (MainThread) [homeassistant.core] Bus:Handling <Event state_changed[L]: old_state=<state climate.study=idle; friendly_name=Study, current_temperature=32.4, operation_mode=idle, temperature=None, min_temp=7, max_temp=35, unit_of_measurement=°C @ 2017-02-08T07:19:00.890309+01:00>, entity_id=climate.study, new_state=<state climate.study=idle; friendly_name=Study, current_temperature=33.4, operation_mode=idle, temperature=None, min_temp=7, max_temp=35, unit_of_measurement=°C @ 2017-02-08T07:19:00.890309+01:00>> 17-02-08 07:20:01 INFO (Thread-6) [homeassistant.components.climate.generic_thermostat] Obtained current and target temperature. Generic thermostat active. 17-02-08 07:20:01 INFO (MainThread) [homeassistant.core] Bus:Handling <Event state_changed[L]: old_state=<state sensor.command_sensor_2=21.5; friendly_name=Command Sensor, unit_of_measurement=°C @ 2017-02-08T07:19:00.830653+01:00>, entity_id=sensor.command_sensor_2, new_state=<state sensor.command_sensor_2=22.5; friendly_name=Command Sensor, unit_of_measurement=°C @ 2017-02-08T07:20:01.532766+01:00>> 17-02-08 07:20:01 INFO (MainThread) [homeassistant.core] Bus:Handling <Event state_changed[L]: old_state=<state climate.study=idle; friendly_name=Study, current_temperature=33.4, operation_mode=idle, temperature=None, min_temp=7, max_temp=35, unit_of_measurement=°C @ 2017-02-08T07:19:00.890309+01:00>, entity_id=climate.study, new_state=<state climate.study=idle; friendly_name=Study, current_temperature=33.4, operation_mode=idle, temperature=21.5, min_temp=7, max_temp=35, unit_of_measurement=°C @ 2017-02-08T07:19:00.890309+01:00>> 17-02-08 07:20:01 INFO (MainThread) [homeassistant.core] Bus:Handling <Event service_executed[L]: service_call_id=140355251837864-1> 17-02-08 07:20:01 INFO (MainThread) [homeassistant.core] Bus:Handling <Event state_changed[L]: old_state=<state automation.automation_0=on; friendly_name=automation 0, last_triggered=None @ 2017-02-08T07:19:00.954793+01:00>, entity_id=automation.automation_0, new_state=<state automation.automation_0=on; friendly_name=automation 0, last_triggered=2017-02-08T07:20:01.536878+01:00 @ 2017-02-08T07:19:00.954793+01:00>>
Maybe it’s not possible for generic_thermostat? What could I use instead only for proof of concept to prove that this kind of feature is possible?