How to know how to check if heating is running?

Hi,
I wuold like to know when the heating (or cooling in summer) is running.
The only way I found is to check if the set themp is higher than the current them.
I made a template that check that ad i put that in a template mushroom card:

{% if is_state('climate.studio_2', 'heat') %}
  {% if state_attr('climate.studio_2','current_temperature') |float - state_attr('climate.studio_2','temperature') | float >= 0 %}
  Spento
  {% else %}
  Acceso
  {% endif %}
{% else %}
  {% if state_attr('climate.studio_2','current_temperature') |float - state_attr('climate.studio_2','temperature') | float <= 0 %}
  Spento
  {% else %}
  Acceso
  {% endif %}
{% endif %}

This is working (at least for the winter), but i would like to transform this in a sensor.
Is there another way to do this?

Thank you

That’s what this tells you isn’t it?

is_state('climate.studio_2', 'heat')

Likewise for cool.

I don’t need to know if is on cool or heat, I would like to know if i am using the heating or not;
because the thermostat is olways on (always on heat right now)

1 Like

Can you measure the power drawn?

Do the entity have the attribute hvac_action? What does that say?

I have only the power drain of the whole house

I don’t have the hvac_action, only the hvac_modes

Which integration are you using for climate.studio_2?

I am using Freedompro, those are KNX thermostat

I ask again the first question, can I use that template to create a sensor?
Because I am pretty sure that I don’t have that value.

If it provides an appropriate group object you can link it to either active_state_address or command_value_state_address to get hvac_action.

1 Like

is this correct?

Template:
  -sensor
      - name: "Stato Termostato Studio"
        unique_id: "stato_termostato_studio"
        device_class: gas
        state: >
          "{"% if is_state('climate.studio_2', 'heat') %}
            {% if state_attr('climate.studio_2','current_temperature') |float - state_attr('climate.studio_2','temperature') | float >= 0 %}
            Spento
            {% else %}
            Acceso
            {% endif %}
          {% else %}
            {% if state_attr('climate.studio_2','current_temperature') |float - state_attr('climate.studio_2','temperature') | float <= 0 %}
            Spento
            {% else %}
            Acceso
            {% endif %}
          {% endif %}"

I think this is correct. at least the syntax should be correct, I can’t say much about the if statements.

With those little correction, is working!
I have already tested the if statement in the template

Interesting approach. I just want to point out that, depending on the thermostat, this may not be very accurate. With some thermostats the temperature can be one or two degrees above or below the set point before they trigger on or off.

On the other hand, some “smart” thermostats will turn the heat (or cooling) on a certain number of times per hour, to keep the temperature steady. This is how my Honeywell thermostats work. They might go all day never showing a temperature change.

It’s hard to imagine why a climate integration wouldn’t include the current “action” (heating/cooling/off) the thermostat is calling for. Perhaps there’s an attribute somewhere, or maybe the developer of the integration could shed some light.

He did :wink:. How to know how to check if heating is running? - #10 by farmio

2 Likes

For what I have seen, every time the set temperature is higher than the themperature of the room, the knx relay switch on.

The problem i s probably the way I have intergate everything, I have everything on knx, that I can’t touch (for now, I am planning to learn how to use ETS), and I have that integrated in Freedompro.

I have then Freedompro integrated in Home assistant.

so i can’t see the knx layer, just what freedompro pass to me.

This is something I want to change, but before I use KNX directly on HA, I would like to ler how to use ETS.

I have finally migrated from Freedompro to KNX, so now everything is smoother (because it doesnt go throught internet) and I have some new controls, like the stop button for blinds and the state information of the thermostat.

Now I have semplify the template:

- binary_sensor:
      #stato termostati
      - name: "Stato Termostato Studio"
        unique_id: "stato_termostato_studio"
        state: >-
          {% if is_state('climate.studioknx_2', 'off') %}
            Spento
          {% else %}
            Acceso
          {% endif %}

fo each thermostat.