Playing with your API and getting a 403 error

Hi there,

I am trying to implement my own open window detection system as I have in my home on each window a sensor that tells me whether the window is open or not. My idea is that as soon as the window is open, I call the tado api to tell the related radiator valve to set itself in "open window" mode.

I have seen that using this endpoint /api/v2/homes/<home_id>/zones/<zone_id>/state, I can get the attribute openWindow which I believe gives me the information whether the zone is in a "open window" mode or not. I was expecting to be able to send a PATCH request on the same endpoint but when I do I get a 403 error with the following message : "current user is not allowed to access this resource".

Would it be possible to open the api ?

Thanks a lot in advance.

Best Answer

  • GrilledCheese2
    GrilledCheese2 ✭✭✭
    Answer ✓

    My mistake, I misunderstood what you were trying to do. I guess as a workaround you can force the room to manual mode for a fixed duration. Obviously you’ll lose visibility in the app for why the mode change was triggered.

Answers

  • Try this:

    PUT https://my.tado.com/api/v2/homes/<homeid>/zones/<zoneid>/openWindowDetection

    With the payload:

    {

         enabled: true/false,

         timeoutInSeconds: seconds 0-3600

    }

  • Thanks for your reply GrilledCheese2, but this endpoint is to actually change the setting whether you want to enable or not the window detection feature on the zone, in other words letting the valve/thermostat or not to detect automatically if a window has been opened or not.

  • That's what I ended up doing, it works pretty well but as you said you lose the visibility in the app or the valve it has been shut off because if an opened window. Thanks anyway for your time :)