I am using the generic_thermostat integration to control duct boosters installed in my home. I have created an automation that will intelligently control the boosters depending whether or not the following conditions are met:
- The desired room is calling for heating/cooling.
- The main HVAC handler is running.
This works great except for one quality-of-life issue I am experiencing with the generic_thermostat integration. This integration only permits one operation mode, that is - heat, or cool. And you cannot toggle between them in the UI. You may only turn the system on or off and set your desired temperature. This is configured using the ac_mode: true/false
variable within configuration.yaml. As such, I will have to manually change my configuration for all rooms in my home as the seasons change. Not to mention, during seasonal changes (such as winter → spring) I may have to modify my configuration multiple times in a month or two since during these times, my thermostat is switching between heating or cooling often.
To try and resolve my issue, I created a single-line template to parse the state of the heating system into a true or false string. Then, I figured I could put this template into my configuration in place of the “true” or “false” ac_mode variable. But that doesn’t work. I get an invalid key error when reloading my configuration.
For reference, here is the thermostat config:
- platform: generic_thermostat
unique_id: bcthermoroom
name: Bradyn's Room
target_sensor: sensor.bradyns_room_th_temperature
heater: input_boolean.climate_call_bradyn_s_room
ac_mode: {{ states('sensor.house_thermostat_mode') }}
And here is the error I get when checking config:
Error loading /config/configuration.yaml: invalid key: "{"states('sensor.house_thermostat_mode')": None}"
in "/config/thermostats.yaml", line 6, column 0