Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Paused thermostats shown as heating #12

Closed
maverick-79 opened this issue Jan 27, 2022 · 3 comments · Fixed by #14
Closed

Paused thermostats shown as heating #12

maverick-79 opened this issue Jan 27, 2022 · 3 comments · Fixed by #14
Labels
enhancement Enhancement of the integration

Comments

@maverick-79
Copy link

Hi there,

It seems that thermostats which have been paused in the Danfoss app are shown as heating in HA.

The API returns the following, with the mode being shown as pause

{
  "result": {
    "active_time": 1613145159,
    "create_time": 1613145159,
    "id": <id>,
    "name": "Bad",
    "online": true,
    "status": [
      {
        "code": "switch",
        "value": true
      },
      {
        "code": "mode",
        "value": "pause"
      },
      {
        "code": "temp_set",
        "value": 220
      },
      {
        "code": "upper_temp",
        "value": 250
      },
      {
        "code": "temp_current",
        "value": 166
      },
      {
        "code": "window_state",
        "value": "close"
      },
      {
        "code": "lower_temp",
        "value": 60
      },
      {
        "code": "child_lock",
        "value": true
      },
      {
        "code": "battery_percentage",
        "value": 81
      },
      {
        "code": "factory_reset",
        "value": false
      },
      {
        "code": "fault",
        "value": 0
      }
    ],
    "sub": true,
    "time_zone": "+08:00",
    "update_time": 1639959199,
    "device_type": "Danfoss Ally™ Radiator Thermostat"
  },
  "t": 1643277875654
}

The same device is shown as having the following state attributes in HA, hvac_action being heating instead of paused:

hvac_modes:
  - heat
min_temp: 6
max_temp: 25
target_temp_step: 0.5
current_temperature: 16.5
temperature: 22
hvac_action: heating
friendly_name: Bad
supported_features: 1

I guess the mode information is ignored in HA and heating is taken as default hvac_action based on the temperature difference?
In addition, would be great to be able to change mode directly from within HA (values seem to be paused, at_home and leaving_home).

@simonengelhardt
Copy link
Contributor

As I read the docs, there is actually no HVAC action type that maps to the pause mode in Danfoss terms. pause actually means that the thermostat is still set to heat, but that the target temperature is just very low (5 ℃ by default), so it doesn't feel like we should be mapping it to the idle or off actions either.

I do think pause fits with a custom preset mode, which we are allowed to add 😃, so I would propose mapping to something we call PRESET_PAUSE.

Finally, I also think HVAC mode should be set to HVAC_MODE_AUTO when the Danfoss mode is either at_home or leaving_home and HVAC_MODE_HEAT when Danfoss mode is manual (that's also a possible value).

I'll make a PR for this.

Unfortunately, the Danfoss API does not seem to return the correct temp_set when set to a schedule or paused. At least in my tests it looks like it is just stuck at whatever temp I had it set to when it was last in manual mode. It's a shame, since it does show the set temperature correctly in their mobile app. I guess we can only hope that they fix that.

I have not looked into setting mode/preset, but suggest splitting that to a separate issue.

@MTrab
Copy link
Owner

MTrab commented Feb 16, 2022

I've been looking at setting the mode, and it doesn't seem like the API will handle the request.
Currently trying to get Danfoss' take on this (not that I expect that to happen, as the are slower than slow)

@MTrab MTrab added the enhancement Enhancement of the integration label Feb 16, 2022
@simonengelhardt
Copy link
Contributor

I've been looking at setting the mode, and it doesn't seem like the API will handle the request. Currently trying to get Danfoss' take on this (not that I expect that to happen, as the are slower than slow)

@MTrab If you do get through to them, it would be great if you could also mention the temp_set issue. It's a shame if they are not more helpful towards hobbyist developers, but I guess having a noreply email address and this phrase in the API docs sums up their approach to it:

Unless you have a formal partnership with Danfoss we do not offer support on the cloud integration at the 3rd party side of the integration. Domestic privately developed solutions are not supported by Danfoss.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhancement of the integration
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants