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

[tado] openWindowDetected not available in API response #17558

Closed
eengnr opened this issue Oct 13, 2024 · 6 comments · Fixed by #17576
Closed

[tado] openWindowDetected not available in API response #17558

eengnr opened this issue Oct 13, 2024 · 6 comments · Fixed by #17576
Assignees
Labels
bug An unexpected problem or unintended behavior of an add-on

Comments

@eengnr
Copy link

eengnr commented Oct 13, 2024

Hi, I recently added an item to the "Open Window" channel in the tado° binding. But it keeps staying "OFF".

I checked the API response via the webapp/curl and it seems that the openWindowDetected property does not exist (anymore?). Only the openWindow is there.

This is the API response for .../zones/[id]/state when an open window is detected:

{"tadoMode":"HOME","geolocationOverride":false,"geolocationOverrideDisableTime":null,"preparation":null,"setting":{"type":"HEATING","power":"ON","temperature":{"celsius":20.00,"fahrenheit":68.00}},"overlayType":null,"overlay":null,"openWindow":{"detectedTime":"2024-10-13T12:52:17Z","durationInSeconds":1200,"expiry":"2024-10-13T13:12:17Z","remainingTimeInSeconds":16},"nextScheduleChange":{"start":"2024-10-13T19:40:00Z","setting":{"type":"HEATING","power":"ON","temperature":{"celsius":19.00,"fahrenheit":66.20}}},"nextTimeBlock":{"start":"2024-10-13T19:40:00.000Z"},"link":{"state":"ONLINE"},"runningOfflineSchedule":false,"activityDataPoints":{"heatingPower":{"type":"PERCENTAGE","percentage":0.00,"timestamp":"2024-10-13T12:56:08.950Z"}},"sensorDataPoints":{"insideTemperature":{"celsius":21.29,"fahrenheit":70.32,"timestamp":"2024-10-13T13:09:14.082Z","type":"TEMPERATURE","precision":{"celsius":0.1,"fahrenheit":0.1}},"humidity":{"type":"PERCENTAGE","percentage":70.50,"timestamp":"2024-10-13T13:09:14.082Z"}}}

And this if no open window is detected:

{"tadoMode":"HOME","geolocationOverride":false,"geolocationOverrideDisableTime":null,"preparation":null,"setting":{"type":"HEATING","power":"ON","temperature":{"celsius":20.50,"fahrenheit":68.90}},"overlayType":null,"overlay":null,"openWindow":null,"nextScheduleChange":{"start":"2024-10-13T17:30:00Z","setting":{"type":"HEATING","power":"ON","temperature":{"celsius":19.00,"fahrenheit":66.20}}},"nextTimeBlock":{"start":"2024-10-13T17:30:00.000Z"},"link":{"state":"ONLINE"},"runningOfflineSchedule":false,"activityDataPoints":{"heatingPower":{"type":"PERCENTAGE","percentage":0.00,"timestamp":"2024-10-13T13:10:24.641Z"}},"sensorDataPoints":{"insideTemperature":{"celsius":21.04,"fahrenheit":69.87,"timestamp":"2024-10-13T13:06:26.743Z","type":"TEMPERATURE","precision":{"celsius":0.1,"fahrenheit":0.1}},"humidity":{"type":"PERCENTAGE","percentage":74.80,"timestamp":"2024-10-13T13:06:26.743Z"}}}

Only openWindow is available in both cases.

Environment

  • Version used: (e.g., openHAB and add-on versions): 4.2.1 release build
  • Operating System and version (desktop or mobile, Windows 10, Raspbian Buster, ...): Openhabian Bookworm

Perhaps this needs to be corrected in the binding? Thanks!

@eengnr eengnr added the bug An unexpected problem or unintended behavior of an add-on label Oct 13, 2024
@andrewfg andrewfg self-assigned this Oct 14, 2024
@andrewfg
Copy link
Contributor

Ok. I will have a look at it.

@andrewfg
Copy link
Contributor

@eengnr thank you for posting your JSON results.

it seems that the openWindowDetected property does not exist (anymore?). Only the openWindow is there.

Hmm. The tado API supports two different JSON properties -- namely openWindow and openWindowDetected as you can see from the DTO below.

public class ZoneState {
..
    @SerializedName("openWindow")
    private OpenWindow openWindow = null;

    @SerializedName("openWindowDetected")
    private Boolean openWindowDetected = null;

On my system, when the window is opened, the openWindowDetected JSON element is triggered (see JSON example below), and I do NOT see an openWindow JSON element like what you show in your logs. So before making any changes to the binding we need to fully understand the origin of the JSON that you posted.

First, for general understanding: what devices do you have?

In my understanding openWindowDetected relates to the actual window open detection state whereas openWindow relates to the (eventual) activation of the heating/cooling override function. So IMHO openWindowDetected is indeed the correct element for updating the open window channel.

However we may perhaps debate whether we should (also) add a separate channel for the "open window heating/cooling override activated" function, which might depend on the openWindow JSON element. => WDYT?

{
  "tadoMode": "HOME",
  "geolocationOverride": false,
  "overlay": {
    "setting": {
      "power": "ON",
      "temperature": {
        "celsius": 25.0,
        "fahrenheit": 77.0
      },
      "type": "HEATING"
    },
    "termination": {
      "durationInSeconds": 1800,
      "expiry": "2024-10-15T17:00:00Z",
      "remainingTimeInSeconds": 5013,
      "type": "TIMER",
      "projectedExpiry": "2024-10-15T17:00:00Z"
    }
  },
  "setting": {
    "power": "ON",
    "temperature": {
      "celsius": 25.0,
      "fahrenheit": 77.0
    },
    "type": "HEATING"
  },
  "openWindowDetected": true,
  "link": {
    "state": "ONLINE"
  },
  "activityDataPoints": {
    "heatingPower": {
      "timestamp": "2024-10-15T15:34:49.187Z",
      "percentage": 100.0
    }
  }

@eengnr
Copy link
Author

eengnr commented Oct 15, 2024

Ok, this is interesting, thanks for checking it!

I have the V3 bridge with the "included" subscription, i.e. my thermostats turn off when the open window is detected.
So you're right, the openWindow shows that the heating was temporarily set off.

A seperate channel with this information would be nice as well! And I think it's enough to either have it as ON/OFF or to have the expiry time in case it is set.

@andrewfg
Copy link
Contributor

enough to either have it as ON/OFF or to have the expiry time in case it is set

Probably the channel should supply a numerical duration in seconds (quantity type). The user can link either/both Number:Time resp. Switch items to that channel; and OH will automagically display zero seconds as OFF resp. any other time as ON.

@andrewfg
Copy link
Contributor

@eengnr did you have a chance to look at #17576 yet?

@eengnr
Copy link
Author

eengnr commented Oct 18, 2024

@eengnr did you have a chance to look at #17576 yet?

@andrewfg Yes thanks! Sorry, I forgot to answer! I installed the snapshot yesterday and the channel appeared! Now I just need to wait until it's cold enough 😊 I'll give an update then.

@andrewfg andrewfg changed the title [tado°] openWindowDetected not available in API response [tado] openWindowDetected not available in API response Oct 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An unexpected problem or unintended behavior of an add-on
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants