Open eokgnah opened 3 years ago
Hi @eokgnah, I don't own a Tado AC so have never been able to test the module with it, it is all based on what others have said. Are you able to go to https://app.tado.com on a desktop (Chrome and Firefox work, not sure about Edge or Safari) and bring up the developer console (F12), then on the network tab you should be able to see all of the API calls that the app is making. If you could perform the actions there and send through the endpoint and JSON payload that is being POSTed that would be great, then I can update the underlying library if needs be. Thanks, Matt
with "get zones capabilities i get":
{"type":"AIR_CONDITIONING","COOL":{"temperatures":{"celsius":{"min":16,"max":31,"step":1},"fahrenheit":{"min":61,"max":88,"step":1}},"fanLevel":["LEVEL1","LEVEL2","LEVEL3","AUTO"],"verticalSwing":["OFF","ON"],"horizontalSwing":["OFF","ON"],"light":["OFF","ON"]},"HEAT":{"temperatures":{"celsius":{"min":16,"max":31,"step":1},"fahrenheit":{"min":61,"max":88,"step":1}},"fanLevel":["LEVEL1","LEVEL2","LEVEL3","AUTO"],"verticalSwing":["OFF","ON"],"horizontalSwing":["OFF","ON"],"light":["OFF","ON"]},"DRY":{"verticalSwing":["OFF","ON"],"horizontalSwing":["OFF","ON"],"light":["OFF","ON"]},"FAN":{"fanLevel":["LEVEL1","LEVEL2","LEVEL3"],"verticalSwing":["OFF","ON"],"horizontalSwing":["OFF","ON"],"light":["OFF","ON"]},"AUTO":{"temperatures":{"celsius":{"min":16,"max":31,"step":1},"fahrenheit":{"min":61,"max":88,"step":1}},"fanLevel":["LEVEL1","LEVEL2","LEVEL3","AUTO"],"verticalSwing":["OFF","ON"],"horizontalSwing":["OFF","ON"],"light":["OFF","ON"]},"initialStates":{"mode":"COOL","modes":{"COOL":{"temperature":{"celsius":24,"fahrenheit":75},"fanLevel":"LEVEL2","verticalSwing":"OFF","horizontalSwing":"OFF"},"HEAT":{"temperature":{"celsius":24,"fahrenheit":75},"fanLevel":"LEVEL2","verticalSwing":"OFF","horizontalSwing":"OFF"},"DRY":{"verticalSwing":"OFF","horizontalSwing":"OFF"},"FAN":{"fanLevel":"LEVEL2","verticalSwing":"OFF","horizontalSwing":"OFF"},"AUTO":{"temperature":{"celsius":24,"fahrenheit":75},"fanLevel":"LEVEL2","verticalSwing":"OFF","horizontalSwing":"OFF"}},"light":"ON"}}
the tado i use is: Smart AC Control V3+ model: WR02
The requested "overlay" payload while switching ON is (raw data):
{"termination":{"typeSkillBasedApp":"TIMER","durationInSeconds":3600},"setting":{"type":"AIR_CONDITIONING","power":"ON","mode":"HEAT","fanLevel":"LEVEL1","verticalSwing":"OFF","horizontalSwing":"OFF","light":"OFF","temperature":{"celsius":24,"fahrenheit":75.2}}}
PM me if you need remote access to test further.
If i try to set the values by hand, all data is taken from the input, but ON is changed to OFF. Clueless?
Hi, thanks for all the hard work yesterday. I think your comments have helped quite a lot. It looks as though Tado have introduced some new fields and also changed fanSpeed
to fanLevel
which I think is your issue. I've tweaked the underlying library, and as part of another PR added the missing fields. This isn't in NodeRed yet because I need to do some more testing on the new functionality. If you're up for it then the PR is here. Thanks
I exchanged the 4 files and restarted node red. But it does still the same as before. Im not familiar with nodered modifications on this level, so i think i have to wait for the official way. Anyhow thanks for the fast feedback and possible fix. If i can help with further AC things (i might not think about myself at the moment), pls let me know.
Hi Matt, is there a planned timeline when the updated library can be expected in nodered?
Hi Matt, can I provide any help in making the patch happen? I tried to manually change the files in the pull request, but as node-tado-client master is 17 pull requests in advance of the 0.10.beta branch, I was not able to integrate the changes on my local node-red (or maybe I screwed up the editing ;-) ). Unfortunatly I only own the AC Control V3 of Tado, so I will not be able to test against the other components, nevertheless let me know if I can help.
Update: What I have been able to do in the meantime is to have node-tado-client and node-red-contrib-tado-client cloned into my own repository and integrate the changes of the pull request on the master branch. So far all calls to the API from node red work as expected, but when calling setZoneOverlays I still get errors, most likely as my changes to the node red package are not sufficient. So again, let me know what I can help with.
OK, next thing achieved. Works now if I insert this node as an input with changing the node-tado-client library and the node-red-contrib-tado-client in my repo. If you would like me to post a pull requests for both libraries let me know.
[ { "id": "c884bb5f637cc359", "type": "inject", "z": "f681bd80.14a2a", "name": "Set to 24 Degrees", "props": [ { "p": "topic", "vt": "str" }, { "p": "apiCall", "v": "setZoneOverlays", "vt": "str" }, { "p": "homeId", "v": "961249", "vt": "str" }, { "p": "termination", "v": "MANUAL", "vt": "str" }, { "p": "overlays", "v": "[{\"zone_id\":1,\"power\":\"ON\",\"temperature\":{\"celsius\":24},\"mode\":\"COOL\",\"fanLevel\":\"AUTO\",\"verticalSwing\":\"OFF\",\"horizontalSwing\":\"OFF\",\"light\":\"OFF\"}]", "vt": "json" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "setZoneOverlays", "x": 150, "y": 4540, "wires": [ [ "a906e4a72241e68b" ] ] } ]
Hi @kneip68, thanks for looking into this. I've really been struggling to find the time to test and integrate the changes. The branch on the node-tado-client repo seemed to be working but adding the support for multiple overlays in node-red became quite awkward. If you have a PR then you're more than welcome to submit them. Thanks
Sorry took me so long to answer, work gotten in the way. Will prepare a PR in the next few days.
OK, created the PR in node-tado-client to enable multi overlays as the first step, either we need to create a new branch there so I can reference it in the local PR or (even better ;-) directly integrate it, in which case we might want to only integrate the new methods and not yet declare the old ones deprecated. Let me know once I can proceed here.
I've merged the other PR to master. I haven't pushed a release of the library so we can always go back and decide if deprecating is the right decision before releasing. Should allow you to base this on master from the other repo, then just before we merge and release this I'll release the other repo.
Pull request created, as mentioned not perfect yet but enables basic AC control. Here is a sequence I use for your reference:
[{"id":"6d06b95f84f1051b","type":"comment","z":"f681bd80.14a2a","name":"Klimaanlage","info":"","x":90,"y":4340,"wires":[]},{"id":"ee1bc02b8b06ea94","type":"inject","z":"f681bd80.14a2a","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"300","crontab":"","once":true,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":130,"y":4380,"wires":[["ce3b77da7e0dbd94"]]},{"id":"ce3b77da7e0dbd94","type":"tado","z":"f681bd80.14a2a","configName":"0dc5c0531d493b0f","apiCall":"getZoneState","homeId":"961249","deviceId":"","zoneId":"1","power":"on","temperature":"18","terminationType":"manual","terminationTimeout":900,"fanSpeed":"AUTO","acMode":"AUTO","name":"Get Temperature in Menscave","reportDate":"","presence":"HOME","geoTracking":true,"temperatureOffset":0,"windowDetection":true,"windowDetectionTimeout":900,"openWindowMode":true,"timetableId":"","x":350,"y":4380,"wires":[["9370e14966d9ddba","32ef41744293ead8"]]},{"id":"da0d73f37d2ebd90","type":"debug","z":"f681bd80.14a2a","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1950,"y":4500,"wires":[]},{"id":"a1481a00db61e385","type":"switch","z":"f681bd80.14a2a","name":"Temp >= 24 C","property":"payload.sensorDataPoints.insideTemperature.celsius","propertyType":"msg","rules":[{"t":"jsonata_exp","v":"joernHome\tand payload.sensorDataPoints.insideTemperature.celsius >= 24\tand $globalContext(\"OutsideTemp\") >= $globalContext(\"TargetCooliingTemperature\")\t\t","vt":"jsonata"},{"t":"else"}],"checkall":"false","repair":false,"outputs":2,"x":580,"y":4440,"wires":[["0455e6578fa5d82e"],["873f41660e626915"]]},{"id":"0455e6578fa5d82e","type":"switch","z":"f681bd80.14a2a","name":"Temp >= TargetCooliingTemperature + 1","property":"payload.sensorDataPoints.insideTemperature.celsius","propertyType":"msg","rules":[{"t":"gte","v":"$globalContext(\"TargetCooliingTemperature\") + 1\t","vt":"jsonata"},{"t":"else"}],"checkall":"false","repair":false,"outputs":2,"x":840,"y":4420,"wires":[["27afd7937b238753"],["f704dae801e5a055"]]},{"id":"24cb6833d8204508","type":"tado","z":"f681bd80.14a2a","configName":"0dc5c0531d493b0f","apiCall":"setZoneOverlays","homeId":"961249","deviceId":"","zoneId":"1","power":"on","temperature":"","terminationType":"auto","terminationTimeout":900,"fanSpeed":"AUTO","acMode":"COOL","name":"Set Cooling to TargetCooliingTemperature","reportDate":"","presence":"HOME","geoTracking":true,"temperatureOffset":0,"windowDetection":true,"windowDetectionTimeout":900,"openWindowMode":true,"timetableId":"","x":1680,"y":4400,"wires":[["da0d73f37d2ebd90"]]},{"id":"27afd7937b238753","type":"change","z":"f681bd80.14a2a","name":"","rules":[{"t":"set","p":"temperature","pt":"msg","to":"$globalContext(\"TargetCooliingTemperature\") - 1\t","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":1120,"y":4400,"wires":[["eac7febd145a0327","345dbe35fbb42847"]]},{"id":"924d3fda06864131","type":"tado","z":"f681bd80.14a2a","configName":"0dc5c0531d493b0f","apiCall":"clearZoneOverlays","homeId":"961249","deviceId":"","zoneId":"1","power":"on","temperature":"","terminationType":"auto","terminationTimeout":900,"fanSpeed":"AUTO","acMode":"COOL","name":"Clear Overlay","reportDate":"","presence":"HOME","geoTracking":"true","temperatureOffset":0,"windowDetection":"true","windowDetectionTimeout":900,"openWindowMode":"true","timetableId":"","x":1760,"y":4480,"wires":[["da0d73f37d2ebd90"]]},{"id":"f704dae801e5a055","type":"switch","z":"f681bd80.14a2a","name":"Temp < TargetCooliingTemperature?","property":"payload.sensorDataPoints.insideTemperature.celsius","propertyType":"msg","rules":[{"t":"lt","v":"TargetCooliingTemperature","vt":"global"},{"t":"else"}],"checkall":"false","repair":false,"outputs":2,"x":1170,"y":4440,"wires":[["c57ae47014358ff0","f8069373daf06254"],[]]},{"id":"9370e14966d9ddba","type":"link out","z":"f681bd80.14a2a","name":"State AC Dach","mode":"link","links":["fa8e974998f624e8"],"x":535,"y":4380,"wires":[]},{"id":"eac7febd145a0327","type":"within-time-switch","z":"f681bd80.14a2a","name":"WochenTags 06:00h-22:00h","nameInt":"","positionConfig":"671f33c.560c6cc","startTime":"06:00","startTimeType":"entered","startOffset":0,"startOffsetType":"none","startOffsetMultiplier":60000,"endTime":"22:00","endTimeType":"entered","endOffset":0,"endOffsetType":"none","endOffsetMultiplier":60000,"timeRestrictions":0,"timeRestrictionsType":"none","timeDays":"1,2,3,4,5","timeOnlyOddDays":false,"timeOnlyEvenDays":false,"timeOnlyOddWeeks":false,"timeOnlyEvenWeeks":false,"timeMonths":"*","timedatestart":"","timedateend":"","propertyStart":"","propertyStartType":"none","propertyStartCompare":"true","propertyStartThreshold":"","propertyStartThresholdType":"num","startTimeAlt":"","startTimeAltType":"entered","startOffsetAlt":0,"startOffsetAltType":"none","startOffsetAltMultiplier":60000,"propertyEnd":"","propertyEndType":"none","propertyEndCompare":"true","propertyEndThreshold":"","propertyEndThresholdType":"num","endTimeAlt":"","endTimeAltType":"entered","endOffsetAlt":0,"endOffsetAltType":"none","endOffsetAltMultiplier":60000,"withinTimeValue":"true","withinTimeValueType":"msgInput","outOfTimeValue":"false","outOfTimeValueType":"msgInput","tsCompare":"0","x":1360,"y":4360,"wires":[["24cb6833d8204508"],[]]},{"id":"345dbe35fbb42847","type":"within-time-switch","z":"f681bd80.14a2a","name":"WochenEnde 09:00h-22:00h","nameInt":"","positionConfig":"671f33c.560c6cc","startTime":"09:00","startTimeType":"entered","startOffset":0,"startOffsetType":"none","startOffsetMultiplier":60000,"endTime":"22:00","endTimeType":"entered","endOffset":0,"endOffsetType":"none","endOffsetMultiplier":60000,"timeRestrictions":0,"timeRestrictionsType":"none","timeDays":"6,0","timeOnlyOddDays":false,"timeOnlyEvenDays":false,"timeOnlyOddWeeks":false,"timeOnlyEvenWeeks":false,"timeMonths":"*","timedatestart":"","timedateend":"","propertyStart":"","propertyStartType":"none","propertyStartCompare":"true","propertyStartThreshold":"","propertyStartThresholdType":"num","startTimeAlt":"","startTimeAltType":"entered","startOffsetAlt":0,"startOffsetAltType":"none","startOffsetAltMultiplier":60000,"propertyEnd":"","propertyEndType":"none","propertyEndCompare":"true","propertyEndThreshold":"","propertyEndThresholdType":"num","endTimeAlt":"","endTimeAltType":"entered","endOffsetAlt":0,"endOffsetAltType":"none","endOffsetAltMultiplier":60000,"withinTimeValue":"true","withinTimeValueType":"msgInput","outOfTimeValue":"false","outOfTimeValueType":"msgInput","tsCompare":"0","x":1360,"y":4400,"wires":[["24cb6833d8204508"],[]]},{"id":"c57ae47014358ff0","type":"within-time-switch","z":"f681bd80.14a2a","name":"WochenTags 06:15h-23:00h","nameInt":"","positionConfig":"671f33c.560c6cc","startTime":"06:15","startTimeType":"entered","startOffset":0,"startOffsetType":"none","startOffsetMultiplier":60000,"endTime":"23:00","endTimeType":"entered","endOffset":0,"endOffsetType":"none","endOffsetMultiplier":60000,"timeRestrictions":0,"timeRestrictionsType":"none","timeDays":"1,2,3,4,5","timeOnlyOddDays":false,"timeOnlyEvenDays":false,"timeOnlyOddWeeks":false,"timeOnlyEvenWeeks":false,"timeMonths":"*","timedatestart":"","timedateend":"","propertyStart":"","propertyStartType":"none","propertyStartCompare":"true","propertyStartThreshold":"","propertyStartThresholdType":"num","startTimeAlt":"","startTimeAltType":"entered","startOffsetAlt":0,"startOffsetAltType":"none","startOffsetAltMultiplier":60000,"propertyEnd":"","propertyEndType":"none","propertyEndCompare":"true","propertyEndThreshold":"","propertyEndThresholdType":"num","endTimeAlt":"","endTimeAltType":"entered","endOffsetAlt":0,"endOffsetAltType":"none","endOffsetAltMultiplier":60000,"withinTimeValue":"true","withinTimeValueType":"msgInput","outOfTimeValue":"false","outOfTimeValueType":"msgInput","tsCompare":"0","x":1500,"y":4460,"wires":[["924d3fda06864131"],[]]},{"id":"f8069373daf06254","type":"within-time-switch","z":"f681bd80.14a2a","name":"WochenEnde 09:00h-23:00h","nameInt":"","positionConfig":"671f33c.560c6cc","startTime":"09:00","startTimeType":"entered","startOffset":0,"startOffsetType":"none","startOffsetMultiplier":60000,"endTime":"23:00","endTimeType":"entered","endOffset":0,"endOffsetType":"none","endOffsetMultiplier":60000,"timeRestrictions":0,"timeRestrictionsType":"none","timeDays":"6,0","timeOnlyOddDays":false,"timeOnlyEvenDays":false,"timeOnlyOddWeeks":false,"timeOnlyEvenWeeks":false,"timeMonths":"*","timedatestart":"","timedateend":"","propertyStart":"","propertyStartType":"none","propertyStartCompare":"true","propertyStartThreshold":"","propertyStartThresholdType":"num","startTimeAlt":"","startTimeAltType":"entered","startOffsetAlt":0,"startOffsetAltType":"none","startOffsetAltMultiplier":60000,"propertyEnd":"","propertyEndType":"none","propertyEndCompare":"true","propertyEndThreshold":"","propertyEndThresholdType":"num","endTimeAlt":"","endTimeAltType":"entered","endOffsetAlt":0,"endOffsetAltType":"none","endOffsetAltMultiplier":60000,"withinTimeValue":"true","withinTimeValueType":"msgInput","outOfTimeValue":"false","outOfTimeValueType":"msgInput","tsCompare":"0","x":1500,"y":4500,"wires":[["924d3fda06864131"],[]]},{"id":"db579ceff48d5661","type":"inject","z":"f681bd80.14a2a","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":1320,"y":4580,"wires":[["9d74306eab4f2cf5"]]},{"id":"9d74306eab4f2cf5","type":"tado","z":"f681bd80.14a2a","configName":"0dc5c0531d493b0f","apiCall":"getZoneState","homeId":"961249","deviceId":"","zoneId":"1","power":"on","temperature":"18","terminationType":"manual","terminationTimeout":900,"fanSpeed":"AUTO","acMode":"AUTO","name":"Get Temperature in Menscave","reportDate":"","presence":"HOME","geoTracking":"true","temperatureOffset":0,"windowDetection":"true","windowDetectionTimeout":900,"openWindowMode":"true","timetableId":"","x":1590,"y":4580,"wires":[["da0d73f37d2ebd90"]]},{"id":"bd1b78fd3be1f2cf","type":"debug","z":"f681bd80.14a2a","name":"getZoneState","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1080,"y":4600,"wires":[]},{"id":"ecc20e5520f19a08","type":"switch","z":"f681bd80.14a2a","name":"In Auto Mode?","property":"payload.overlay.termination.type","propertyType":"msg","rules":[{"t":"jsonata_exp","v":" $not($exists(payload.overlay.termination.type))\tor payload.overlay.termination.type = \"TADO_MODE\"","vt":"jsonata"},{"t":"else"}],"checkall":"false","repair":false,"outputs":2,"x":400,"y":4440,"wires":[["a1481a00db61e385"],[]]},{"id":"32ef41744293ead8","type":"ccu-get-value","z":"f681bd80.14a2a","name":"Joern Anwesenheit","ccuConfig":"381b5de2.a56da2","iface":"ReGaHSS","channel":"","sysvar":"Anwesenheit.Joern","sysvarProperty":"value","datapoint":"","datapointProperty":"value","setProp":"joernHome","setPropType":"msg","x":210,"y":4440,"wires":[["ecc20e5520f19a08"]]},{"id":"873f41660e626915","type":"switch","z":"f681bd80.14a2a","name":"In Auto and below TargetTemp","property":"payload.sensorDataPoints.insideTemperature.celsius","propertyType":"msg","rules":[{"t":"jsonata_exp","v":"payload.sensorDataPoints.insideTemperature.celsius >= $globalContext(\"TargetCooliingTemperature\")\tand payload.setting.power = \"ON\"\t\t","vt":"jsonata"},{"t":"else"}],"checkall":"false","repair":false,"outputs":2,"x":830,"y":4480,"wires":[["bd1b78fd3be1f2cf"],["bd1b78fd3be1f2cf","c57ae47014358ff0","f8069373daf06254"]]},{"id":"0dc5c0531d493b0f","type":"tado-config","name":"Dällikon"},{"id":"671f33c.560c6cc","type":"position-config","name":"Zuhause","isValide":"true","longitude":"0","latitude":"0","angleType":"deg","timeZoneOffset":"99","timeZoneDST":"0","stateTimeFormat":"3","stateDateFormat":"12"},{"id":"381b5de2.a56da2","type":"ccu-connection","name":"ccu.heipmann.net","host":"ccu.heipmann.net","regaEnabled":true,"bcrfEnabled":true,"iprfEnabled":true,"virtEnabled":false,"bcwiEnabled":false,"cuxdEnabled":false,"regaPoll":true,"regaInterval":"30","rpcPingTimeout":"60","rpcInitAddress":"192.168.99.20","rpcServerHost":"192.168.99.20","rpcBinPort":"2040","rpcXmlPort":"2041","tls":true,"inSecure":true,"authentication":true,"username":"joern","password":"Beutlin","queueTimeout":"5000","queuePause":"250","contextStore":""}]
Ohh and sorry, I am only sending one overlay via the new API Calls, so if we want to have multiple ones that's a heck of a lot more work....
Didn't mean to close this earlier. I'll keep it open until the PRs are merged and we're happy the new AC stuff is working. The multiple overlay GUI stuff is what I was struggling to get working. I found examples elsewhere but could quite get the integrated
Hi, all regarding the AC control.
if the AC is off and i try to start it with "setZoneOverlay" the response is: "Error: Request failed with status code 422"
if i start the AC over the mobile-app on my phone and send the same "setZoneOverlay" again, the AC takes the modified Settings from NodeRed.
I can Stop the AC with "clearZoneOverlay"
But i can not start it.
Trying with: v 0.9.8
Thanks... ...erich