Confused about thermostat

What about when the house is empty ?
And what if doors are open ?

Read Automation, this Automation docs, this Automation Examples and this Automation Editor to get you started. Then try to do something yourself and if you don’t suceed, post your code here and we are happy to help you.

For the holidays, check out this:

I have no sensor on the doors and when we are away is another issue I can tackle then.

Thank you very much, I will have a look and try to make something out of it. I was giving all the details to describe my situation so one could give me help in the right direction, thats all. It was not a question for you writing my code.

I too do not have doors fully implemented but I do have a place holder for it.

## 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

This runs at any pattern change and sets the value in an input number
That change triggers another automation to update the value in my (HA Software) thermostat
I use the ‘thermostat’ in the field to just provide me a temperature reading into the HA thermostat too and it’s output drives the boiler

I know, I was just making a suggestion on how to proceed :wink:
This might be of interest for you once you want to do more advanced heating scheduling:

Hi guys,

Before I connect the z-wave stick and everything goes wrong on a cold day :wink: I come to you to evaluate my stuff.
I have come to this:

configuration.yaml

climate: !include climate.yaml

climate.yaml


- platform: generic_thermostat
  name: Thermostaat_wk
  heater: climate.horstmann_secure_meters_hrt4_zw_thermostat_transmitter_heating_1
  target_sensor: sensor.horstmann_secure_meters_hrt4_zw_thermostat_transmitter_temperature
  min_temp: 15
  max_temp: 24
  ac_mode: false
  target_temp: 15
  cold_tolerance: 0.3
  hot_tolerance: 0
  min_cycle_duration:
    seconds: 5
  keep_alive:
    minutes: 3
  initial_hvac_mode: "off"
  away_temp: 15
  precision: 0.5

automation.yaml

# set temperature weekends and holidays daytime
- id: '201912151035'
  alias: Conditional control thermostat weekend and holiday
  description: ''
  trigger:
    - platform: time
      from: '08:30:00'
      to: '22:30:00'
  condition:
    condition: state
    entity_id: 'binary_sensor.workday_sensor'
    state: 'off'
  action:
    - service: climate.set_temperature
      data:
        entidy_id: 'sensor.horstmann_secure_meters_hrt4_zw_thermostat_transmitter_temperature'
        temperature: '20'
# set temperature all days night
- id: '201912151135'
  alias: Conditional control thermostat weekend and holiday
  description: ''
  trigger:
    - platform: time
      from: '23:30:00'
      to: '08:30:00'
  action:
    - service: climate.set_temperature
      data:
        entidy_id: 'sensor.horstmann_secure_meters_hrt4_zw_thermostat_transmitter_temperature'
        temperature: '15'
# set temperature workday between 08:30 and 16:30
- id: '201912151035'
  alias: Conditional control thermostat weekend and holiday
  description: ''
  trigger:
    - platform: time
      from: '08:30:00'
      to: '16:30:00'
  condition:
    condition: state
    entity_id: 'binary_sensor.workday_sensor'
    state: 'on'
  action:
    - service: climate.set_temperature
      data:
        entidy_id: 'sensor.horstmann_secure_meters_hrt4_zw_thermostat_transmitter_temperature'
        temperature: '18'
# set temperature workday between 16:30 and 22:30
- id: '201912151035'
  alias: Conditional control thermostat weekend and holiday
  description: ''
  trigger:
    - platform: time
      from: '16:30:00'
      to: '22:30:00'
  condition:
    condition: state
    entity_id: 'binary_sensor.workday_sensor'
    state: 'on'
  action:
    - service: climate.set_temperature
      data:
        entidy_id: 'sensor.horstmann_secure_meters_hrt4_zw_thermostat_transmitter_temperature'
        temperature: '20'

Is this what it should be?

Franklin

I already see I have to change the id.
Copy paste doesn’t mean I can stop reading :rage:

Also changed the time trigger already:

  trigger:
    - platform: time
      at: '23:30:00'

in stead of:

  trigger:
    - platform: time
      from: '23:30:00'
      to: '08:30:00'

Improving myself every minute… :muscle:

I would change the alias for the different automations to something more meaningful. Otherwise I think the automations look alright. in addition I think it would be a good idea to create input_datetimes for the different time triggers, so that you are able to control the times over the UI.

I could help you combine these four automations into one automation, if you like.

Thanks for looking at my efforts. I thought the id had to be something abstract because I made the others I have with Lovelace and they have some cryptical number. I would appriciate it when you would help me improve this. So I can learn about this but others also may have a good example.

This afternoon at 16:30 I hoped to see the thermostat change to 20 deg. Celsius but it didn’t. I got the error message:

Error while executing automation automation.conditional_control_thermostat_workday_16_30. Invalid data for call_service at pos 1: extra keys not allowed @ data['entidy_id']

Do you know maybe what is wrong because I don’t know.
Thanks in advance.

Ah, now I read better I see what is going wrong. I typed

entidy_id

in stead off

entity_id

Lets hope this was all that is wrong.

You have the same typo in other places as well. Sorry didn’t catch these ones. Why don’t you change the time condition for the different automations to test wheter they work or not?

I did copy/paste so the error was suddenly everywhere. But I corrected that.
I just tried your suggestion and I got no errors anymore…BUT… the temperature is not changing.

Can you please post the code you have now again?

Here it is:

- id: '201912151035'
  alias: Conditional control thermostat weekend 08:30
  description: ''
  trigger:
  - platform: time
    at: 08:30:00
  condition:
    condition: state
    entity_id: binary_sensor.workday_sensor
    state: 'off'
  action:
  - service: climate.set_temperature
    data:
      entity_id: sensor.horstmann_secure_meters_hrt4_zw_thermostat_transmitter_temperature
      temperature: '20'
- id: '201912151135'
  alias: Conditional control thermostat night 22:30
  description: ''
  trigger:
  - platform: time
    at: '23:30:00'
  action:
  - service: climate.set_temperature
    data:
      entity_id: sensor.horstmann_secure_meters_hrt4_zw_thermostat_transmitter_temperature
      temperature: '15'
- id: '201912151136'
  alias: Conditional control workday 08:30
  description: ''
  trigger:
  - platform: time
    at: 08:30:00
  condition:
    condition: state
    entity_id: binary_sensor.workday_sensor
    state: 'on'
  action:
  - service: climate.set_temperature
    data:
      entity_id: sensor.horstmann_secure_meters_hrt4_zw_thermostat_transmitter_temperature
      temperature: '18'
- id: '201912151137'
  alias: Conditional control thermostat workday 16:30
  description: ''
  trigger:
  - platform: time
    at: '17:52:00'
  condition:
    condition: state
    entity_id: binary_sensor.workday_sensor
    state: 'on'
  action:
  service: climate.set_temperature
  data:
    entity_id: sensor.horstmann_secure_meters_hrt4_zw_thermostat_transmitter_temperature
    temperature: '21'

The indentation is wrong at the end. Also you are using the sensor to set the temperatur, but you need to use the climate.xxx entity. Try the below which worked for me.

- id: '1576518051921'
  alias: Test Automation
  description: ''
  trigger:
  - platform: time
    at: '17:52:00'
  condition:
  - condition: state
    entity_id: binary_sensor.workday_sensor
    state: 'on'
  action:
  - entity_id: climate.horstmann_secure_meters_hrt4_zw_thermostat_transmitter_heating_1
    service: climate.set_temperature
    data:
      temperature: 21

I’m not sure on this but is setting the temperature enough? If the heating is turned off, will it turn on if you set a temperature? I don’t own a thermostat so I can’t find out.

You are absolute right and it works. I will wait till I have seen a cycle of 24 hours and then I will report back to you.
For now I will qualify my question as solved by you. Thank you so very much.

Glad that it works. :slightly_smiling_face: Don’t forget to change the other automations as well :wink: