I am trying to automate the thermostats in my house and would like to easily set temperature schedule for a week.
I found a very good custom component called Programmable_thermostat for this use, and it works like a charm for my electrical heaters which are connected to a power plug and room sensor.
For these I create a Programmable thermostat in configuration.yaml, and use the file_restore component as input with a set temperature every hour throughout the week.
However I also have a couple of HeatIt floor thermostats and a Mitsubishi Heat pump. These are already set up as climate entities, so I not possible to use the Programmable Thermostat component. Instead I wanted to use the file_restore as input to set temperature throughout the day with an automation that is triggered every 5 minutes. The file_restore component has an array with temperatures, and state gives the one for the current hour. However I am not able to get this value and use it for automation. I am not so experience with templates and home assistant programming, so may be an obvious fix…
I have tried the template in the template editor, and it gives me the temperature, but does not work to set temperature. I have also tried to add “| float” to fix type.
I get this error when trying to start HA with the script:
ERROR (SyncWorker_0) [homeassistant.util.yaml.loader] invalid key: “OrderedDict([(‘states.sensor.set_temperature_gang_1_etg.state’, None)])”
in “/config/automations.yaml”, line 130, column 0
Any suggestions to get a “programmable thermostat” using HeatIt floor heating?
My heating is always on, but if the doors are open or the house unoccupied the target is pretty low. (ie it’s the same as ‘off’)
I use a template to set an input number value and when that changes it updates the climate control.
This way I can manually overide at any time.
I also have an input binary to act as a ‘boost button’ - sets value to evening setting for 1 hour (unless another change happens)
## resets temperature following any pattern change
sc_heat_reset_value:
alias: Heating Reset Value
sequence:
- service: input_number.set_value
data_template:
entity_id: input_number.in_heat_temp_control_val
value: >
{% if false and not is_state('binary_sensor.bs_door_open', 'on') %}
{{ '6' | float }}
{% elif not is_state('binary_sensor.bs_occupied', 'on') %}
{{ states('input_number.in_heat_temp_away_val') | float }}
{% elif is_state('binary_sensor.bs_heat_night_active', 'on') %}
{{ states('input_number.in_heat_temp_night_val') | float }}
{% elif is_state('binary_sensor.bs_heat_day_active', 'on') %}
{{ states('input_number.in_heat_temp_day_val') | float }}
{% else %}
{{ states('input_number.in_heat_temp_evening_val') | float }}
{% endif %}
#### end of template
@tom_l , you note my template paranoia here to ensure “nothing” gets mistakely put into my template.
Just coz I’m paranoid, doesn’t mean that they aren’t out to get me !
My door sensors aren’t all set up yet so the above just has a placeholder
Edit: just to be clear the above is a script so as to use the code from mutiple triggers
Thanks for reply! Unfortunately still does not work… Seems I need to better understand the template function. E.g. what is different with value_template and data_template etc.
Ideally it would be possible to implement a user interface to set weekly schedules for a thermostat… I.e. similar to commercial equipment such as EQ3 Max! or similar. But have not found anything for HA yet…