mattdavis90 / node-red-contrib-tado-client

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

support Air Conditioning tado devices #37

Closed ph0b closed 3 years ago

ph0b commented 3 years ago

Hi,

I wasn't able to set an overlay on AC devices. The node fails with a 422 error. if you're interested in improving AC devices support, the json below works when calling /api/v2/homes/****/zones/****/overlay: {"termination":{"typeSkillBasedApp":"TIMER","durationInSeconds":3600},"setting":{"temperature":{"celsius":22,"fahrenheit":71.6},"mode":"COOL","type":"AIR_CONDITIONING","power":"ON","fanSpeed":"LOW"}}

mattdavis90 commented 3 years ago

Thanks @ph0b I'll have a look at implementing this but I don't have an AC device to test with. Are you able to create a PR or would you be able to test if I push to a branch?

ph0b commented 3 years ago

great! I don't have other devices nor I'm familiar with node js at the moment so I don't intend to work on a PR but yes I'll test if you push a branch.

mattdavis90 commented 3 years ago

@ph0b I realised there was an issue with overrides in general as Tado seem to have changed their API slightly with the introduction of Skills in the App - overrides aren't something I personally use. I've updated the underlying library to fix how they work and published an v0.9.7 version of the nodered library as well. Hopefully this fixes your issue, but if not then please let me know. Thanks

ph0b commented 3 years ago

Thanks for the update. I just tried and got the same "Error: Request failed with status code 422" as previously.

mattdavis90 commented 3 years ago

That's slightly upsetting. Are you able to test with the underlying library (https://github.com/mattdavis90/node-tado-client)? It would be good to see if there is any readout on what isn't working.

ph0b commented 3 years ago

yes, I've just tried. I can use apiCall with the json I've provided. All the settings (fanSpeed, type, mode) have to be correctly set, if I remove any of these I get the same 422 error as with your setZoneOverlay method.

mattdavis90 commented 3 years ago

Aha, looks like I need to add fan_speed to this repo. I added it as an option in node-tado-client so you should hopefully be able to set an overlay using the setZoneOverlay option and passing in a fan_speed as the last argument. Do you know the options for fanSpeed? Is it safe to assume LOW, MEDIUM, HIGH? Thanks

ph0b commented 3 years ago

almost ! I see AUTO/LOW/MIDDLE/HIGH

mattdavis90 commented 3 years ago

I've pushed a version to the feature/ac-overlay branch for you to have a try. If it works then I'll merge into a release :)

ph0b commented 3 years ago

UI to select fan speed shows up correctly but I get 422 as well, maybe now it's missing "mode":"COOL" and "type":"AIR_CONDITIONING" ?

mattdavis90 commented 3 years ago

Doh, I totally missed you mentioning mode in both of your messages. Apologies. Do you know what options are available for mode?

ph0b commented 3 years ago

well, on my end, I only have AIR_CONDITIONING :) if I do getZoneCapabilities, it can do AUTO, COOL, DRY, FAN, HEAT.

AUTO, DRY, FAN get no parameters while HEAT and COOL get temperature and fanSpeeds.

mattdavis90 commented 3 years ago

I'll get this added to the other library then into here. Thanks

mattdavis90 commented 3 years ago

I've pushed up the code changes. Are you able to do a quick test of https://github.com/mattdavis90/node-tado-client/tree/feature/ac with the setZoneOverlay call. Hopefully it is working if you do something like setZoneOverlay(home_id, zone_id, 'on', 22, 3600, 'low', 'cool');

ph0b commented 3 years ago

great, it works!

mattdavis90 commented 3 years ago

I've pushed a new version onto the branch. It should install the latest library and then hopefully AC Mode will appear and work within Nodered

ph0b commented 3 years ago

Awesome, I'll check and report back on Monday

ph0b commented 3 years ago

I've tried the branch and it worked perfectly, no '422' error anymore, thanks!

mattdavis90 commented 3 years ago

v0.9.8 is now released with support for AC units as tested on the branch. I've updated nodered database so it should be ready to install shortly. I'll close this thread in a couple days unless there is anything else. Thanks :)