Closed mbsjoeberg closed 6 months ago
Just to understand correct - It shows idle when heating and heating when idle?
Could you try swapping line 496 and 498 in climate.py? Just to see if that fixes the issue
Should look like this after you have edited:
if self._device["work_state"] == "heat_active":
return HVACAction.IDLE
elif self._device["work_state"] == "Heat":
return HVACAction.HEATING
Remember to only swap 496 and 498 as the lines are found more than one place, but only these lines are for Icon devices
Correct, entity state is idle when the controller is actually heating and "heating_active" when idle.
Changed the climate.py: no other changes made.
Reloaded DanFoss Ally integration -> no impact Restarted HomeAssistant -> no impact.
Log still shows correct "work-state", but entity is missing "hvac_action" attribute when heating is actually active, but has it with value "heating", when actually idle.
Heating active: 2024-02-06 13:44:21.249 DEBUG (MainThread) [custom_components.danfoss_ally] Updating Danfoss Ally devices 2024-02-06 13:44:21.623 DEBUG (MainThread) [custom_components.danfoss_ally] bf4b9898f673dcbcf4bgdg: {'isThermostat': False, 'name': 'Danfoss Ally™ Gateway', 'online': True, 'update': 1707035282, 'model': 'Danfoss Ally™ Gateway', 'floor_sensor': False} 2024-02-06 13:44:21.623 DEBUG (MainThread) [custom_components.danfoss_ally] bf1ea44f44ab8e2745xboz: {'isThermostat': False, 'name': 'Danfoss Icon2 Controller', 'online': True, 'update': 1707035282, 'model': '', 'floor_sensor': False, 'switch': False, 'fault': 0} 2024-02-06 13:44:21.623 DEBUG (MainThread) [custom_components.danfoss_ally] bf4b8c17753602a162kaze: {'isThermostat': True, 'name': 'Gæstetoilet', 'online': True, 'update': 1707035282, 'model': '', 'floor_sensor': True, 'switch': True, 'mode': 'manual', 'work_state': 'heat_active', 'temp_set': 21.0, 'upper_temp': 35.0, 'temperature': 22.4, 'lower_temp': 4.0, 'child_lock': False, 'battery': 87, 'fault': 0, 'floor_temperature': 26.2, 'humidity': 42.0, 'setpointchangesource': 'Externally', 'manual_mode_fast': 35.0, 'at_home_setting': 21.0, 'leaving_home_setting': 19.0, 'pause_setting': 5.0, 'holiday_setting': 15.0, 'switch_state': False, 'output_status': True}
Entity state when heating active (hvac_action attribute is missing!?):
Heating idle: 2024-02-06 13:47:21.259 DEBUG (MainThread) [custom_components.danfoss_ally] Updating Danfoss Ally devices 2024-02-06 13:47:21.680 DEBUG (MainThread) [custom_components.danfoss_ally] bf4b9898f673dcbcf4bgdg: {'isThermostat': False, 'name': 'Danfoss Ally™ Gateway', 'online': True, 'update': 1707035282, 'model': 'Danfoss Ally™ Gateway', 'floor_sensor': False} 2024-02-06 13:47:21.680 DEBUG (MainThread) [custom_components.danfoss_ally] bf1ea44f44ab8e2745xboz: {'isThermostat': False, 'name': 'Danfoss Icon2 Controller', 'online': True, 'update': 1707035282, 'model': '', 'floor_sensor': False, 'switch': False, 'fault': 0} 2024-02-06 13:47:21.680 DEBUG (MainThread) [custom_components.danfoss_ally] bf4b8c17753602a162kaze: {'isThermostat': True, 'name': 'Gæstetoilet', 'online': True, 'update': 1707035282, 'model': '', 'floor_sensor': True, 'switch': True, 'mode': 'manual', 'work_state': 'Heat', 'temp_set': 21.0, 'upper_temp': 35.0, 'temperature': 22.4, 'lower_temp': 4.0, 'child_lock': False, 'battery': 87, 'fault': 0, 'floor_temperature': 26.2, 'humidity': 42.0, 'setpointchangesource': 'Externally', 'manual_mode_fast': 20.0, 'at_home_setting': 21.0, 'leaving_home_setting': 19.0, 'pause_setting': 5.0, 'holiday_setting': 15.0, 'switch_state': False, 'output_status': False}
Entity state when heating is idle:
Guess I'd need access to a system to fix this. Right now I'm just guessing.
I'll see if i can find th eproblem and will revert asap. Might be a day or two beofre i have time.
I can confirm, though I am only on 1.2.1. When the Ally app shows the temperature mode to be "heat_active", the hvac_action state is missing on the HA entity. When the Ally app shows the temperature mode to be "Heat", hvac_action shows up with state "heating".
Okay - so actually not a beta issue then ;) That makes much more sense, as the codebase haven't changed around that
Guess the values have changed. Awaiting Danfoss' response to what the actual values returned are.
okidoke - be aware there might be different values / addresses for Icon and Icon2 (i did some zigbee sniffing a few weeks ago and got a feeling they had shifted those at least; this of course might not propagate to their ally api, but you never know :) ).
Would it be possible to lend an API key and secret, so we can get this fixed?
Or perhaps send me the FULL output of test.py
in https://github.com/mtrab/pydanfossally
I tried running the test.py script by following this guide: https://www.home-assistant.io/integrations/python_script/
Unfortunately I'm getting an error in the log, and seemingly no other output:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/python_script/init.py", line 224, in execute
exec(compiled.code, restricted_globals) # noqa: S102
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "test_ally.py", line 3, in
Since I rarely ever get that far under the hood of HA, I assume I'm doing something wrong :) Is there an easier/smarter way to run the script? Otherwise I'll dig out some keys later.
Cannot be run in Home Assistant ;) It is only to be run on your computer.
Otherwise drop the key and secret on my email github_2024(at)trab.dk and I'll do some tests to find why it's not working as intended
Think I have found the reason for this - and I'm not sure it's fixable as of right now :/ The Icon devices doesn't get recognized as Icon devices and hence the checks for heating and not heating is invalid as the values are not identical between Icon and Ally thermostats. I think I need to take this up with Danfoss for this to be resolved.
For the EXPERIENCED user, try changing line 567
in climate.py
to look like this, and see if that might (at least temporarily) fix the issue:
if model == "Icon RT" or model == "":
I'm not sure if this will have any negative impact, but the Icon2 devices doesn't report the model, which is why it's not matched correct.
That seems to have fixed the issue for me, on an ICON2 system. When not heating, hvac_action is idle. When heating, hvac_action is heating. This is also correctly reflected in the Thermostat cards
Same here, works fine on both wired Icon2 RT 24V (088U2125) and wireless Icon2 RT Featured (088U2122)
@MTrab DanFoss must have changed the API. For Icon2 room thermostats, 'model' now reports 'Danfoss Icon2 RT', instead of ''.
Chaning line 567 in climate.py to the below solves the problem:
if model == "Icon RT" or model == "Danfoss Icon2 RT":
Correct - Danfoss have fixed the missing model name for the Icon devices
Environment:
Describe the bug
The hvac_action attribute is inverted, showing "Heating (heat)" when NOT heating and "Heat" when heating.
Debug log
Log when not heating (Setpoint: 20C note: "work_state": Heat seems correct)
2024-02-06 09:50:07.565 DEBUG (MainThread) [custom_components.danfoss_ally] Updating Danfoss Ally devices 2024-02-06 09:50:07.959 DEBUG (MainThread) [custom_components.danfoss_ally] bf4b9898f673dcbcf4bgdg: {'isThermostat': False, 'name': 'Danfoss Ally™ Gateway', 'online': True, 'update': 1707035282, 'model': 'Danfoss Ally™ Gateway', 'floor_sensor': False} 2024-02-06 09:50:07.959 DEBUG (MainThread) [custom_components.danfoss_ally] bf1ea44f44ab8e2745xboz: {'isThermostat': False, 'name': 'Danfoss Icon2 Controller', 'online': True, 'update': 1707035282, 'model': '', 'floor_sensor': False, 'switch': False, 'fault': 0} 2024-02-06 09:50:07.959 DEBUG (MainThread) [custom_components.danfoss_ally] bf4b8c17753602a162kaze: {'isThermostat': True, 'name': 'Gæstetoilet', 'online': True, 'update': 1707035282, 'model': '', 'floor_sensor': True, 'switch': True, 'mode': 'manual', 'work_state': 'Heat', 'temp_set': 21.0, 'upper_temp': 35.0, 'temperature': 22.3, 'lower_temp': 4.0, 'child_lock': False, 'battery': 87, 'fault': 0, 'floor_temperature': 27.4, 'humidity': 42.0, 'setpointchangesource': 'Externally', 'manual_mode_fast': 20.0, 'at_home_setting': 21.0, 'leaving_home_setting': 19.0, 'pause_setting': 5.0, 'holiday_setting': 15.0, 'switch_state': False, 'output_status': False}
2024-02-06 09:50:07.962 DEBUG (MainThread) [custom_components.danfoss_ally.binary_sensor] Loading new binary_sensor data for device bf4b9898f673dcbcf4bgdg 2024-02-06 09:50:07.962 DEBUG (MainThread) [custom_components.danfoss_ally.binary_sensor] Loading new binary_sensor data for device bf1ea44f44ab8e2745xboz 2024-02-06 09:50:07.963 DEBUG (MainThread) [custom_components.danfoss_ally.binary_sensor] Loading new binary_sensor data for device bf4b8c17753602a162kaze 2024-02-06 09:50:07.964 DEBUG (MainThread) [custom_components.danfoss_ally.sensor] Loading new sensor data for Ally Sensor for device bf4b8c17753602a162kaze 2024-02-06 09:50:07.965 DEBUG (MainThread) [custom_components.danfoss_ally.sensor] Loading new sensor data for Ally Sensor for device bf4b8c17753602a162kaze 2024-02-06 09:50:07.966 DEBUG (MainThread) [custom_components.danfoss_ally.climate] Loading new climate data for device bf4b8c17753602a162kaze
Log when heating (setpoint: 35C. note: "work_state": heat_active seems correct)
2024-02-06 09:40:52.523 DEBUG (MainThread) [custom_components.danfoss_ally] Updating Danfoss Ally devices 2024-02-06 09:40:52.942 DEBUG (MainThread) [custom_components.danfoss_ally] bf4b9898f673dcbcf4bgdg: {'isThermostat': False, 'name': 'Danfoss Ally™ Gateway', 'online': True, 'update': 1707035282, 'model': 'Danfoss Ally™ Gateway', 'floor_sensor': False} 2024-02-06 09:40:52.942 DEBUG (MainThread) [custom_components.danfoss_ally] bf1ea44f44ab8e2745xboz: {'isThermostat': False, 'name': 'Danfoss Icon2 Controller', 'online': True, 'update': 1707035282, 'model': '', 'floor_sensor': False, 'switch': False, 'fault': 0} 2024-02-06 09:40:52.943 DEBUG (MainThread) [custom_components.danfoss_ally] bf4b8c17753602a162kaze: {'isThermostat': True, 'name': 'Gæstetoilet', 'online': True, 'update': 1707035282, 'model': '', 'floor_sensor': True, 'switch': True, 'mode': 'manual', 'work_state': 'heat_active', 'temp_set': 21.0, 'upper_temp': 35.0, 'temperature': 22.3, 'lower_temp': 4.0, 'child_lock': False, 'battery': 87, 'fault': 0, 'floor_temperature': 27.2, 'humidity': 42.0, 'setpointchangesource': 'Externally', 'manual_mode_fast': 35.0, 'at_home_setting': 21.0, 'leaving_home_setting': 19.0, 'pause_setting': 5.0, 'holiday_setting': 15.0, 'switch_state': False, 'output_status': True} 2024-02-06 09:40:52.945 DEBUG (MainThread) [custom_components.danfoss_ally.binary_sensor] Loading new binary_sensor data for device bf4b9898f673dcbcf4bgdg 2024-02-06 09:40:52.945 DEBUG (MainThread) [custom_components.danfoss_ally.binary_sensor] Loading new binary_sensor data for device bf1ea44f44ab8e2745xboz 2024-02-06 09:40:52.945 DEBUG (MainThread) [custom_components.danfoss_ally.binary_sensor] Loading new binary_sensor data for device bf4b8c17753602a162kaze 2024-02-06 09:40:52.946 DEBUG (MainThread) [custom_components.danfoss_ally.binary_sensor] Loading new binary_sensor data for device bf4b8c17753602a162kaze 2024-02-06 09:40:52.946 DEBUG (MainThread) [custom_components.danfoss_ally.sensor] Loading new sensor data for Ally Sensor for device bf4b8c17753602a162kaze 2024-02-06 09:40:52.947 DEBUG (MainThread) [custom_components.danfoss_ally.sensor] Loading new sensor data for Ally Sensor for device bf4b8c17753602a162kaze 2024-02-06 09:40:52.947 DEBUG (MainThread) [custom_components.danfoss_ally.climate] Loading new climate data for device bf4b8c17753602a162kaze