elupus / hass_nibe

Home Assistant Nibe Uplink Integration
184 stars 54 forks source link

Getting the intergration to show operation modes. #121

Closed frank8the9tank closed 1 year ago

frank8the9tank commented 2 years ago

I own a VMM500 and a F2120 with the option for cooling installed. The heating pump basicly works in 3 modes/productions: heating, cooling and hotwater production. I have the integration installed in home assistation and working stable. But i dont see any entity that shown what mode the system is running in. On the VVM500 display the operation mode is shown trough status/icons.

Is there a way to add this to the integration? That it shows in an entitie what mode the system is in?

elupus commented 2 years ago

The room temperature cöimate entity will show as heating when it's heating and cooling when it's cooling. The water heater entity will be heating when hot water production is active.

frank8the9tank commented 2 years ago

Hi Elupus

I have created a template sensor based on your advice, sadly i'm doing something wrongs (it always shows as idle)

My template:

        friendly_name: "Nibe heatpump running operation"
        value_template: >-
          {% if is_state('sensor.water_heater.nibe_108376_40014_47387', 'heat_pump' ) %}
            "Hot Water"
          {% elif is_state('sensor.climate.nibe_108376_s1_room', 'heating' ) %}
            "Heating"
          {% elif is_state('sensor.climate.nibe_108376_s1_room', 'cooling' ) %}
            "Cooling"
          {% else %}
            "Idle"
          {% endif %}

It never changes from idle Under development tools it shows the entities as: afbeelding afbeelding heat pump state: afbeelding

i think at least "Hot Water" should be shown as the entity state is: heat_pump for sensor water_heater.nibe_108376_40014_47387

What am i doing wrong?

frank8the9tank commented 2 years ago

heatpump state when the hotwater production is done: afbeelding

imist commented 2 years ago

In your first elif you have ’heating’ as value but the state in first screenshot shows ’heat’…

frank8the9tank commented 2 years ago

That always shows a heat, (thats the mode its is in (in summer cool) I think the status atribute is the thing that actual represent the heating beeing "ON and OFF"

imist commented 2 years ago

I think you should change first elif to: {% elif is_state('sensor.climate.nibe_108376_s1_room', 'heat' ) %} otherwise it will never evaluate to true. Also, the second elif should probably be changed to ‘cool’ in the same way.

frank8the9tank commented 2 years ago

Thats not it for what i can see, in the winter its always in heating mode. within this mode it switches the "heating" on and off, while the mode always shows a heat. same for cooling in the summer The actual heat pump switches ON and OFF (at differenct capacities/loads) for heating, cooling, and hot water production, i want to see that in an entity.

imist commented 2 years ago

This template worked for me and shows "Heating" when it's not warming water:

{% if is_state('water_heater.nibe_hot_water', 'heat_pump' ) %}
   "Hot Water"
{% elif is_state('climate.nibe_19650_s1_room', 'heat' ) %}
  "Heating"
{% elif is_state('climate.nibe_19650_s1_room', 'cool' ) %}
  "Cooling"
{% else %}
  "Idle"
{% endif %}

Apart from changing the state values from heating/cooling to heat/cool you also need to remove "sensor." that you have prefixed the entities with. These are not regular home assistant sensors, they are from Climate and Water Heater integrations:

https://www.home-assistant.io/integrations/water_heater/ https://www.home-assistant.io/integrations/climate/

Hope this helps to get your template sensor working.

frank8the9tank commented 2 years ago

Removing the sensor. part from the water_heater did the trick for the first rule. I can see the value change when i put the code above in the delopment tools -> template. (result is idle or hot water) So that is good. Other strange thing i see is that the entity does not get updated, (so i dont see the same in the front end, it never changes from idle)

For the climate part, this does not work, its the status atribute that changes. Shown above as status: DONE.

So the second and third rule have to look a the atribure for that.

imist commented 2 years ago

Yes, unless you change the state values from heating/cooling to heat/cool you'll never get "Heating" or "Cooling", only "Hot Water" or "Idle".

As you say, the template can of course be improved by also looking at various attributes...

frank8the9tank commented 2 years ago

Its actual the hvac_action attribute that changes when the heatpump is on or off, It changes from: idle to heating (and idle to cooling in the cool mode) So my if statement rule needs to look for the attribute of the entity.

imist commented 2 years ago

Ah, I see now when my Nibe F750 went from waming water to heating! Perhaps some like this then?

{% if is_state('water_heater.nibe_hot_water', 'heat_pump' ) %}
  "Hot Water"
{% elif is_state_attr('climate.nibe_19650_s1_room', 'hvac_action', 'heating' ) %}
  "Heating"
{% elif is_state_attr('climate.nibe_19650_s1_room', 'hvac_action', 'cooling' ) %}
  "Cooling"
{% else %}
  "Idle"
{% endif %}
frank8the9tank commented 2 years ago

I have made this:

      nibe_heatpump_operation:
        friendly_name: "Nibe heatpump running operation"
        value_template: >-
          {% if is_state('water_heater.nibe_108376_40014_47387', 'heat_pump' ) %}
            Hot Water
          {% elif is_state_attr('climate.nibe_108376_s1_room','hvac_action', 'heating') %}
            Heating
          {% elif is_state_attr('climate.nibe_108376_s1_room','hvac_action', 'cooling') %}
            Cooling
          {% else %}
            Idle
          {% endif %}

This is working under the template page in development tools. Strange thing that the entity does not get updated in the front panel. (so under development is shows all the states correctly, but in the lovelace gui only idle) why?

frank8the9tank commented 2 years ago

Found it, the configuration file was not saved, above code is working.