soundvibe / ha-danfoss

Home Assistant Addon for Danfoss Icon App Module
14 stars 0 forks source link

HA indicates the system is cooling, while it is heating #15

Closed ditisdirkdewit closed 3 weeks ago

ditisdirkdewit commented 1 month ago

Hi @soundvibe ,

First of all thanks for the add-in, great work. I installed the add-on during summer, when my Danfoss Icon system is primarily cooling, so I was happy to see that this was shown in HA as well. Currently Danfoss is heating, however it still shows as "cooling" in HA. I checked the MQTT messages that HA received from the Add on, those indicate the mode "cooling", while the system is heating.

Anything i can provide / do to fix this? Thanks!

soundvibe commented 1 month ago

Hi,

I don't have cooling in my danfoss system, so I can't test this properly but the way it is implemented in this addon is quite simple - danfoss api reports two flags - ROOM_HEATINGCOOLINGSTATE and ROOM_COOLINGENABLED. If ROOM_COOLINGENABLED is true, then ROOM_HEATINGCOOLINGSTATE reports cooling , otherwise it reports heating. So maybe this cooling enabled option is turned on somewhere.

ditisdirkdewit commented 1 month ago

Thanks for the quick response.

I believe coolingenabled is not indicating whether the thermostat is cooling at the moment. But it indicates if you have the Cooling option enabled in your thermostat. As described here: .

Settings on thermostat Excluding rooms from cooling: To exclude a room from cooling - typically in bathrooms where cooling would be uncomfortable - go to thermostat and set menu to . See Thermostat Installation Guide for further information.

Just tested to confirm. I disabled the coolingmode in one of my thermostats and now - while danfoss is heating - HA indeed indicates it is heating (instead of cooling).

soundvibe commented 1 month ago

I believe coolingenabled is not indicating whether the thermostat is cooling at the moment. But it indicates if you have the Cooling option enabled in your thermostat. As described here: .

Yes, coolingenabled itself only indicates if cooling is enabled but we use it with conjunction with ROOM_HEATINGCOOLINGSTATE because danfoss api doesn't report specifically which mode(heating or cooling) is on (ROOM_HEATINGCOOLINGSTATE reports that either heating or cooling is on/off).

ditisdirkdewit commented 1 month ago

That's a shame it is not reflected in the API. Danfoss does indicate it in their own app. If heating you see the red arrows going upward. And if cooling you blue arrows going downward. I know the cooling/heating mode is not a per room setting but for the whole system. Could it be this is indicated in one of the RAIL class values? " int RAIL_INPUTHEATORCOOL"?

DrTomek commented 1 month ago

Hi all, as I also use cooling and heating, I have checked what is going on with my system. And indeed it shows cooling while heating. But strange thing I noticed is one thermostat shows cooling while other one shows heating. (In Danfoss App both are heating and both are thermostats in bathroom with cooling option disabled).

1 2

ditisdirkdewit commented 1 month ago

I decided to fix it differently as the COOLINGENABLED parameter is in my view not a good parameter to identify if the system is cooling or heating. I created an automation that switches a boolean helper(input_boolean.verwarmen_of_koelen) to heating or cooling based on the data from my heatpump.

In the climate template I added the following if statement for "hvac_mode_template" (not using MQTT anymore). Hopes it helps anyone.

`hvac_mode_template: "{% if state_attr('sensor.danfoss_1_temperature', 'mode') == 'off' %} off {% elif states('input_boolean.verwarmen_of_koelen') == 'off' %} heat {% elif states('input_boolean.verwarmen_of_koelen') == 'on' %} cool {% endif %}"

soundvibe commented 3 weeks ago

@ditisdirkdewit I've pushed very small addon update. It now logs RAIL_INPUTHEATORCOOL and ROOM_HEATINGCOOLINGCONFIGURATION packets. Would be great if you could test what values are you getting when these heating/cooling modes are changing.

ditisdirkdewit commented 3 weeks ago

Thanks @soundvibe, I'll try to test it asap.

ditisdirkdewit commented 3 weeks ago

Tried it, I see the following in the logs: room heating/cooling configuration=1, but that doesn't change when changing from heating to cooling. Don't see rail input heat or cool=

ditisdirkdewit commented 3 weeks ago

Just thinking out loud. shouldn't this piece of code be included in the "IconMasterHandler" instead of IconRoomHandler".

            case RAIL_INPUTHEATORCOOL:
                logger.info("rail input heat or cool={}", pkt.getByte());
                break;
soundvibe commented 3 weeks ago

Just thinking out loud. shouldn't this piece of code be included in the "IconMasterHandler" instead of IconRoomHandler".

            case RAIL_INPUTHEATORCOOL:
                logger.info("rail input heat or cool={}", pkt.getByte());
                break;

Yes, fixed in the new version.

ditisdirkdewit commented 3 weeks ago

That's it! When switching to cooling the value changes to 1. And switching back to heating the value is 0 again:


21:36:09.639 [] INFO  net.soundvibe.hasio.Bootstrapper - sensors updated successfully
21:37:09.469 [] INFO  net.soundvibe.hasio.Bootstrapper - sensors updated successfully
21:38:09.605 [] INFO  net.soundvibe.hasio.Bootstrapper - sensors updated successfully
21:38:33.058 [SDG socket thread.1] INFO  n.s.h.d.protocol.IconMasterHandler - rail input heat or cool=1
21:39:09.485 [] INFO  net.soundvibe.hasio.Bootstrapper - sensors updated successfully
21:39:39.563 [SDG socket thread.1] INFO  n.s.h.d.protocol.IconMasterHandler - rail input heat or cool=0
soundvibe commented 3 weeks ago

That's it! When switching to cooling the value changes to 1. And switching back to heating the value is 0 again:


21:36:09.639 [] INFO  net.soundvibe.hasio.Bootstrapper - sensors updated successfully
21:37:09.469 [] INFO  net.soundvibe.hasio.Bootstrapper - sensors updated successfully
21:38:09.605 [] INFO  net.soundvibe.hasio.Bootstrapper - sensors updated successfully
21:38:33.058 [SDG socket thread.1] INFO  n.s.h.d.protocol.IconMasterHandler - rail input heat or cool=1
21:39:09.485 [] INFO  net.soundvibe.hasio.Bootstrapper - sensors updated successfully
21:39:39.563 [SDG socket thread.1] INFO  n.s.h.d.protocol.IconMasterHandler - rail input heat or cool=0

That's nice! Now I need to update the code accordingly.

soundvibe commented 3 weeks ago

@ditisdirkdewit I've pushed a new update, please test it and let me know if it works as expected. I think it should work but it's late now and I'm a bit tired.

ditisdirkdewit commented 3 weeks ago

Thanks @soundvibe! it works as it should now, appreciate you fixing this quickly