mattdavis90 / node-red-contrib-tado-client

Tado web API client node for Node Red
MIT License
20 stars 16 forks source link

fanSpeed is ignored for FAN mode #60

Open illuzn opened 6 months ago

illuzn commented 6 months ago

msg.fanSpeed is working for me for cool and heat modes.

However bizzarely, it doesn't seem to work if the mode is set to fan (regardless of whether directly in the setZoneOverlay node itself or by trying to override it using msg.fanSpeed). No matter what is set it seems to always default to LEVEL2 - I know this is the result if fanLevel isn't sent at all (this is the same behaviour Home Assistant has).

I'm using this because the Home Assistant Tado integration doesn't support fan levels at the moment (and when I turn my AC on I want it full blast).

example flow

[{"id":"85f32f499ff95257","type":"tado","z":"76a26e6e895feb58","configName":"6af782bb95bda1bd","apiCall":"getZoneOverlay","homeId":"000000","acMode":"AUTO","childlock":false,"deviceId":"","fanSpeed":"AUTO","geoTracking":true,"name":"","openWindowMode":true,"power":"on","presence":"HOME","reading":0,"readingDate":"","readingId":"","reportDate":"","startDate":"","endDate":"","tariffId":"","tariffInCents":0,"temperature":"18","temperatureOffset":0,"terminationTimeout":900,"terminationType":"manual","timetableId":"","unit":"m3","windowDetection":true,"windowDetectionTimeout":900,"zoneId":"1","x":500,"y":580,"wires":[["2e957d49e529f28c"]]},{"id":"ef2bda88ba01c1eb","type":"server-state-changed","z":"76a26e6e895feb58","name":"Air Conditioning Changes","server":"f1028730287dd073","version":5,"outputs":2,"exposeAsEntityConfig":"","entityId":"climate.air_conditioning","entityIdType":"exact","outputInitially":false,"stateType":"str","ifState":"off","ifStateType":"str","ifStateOperator":"is_not","outputOnlyOnStateChange":true,"for":"0","forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"}],"x":230,"y":580,"wires":[["85f32f499ff95257"],[]]},{"id":"eda670e476148e00","type":"tado","z":"76a26e6e895feb58","configName":"6af782bb95bda1bd","apiCall":"setZoneOverlay","homeId":"000000","acMode":"COOL","childlock":false,"deviceId":"","fanSpeed":"LEVEL3","geoTracking":true,"name":"","openWindowMode":true,"power":"on","presence":"HOME","reading":0,"readingDate":"","readingId":"","reportDate":"","startDate":"","endDate":"","tariffId":"","tariffInCents":0,"temperature":"","temperatureOffset":0,"terminationTimeout":900,"terminationType":"manual","timetableId":"","unit":"m3","windowDetection":true,"windowDetectionTimeout":900,"zoneId":"2","x":980,"y":580,"wires":[[]]},{"id":"2e957d49e529f28c","type":"change","z":"76a26e6e895feb58","name":"Rewrite settings","rules":[{"t":"move","p":"payload.setting","pt":"msg","to":"setting","tot":"msg"},{"t":"delete","p":"payload","pt":"msg"},{"t":"set","p":"temperature","pt":"msg","to":"setting.temperature.celsius","tot":"msg"},{"t":"set","p":"acMode","pt":"msg","to":"setting.mode","tot":"msg"},{"t":"set","p":"fanSpeed","pt":"msg","to":"LEVEL3","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":740,"y":580,"wires":[["eda670e476148e00"]]},{"id":"6af782bb95bda1bd","type":"tado-config","name":"Home"}]

Edit: In case it wasn't obvious node-red-contrib-tado-client 0.10.10 Node-RED v 3.1.0

mattdavis90 commented 6 months ago

Thanks for raising this. I don't have an AC so can't try out your flow. It looks as though it should work though.

Are you able to set this as an overlay in the App or on app.tado.com? If you are then would you be able to capture the API call in your web browser. You can do this using developer tools in Firefox or Chrome - happy to talk you through it and help out. When you set the overlay you should see a network PUT request to something like "https://my.tado.com/api/v2/homes/123123/zones/1/overlay" - it is the payload of that request that I'd like to see if possible.

illuzn commented 6 months ago

Okay so in Query String Paramaters:

ngsw-bypass: true

And in Request Payload:

{
    "termination": {
        "typeSkillBasedApp": "MANUAL"
    },
    "setting": {
        "fanLevel": "LEVEL3",
        "verticalSwing": "OFF",
        "mode": "FAN",
        "type": "AIR_CONDITIONING",
        "power": "ON"
    }
}

I've looked at the javascript code and this should already work. That said I have no idea why it doesn't and I'm terrible at javascript so there's probably something I'm missing.

mattdavis90 commented 1 month ago

Hi, I'm finally tidying up some of the open issues, apologies this has been open so long. There have been a number of updates to the undlerying library since v0.10.10 (it went from v0.13.8 to v0.14.3) when you previously tested - has the issue been resolved? Thanks

illuzn commented 3 weeks ago

Do I need to update anything to get the updated library?

mattdavis90 commented 3 weeks ago

You can find the update in the Node-RED palette. The latest release is v0.10.11. If you're able and happy to though you can test the bleeding edge version which I'm currently updating to handle AC a lot better. Instructions to install can be found in this issue along with the current testing results https://github.com/mattdavis90/node-red-contrib-tado-client/issues/66#issuecomment-2144022335

illuzn commented 1 week ago

Not working with v0.11

I'm pulling my hair out myself because looking at the code it should just work.

Edit: that said my knowledge of NodeJS is pretty poor

mattdavis90 commented 6 days ago

I gave your original flow another read and still don't understand why this isn't working for you. I'll try to have another look this weekend.