Closed nicktmro closed 7 years ago
@nicktmro seems like your tado set your air conditioner to an auto state. Unfortunately the plugin does not support auto state on the air conditioner Since the homekit support only those conditions (OFF, HEAT, COOL, AUTO), I set the auto to support Tado auto mode and not the aircon auto mode since not everyone has that state in their air conditioner.
Please change your aircon to cool or heat mode (that will return the temperature) and it should solve your problem, let me know how it goes.
Thanks for the quick reply. I changed to "HEAT" and now I'm getting this:
/usr/local/lib/node_modules/homebridge-tado/index.js:301
accessory.log("Room temperature is " + obj.sensorDataPoints.insideTemperature.celsius + "ºC");
^
TypeError: Cannot read property 'insideTemperature' of undefined
at IncomingMessage.<anonymous> (/usr/local/lib/node_modules/homebridge-tado/index.js:301:76)
at emitNone (events.js:91:20)
at IncomingMessage.emit (events.js:185:7)
at endReadableNT (_stream_readable.js:974:12)
at _combinedTickCallback (internal/process/next_tick.js:74:11)
at process._tickCallback (internal/process/next_tick.js:98:9)
and in the browser:
{
"tadoMode": "HOME",
"geolocationOverride": true,
"geolocationOverrideDisableTime": "2017-01-23T16:45:00Z",
"preparation": null,
"setting": {
"type": "AIR_CONDITIONING",
"power": "ON",
"mode": "HEAT",
"temperature": {
"celsius": 21,
"fahrenheit": 69.8
},
"fanSpeed": "LOW"
},
"overlayType": "MANUAL",
"overlay": {
"type": "MANUAL",
"setting": {
"type": "AIR_CONDITIONING",
"power": "ON",
"mode": "HEAT",
"temperature": {
"celsius": 21,
"fahrenheit": 69.8
},
"fanSpeed": "LOW"
},
"termination": {
"type": "TADO_MODE",
"projectedExpiry": "2017-01-23T16:45:00Z"
}
},
"link": {
"state": "ONLINE"
},
"activityDataPoints": {},
"sensorDataPoints": {
"insideTemperature": {
"celsius": 22.92,
"fahrenheit": 73.26,
"timestamp": "2017-01-23T09:06:05.094Z",
"type": "TEMPERATURE",
"precision": {
"celsius": 0.1,
"fahrenheit": 0.1
}
},
"humidity": {
"type": "PERCENTAGE",
"percentage": 56.5,
"timestamp": "2017-01-23T09:06:05.094Z"
}
}
}
Hope this helps
FWIW, I don't have a username
for Tado. I can only log in by using my email address + password combo, so that's what I put in my config.
username is your email
can you show me your config? hide your personal details of course
Sure thing.
{
"accessory":"TADO",
"name":"Tado",
"homeID":"55555",
"username":"my@email.com",
"password":"my_password",
"useFahrenheit":false
}
there is a new config... try updating your config according to the new one (explanations are in README.md)
Thanks. I cannot seem to find what I'm doing wrong in the config. I added the fields below but still, no luck.
{
"accessory":"TADO",
"name":"Tado",
"homeID":"55555",
"username":"my@email.com",
"password":"my_password",
"useFahrenheit":false,
"maxValue": 31,
"minValue": 16,
"zone": 1,
"useFanSpeed": "AUTO",
"useSwing": false
}
I'm also in the homebridgeteam slack if it helps with the comms.
try installing that:
sudo npm install -g https://github.com/ckuburlis/homebridge-tado.git#Test
I want to see your console afterwards.
that should print the object before and after the parsing.
[ { code: 'accessDenied',
title: 'current user is not allowed to access home <redacated 5 digit number> } ] }
Hmmm... Looks like the login is the issue.
are you sure your username and password are correct? how about the homeID? sure it's correct?
Trying the old api to check the HomeID doesn't work. Is there another way? It looks like they removed it from the JSON response I used to look at...
The username / pwd are definitely correct.
I currently grab it from the URL: https://my.tado.com/api/v2/homes/55555/zones/1/state
. I swapped my id with 55555
it does work for me so there is probably something wrong with your credential or the way you are making the request. when I call: https://my.tado.com/mobile/1.4/getCurrentState?username=ACTUAL_USERNAME&password=ACTUAL_PASSWORD
I get the HomeId perfectly.
don't you add your credentials to your request? - "?username=ACTUAL_USERNAME&password=ACTUAL_PASSWORD"
try to login to your account through the web, in tado website, see if you can do that: https://www.tado.com/login
If I use Chrome to make the request above I get:
{
"success":true,
"operation":"HOME",
"autoOperation":"UNDEFINED",
"operationTrigger":"USER",
"insideTemp":null,
"setPointTemp":null,
"controlPhase":"UNDEFINED",
"boxConnected":false,
"gwConnected":false,
"tsConnected":false,
"currentUserPrivacyEnabled":false,
"currentUserGeoStale":false,
"deviceUpdating":false,
"homeId":55555,
"pendingDeviceInstallation":false
}
Safari just errors with
{"errors":[{"code":"unauthorized","title":"Invalid referrer"}]}
I know whats the problem!!!!!! I think! remove the "" from your homeId! should solve it
I just tried removing the quotes. I got the same
[1/23/2017, 10:44:54 PM] [Tado] { errors:
[ { code: 'accessDenied',
title: 'current user is not allowed to access home 55555' } ] }
can you call this? https://my.tado.com/api/v2/homes/55555/zones/1/state?username=ACTUAL_USERNAME&password=ACTUAL_PASSWORD
with your user details in the url?
UPDATED:
{"errors":[{"code":"accessDenied","title":"current user is not allowed to access home 55555"}]}
You may be onto something though: we have two users registered to connect to the Tado so maybe that's part of the problem...
so how did you bring the state earlier in the reply?
I cannot get the state via the v2 api. I'm given the access denied error.
It does work with the https://my.tado.com/mobile/1.4/getCurrentState?username=ACTUAL_USERNAME&password=ACTUAL_PASSWORD
version.
are you able to connect to your tado account from the web? maybe you need to update your device, it is weird that only v2 makes you issues, when on my side it works great.
I'm able to connect via the web and I can also make changes that get applied correctly.
Maybe relevant: I noticed in my browser that they use refresh tokens.
{
"access_token": "REDACTED",
"token_type": "bearer",
"refresh_token": "REDACTED",
"expires_in": 599,
"scope": "home.user"
}
Regarding the "update" part, here's what I have (redacted serial):
Smart AC Control
"deviceType": "WR01",
"serialNo": "WR1234123412",
"shortSerialNo": "WR1234123412",
"currentFwVersion": "26.3",
I know they use tokens but getting permissions through the url is still valid, and unless I get more complains about error login that way I'm not sure the solution will be to change the authorization method.
is it possible that you are participating in Tado beta program?
I didn't register for the beta program...
This request does return correctly.
REQUEST:
curl -s "https://my.tado.com/oauth/token" -d client_id=tado-webapp -d grant_type=password -d password=my_password -d scope=home.user -d username=my@email.com
RESPONSE:
{
"access_token":"REDACTED",
"token_type":"bearer",
"refresh_token":"12345678-f128-41b1-9046-9199af9311c7",
"expires_in":599,
"scope":"home.user"
}
By the way, I found this blog post to be useful: http://blog.scphillips.com/posts/2017/01/the-tado-api-v2/
I'm aware of this blog...
when I look at your results I actually see that you are using more advanced version of the device than me. might be the reason why mine is still working in the old way.... though I don't know how to update it to your version since it's automatically updating anyway. my version returns:
deviceType: "WR01",
serialNo: "WR1505FT01001359151360",
shortSerialNo: "WR1359151360",
currentFwVersion: "22.13",
Thanks for looking into this @nitaybz
I'm thinking that the more Tados people buy, the more likely it is that you will see requests like mine :(
If I knew more about Node, I'd look into sending you a pull request using https://www.npmjs.com/package/refresh-token
but I'm not a JavaScript dev...
I will fix it... give me some time and I will change the way it works for the new version... hope it will be sooner than later
Thank you. Please get in touch if you need me to help with testing. I'm available via the homebridge Slack, as well.
I'm not there... how do I get there?
@nicktmro I tried to update the authorization method to the new one but I don't have a way to look if it works today. I only changed the get current state/temperature for now, if you see that it can update the status i will also implement it on the 'Set' option (set temperature/mode).
you can try this version here:
sudo npm install -g https://github.com/ckuburlis/homebridge-tado.git#Test
Let me know how it goes
Thanks @nitaybz
I installed the Test branch, and this is what I see:
[1/24/2017, 7:19:28 AM] [Tado] New Token is <TOKEN1>
[1/24/2017, 7:19:32 AM] [Tado] Getting target state
[1/24/2017, 7:19:32 AM] [Tado] check header: Bearer <TOKEN1>
[1/24/2017, 7:19:32 AM] [Tado] Getting target state
[1/24/2017, 7:19:32 AM] [Tado] check header: Bearer <TOKEN1>
[1/24/2017, 7:19:32 AM] [Tado] Getting target state
[1/24/2017, 7:19:32 AM] [Tado] check header: Bearer <TOKEN1>
[1/24/2017, 7:19:32 AM] [Tado] Getting target state
[1/24/2017, 7:19:32 AM] [Tado] check header: Bearer <TOKEN1>
[1/24/2017, 7:19:32 AM] [Tado] The current temperature display unit is ºC
[1/24/2017, 7:19:33 AM] [Tado] {"errors":[{"code":"accessDenied","title":"current user is not allowed to access home 55555"}]}
[1/24/2017, 7:19:33 AM] [Tado] { errors:
[ { code: 'accessDenied',
title: 'current user is not allowed to access home 55555' } ] }
/usr/local/lib/node_modules/homebridge-tado/index.js:334
accessory.log("Room temperature is " + obj.sensorDataPoints.insideTemperature.celsius + "ºC");
TypeError: Cannot read property 'insideTemperature' of undefined
at IncomingMessage.<anonymous> (/usr/local/lib/node_modules/homebridge-tado/index.js:334:76)
at emitNone (events.js:91:20)
at IncomingMessage.emit (events.js:185:7)
at endReadableNT (_stream_readable.js:974:12)
at _combinedTickCallback (internal/process/next_tick.js:74:11)
at process._tickCallback (internal/process/next_tick.js:98:9)
The tokens appear to be correct... somehow the API calls don't seem to use them, maybe?
The errors seem to happen in a few places (whichever callback gets made first) when I restart home bridge:
Please try to install again... I tried a different way to save the token.
I updated to the latest Test branch and re-run:
[1/24/2017, 11:05:37 AM] [Tado] Getting target state
[1/24/2017, 11:05:37 AM] [Tado] check header: Bearer <TOKEN REDACTED>
/usr/local/lib/node_modules/homebridge-tado/index.js:214
if (obj.setting.temperature != null) {
^
TypeError: Cannot read property 'temperature' of undefined
at IncomingMessage.<anonymous> (/usr/local/lib/node_modules/homebridge-tado/index.js:214:28)
at emitNone (events.js:91:20)
at IncomingMessage.emit (events.js:185:7)
at endReadableNT (_stream_readable.js:974:12)
at _combinedTickCallback (internal/process/next_tick.js:74:11)
at process._tickCallback (internal/process/next_tick.js:98:9)
The second time I ran homebridge I got:
[1/24/2017, 11:08:13 AM] [Tado] {"errors":[{"code":"accessDenied","title":"current user is not allowed to access home 55555"}]}
[1/24/2017, 11:08:13 AM] [Tado] { errors:
[ { code: 'accessDenied',
title: 'current user is not allowed to access home 55555' } ] }
/usr/local/lib/node_modules/homebridge-tado/index.js:340
accessory.log("Room temperature is " + obj.sensorDataPoints.insideTemperature.celsius + "ºC");
^
TypeError: Cannot read property 'insideTemperature' of undefined
at IncomingMessage.<anonymous> (/usr/local/lib/node_modules/homebridge-tado/index.js:340:76)
at emitNone (events.js:91:20)
at IncomingMessage.emit (events.js:185:7)
at endReadableNT (_stream_readable.js:974:12)
at _combinedTickCallback (internal/process/next_tick.js:74:11)
at process._tickCallback (internal/process/next_tick.js:98:9)
I need to see more. For some reason you can't pull the token properly. There is another log I used there to detect if the Token is accepted, send me the logs of the homebridge after starting. There should be something written: New Token is...
Also, please look in the persist folder for a file name 'Tado_Token' and tell me what's inside.
I've tested this branch on my side and it actually works great.
On 24 Jan 2017, at 0:09, Nick notifications@github.com wrote:
The second time I ran homebridge I got:
[1/24/2017, 11:08:13 AM] [Tado] {"errors":[{"code":"accessDenied","title":"current user is not allowed to access home 55555"}]} [1/24/2017, 11:08:13 AM] [Tado] { errors: [ { code: 'accessDenied', title: 'current user is not allowed to access home 55555' } ] } /usr/local/lib/node_modules/homebridge-tado/index.js:340 accessory.log("Room temperature is " + obj.sensorDataPoints.insideTemperature.celsius + "ºC"); ^
TypeError: Cannot read property 'insideTemperature' of undefined
at IncomingMessage.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.
Upon startup I do see the new token:
[1/24/2017, 11:12:18 AM] [Tado] New Token is <REDACTED 857 CHARACTER LONG TOKEN>
I see two files in the persist
folder. One called Tado_lastTemp
that contains the number 25 (correct temperature, actually!) and the other file is called Tado_Token
that contains the correct TOKEN but between double quotes.
I'm so sorry, I found the issue: my homeID had a typo in it. I can confirm that it now works.
I set up a local copy of your test branch, learned how to use the util module, created a npm link, and inspected the request...
Now that it works I did some testing and I found an issue that causes the Mode to be reset to HEAT when the temperature slider is used: #22. You mentioned in a comment above that you didn't implement Set but I wasn't sure if the Mode should also be reset in the process (upon pushing the token support in the Test branch).
Fixed in the last branch update... let me know that it works well on your side so I can close the issue and update the master branch.
Hi,
I installed the latest from git today and gave the tado plugin another try. Unfortunately I get the response below:
For reference, this is the
state
that I see when inspecting the http response frommy.tado.com
using my browser:I hope this helps with diagnosing the problem.
Cheers, Nick