I’m so confused by Generic Thermostat at the moment can some one help me out please? I’m currently running hassio 0.99.3. I’ve had an automation based on the Generic Thermostat state changing from ‘idle’ to ‘heat’. It’s worked for ages but since the heating has been off all summer and it’s not working now, I’m wondering if I’ve missed some changes in the updates. All my searches have found me is problems from years ago that have been resolved with updates. Presently the state is always ‘idle’ even if the Target Temperature is higher than the current temperature. The target switch is being controlled properly it’s just the state doesn’t change.
When I’ve read through the docs I can see that the modes are either ‘heat’ or ‘off’ but that’s the operation rather than the state.
If I use dev-tools and view the state of the component I can see the it changes from ‘idle()’ to ‘heating()’, when I adjust the target temperature. The state, however, remains the same. Any insight would really be appreciated.
The Climate component was changed in 0.96. See here for details. What the system is doing (heating, cooling, idle) is now a state attribute (hvac_action
) instead of the state, and the state is now what mode the thermostat is set to (heat, cool, off, etc.)
I really need to be more thorough reading the release notes! I should’ve been using ‘climate’ instead of ‘generic thermostat’ when doing my internet search and I would have found that myself!! Thank you Tediore. Now I just need to work out how to trigger from the heating attribute instead of the state.
What a legend!! Thank you so much!
Hi guys, May you help me? I have 2 generic_thermostat based on 2 temperature sensors. I have to write an automation which let the heater switch on when at least one of 2 generic_thermostat are in heat mode, and switch off when both are in idle or off.
How can I write trigger for such condition?
Thanks!
So you have a third separate heater that you’re trying to control based on the state of the two generic thermostats?
No 2 generic thermostat controls the 2 zones of my house, I have 1 heater and I want it on when at least one zone need to be heated.
Create a template sensor that is the lowest of the two thermostats and use that as your sensor input
I’m not so experienced with home assistant, may you help me with a piece of code?
What are the names of your two entities (and which is your current primary) and what do you want to call the new entity ?
Do you have split configuration files; or would I be correct in assuming that you are running monolithic (everything in the main configuration.yaml) ?
Here you go : -
sensor:
- platform: template
sensors:
heat_thermo_3:
friendly_name: Lowest Of Two
value_template: >
{% set v1 = states('sensor.heat_thermo_1') | float %}
{% set v2 = states('sensor.heat_thermo_2') | float %}
{% set v3 = v1 if v2 >= v1 else v2 %}
"{{ v3 }}"
icon: mdi:thermometer
I suggest you read up on sensor templates, where to put them etc.
Note : This is really basic, it assumes that both values are available, numeric and that they are in a valid range. YMMV
We ‘could’ have used ‘min’ to get the lowest but this example is more adaptable to other peoples needs as it shows a definitive test and gives the result.
Thank you very much!
But I think I’ve not explained well.
however your code inspired me and I added this:
- platform: template
sensors:
caldaia:
value_template: >-
{% if is_state('switch.collettore1piano_switch', 'on') %}
on
{% elif is_state('switch.collettorepianoterra_switch', 'on') %}
on
{% else %}
off
{% endif %}
and in automation
- id: '1573068662846'
alias: caldaia_accesa
description: ''
trigger:
- minutes: '*'
platform: time_pattern
condition:
- condition: state
entity_id: switch.collettore1piano_switch
state: 'on'
- condition: or
conditions:
- condition: state
entity_id: switch.collettorepianoterra_switch
state: 'on'
action:
- alias: ''
data:
entity_id: switch.caldaia_switch
service: switch.turn_on
- id: '1573068734045'
alias: caldaia_spenta
description: ''
trigger:
- minutes: '*'
platform: time_pattern
condition:
- condition: state
entity_id: switch.collettore1piano_switch
state: 'off'
- condition: and
conditions:
- condition: state
entity_id: switch.collettorepianoterra_switch
state: 'off'
action:
- data:
entity_id: switch.caldaia_switch
service: switch.turn_off
Ahhh !
glad you got something … BUT …
Technically, all you need for that is a binary_sensor (on or off) and the on needs to be ‘on’ with the off as ‘off’
And the code simplyfies further (because it uses true or false) to : -
binary_sensor:
- platform: template
sensors:
caldaia:
value_template: "{{ is_state('switch.collettore1piano_switch', 'on') or is_state('switch.collettorepianoterra_switch', 'on') }}"
icon: mdi:power
Noticed some of your spacing was off, maybe just a cut and paste issue though