ckuburlis / homebridge-tado

16 stars 15 forks source link

"ON" order #39

Closed rafacampoamor closed 7 years ago

rafacampoamor commented 7 years ago

My AC needs a "ON" order before sending it the normal order whent it's off. This a feature Tado has but its hiden (you have to call them to activate it for you). I've seen homebridge runs ok but when the AC is OFF, it cannot get it on. ¿Can you help me? ¿Is there a line I can add to the config file to activate this?

Thank you

nitaybz commented 7 years ago

I will try to help but to do so you will have to record some calls from your computer to tado servers. Use the chrome inspect tool while you logged in to Tado's web UI to record the call when you are sending the ON command to the AC.

rafacampoamor commented 7 years ago

ok

amirandap commented 7 years ago

I beleive i have same issue, because the only command that works is turning off, temp changes, or turning on doesnt work.

setting : {type: "AIR_CONDITIONING", power: "ON", mode: "COOL", temperature: {celsius: 21, fahrenheit: 69.8},…} tadoMode : "HOME"

nitaybz commented 7 years ago

someone send me some some web calls and I will try to investigate

rafacampoamor commented 7 years ago

I think it might be this what you need...?

nitaybz commented 7 years ago

not really.... what I need you is to capture the request that changes the settings... like this:

tado1 tado2

**it doesn't have to be an overlay command... just look for the calls that your browser does while sending on command

rafacampoamor commented 7 years ago

Ok!

I think that's the order:

{tadoMode: "AWAY", geolocationOverride: false, geolocationOverrideDisableTime: null, preparation: null,…} activityDataPoints : {} geolocationOverride : false geolocationOverrideDisableTime : null link : {state: "ONLINE"} openWindow : null overlay : {type: "MANUAL",…} overlayType : "MANUAL" preparation : null sensorDataPoints : {,…} setting : {type: "AIR_CONDITIONING", power: "ON", mode: "COOL", temperature: {celsius: 20, fahrenheit: 68},…} tadoMode : "AWAY"

setting : {type: "AIR_CONDITIONING", power: "ON", mode: "COOL", temperature: {celsius: 20, fahrenheit: 68},…} fanSpeed : "AUTO" mode : "COOL" power : "ON" swing : "ON" temperature : {celsius: 20, fahrenheit: 68} celsius : 20 fahrenheit : 68 type : "AIR_CONDITIONING" tadoMode : "AWAY"

nitaybz commented 7 years ago

please send me pictures like I sent yours, I want to see if there is any other calls, or whats the address of the calls

rafacampoamor commented 7 years ago

Ok! There you go!

captura de pantalla 2017-06-13 a las 10 47 20 captura de pantalla 2017-06-13 a las 10 48 38
nitaybz commented 7 years ago

this is the state command... show me the overlay command please

rafacampoamor commented 7 years ago

This?

{type: "MANUAL",…}
setting
:
{type: "AIR_CONDITIONING", power: "ON", mode: "COOL", temperature: {celsius: 20, fahrenheit: 68},…}
fanSpeed
:
"AUTO"
mode
:
"COOL"
power
:
"ON"
swing
:
"ON"
temperature
:
{celsius: 20, fahrenheit: 68}
celsius
:
20
fahrenheit
:
68
type
:
"AIR_CONDITIONING"
termination
:
{type: "MANUAL", projectedExpiry: null}
projectedExpiry
:
null
type
:
"MANUAL"
type
:
"MANUAL"
captura de pantalla 2017-06-13 a las 10 50 27
nitaybz commented 7 years ago

looks like a normal command.... lets try to find the desired call. turn off the AC, clear the network tav on console and than make the the ON command, then show me exactly how it looks at the bottom part of the call

rafacampoamor commented 7 years ago

{type: "MANUAL", setting: {type: "AIR_CONDITIONING", power: "OFF"},…} setting : {type: "AIR_CONDITIONING", power: "OFF"} power : "OFF" type : "AIR_CONDITIONING" termination : {type: "MANUAL", projectedExpiry: null} projectedExpiry : null type : "MANUAL" type : "MANUAL"

captura de pantalla 2017-06-13 a las 10 58 49

{type: "MANUAL", setting: {type: "AIR_CONDITIONING", power: "OFF"},…} setting : {type: "AIR_CONDITIONING", power: "OFF"} power : "OFF" type : "AIR_CONDITIONING" termination : {type: "MANUAL", projectedExpiry: null} projectedExpiry : null type : "MANUAL" type : "MANUAL"

captura de pantalla 2017-06-13 a las 10 59 52

{type: "MANUAL",…} setting : {type: "AIR_CONDITIONING", power: "ON", mode: "COOL", temperature: {celsius: 20, fahrenheit: 68},…} fanSpeed : "AUTO" mode : "COOL" power : "ON" swing : "ON" temperature : {celsius: 20, fahrenheit: 68} celsius : 20 fahrenheit : 68 type : "AIR_CONDITIONING" termination : {type: "MANUAL", projectedExpiry: null} projectedExpiry : null type : "MANUAL" type : "MANUAL"

captura de pantalla 2017-06-13 a las 11 03 17

and the last overlay:

captura de pantalla 2017-06-13 a las 11 03 53 captura de pantalla 2017-06-13 a las 11 04 00
nitaybz commented 7 years ago

remove tado plugin, and install from here: sudo npm install -g https://github.com/nitaybz/homebridge-tado-ac#patch1 let me know if it helps.

rafacampoamor commented 7 years ago

Ok, I’ll try it this evening when I get home and let you know.

Thanks!!!

rafacampoamor commented 7 years ago

I was unable to unistall the previous version so.. :/

I used this command: sudo npm uninstall homebridge-tado

Got this when starting homebridge:

[2017-06-13 22:32:44] Loading 3 accessories...
/usr/lib/node_modules/homebridge/lib/api.js:57
      throw new Error("The requested accessory '" + name + "' has been registered multiple times. Please be more specific by writing one of: " + found.join(", "));
      ^

Error: The requested accessory 'TADO' has been registered multiple times. Please be more specific by writing one of: homebridge-tado.TADO, homebridge-tado-ac.TADO
    at API.accessory (/usr/lib/node_modules/homebridge/lib/api.js:57:13)
    at Server._loadAccessories (/usr/lib/node_modules/homebridge/lib/server.js:254:42)
    at Server.run (/usr/lib/node_modules/homebridge/lib/server.js:81:38)
    at module.exports (/usr/lib/node_modules/homebridge/lib/cli.js:40:10)
    at Object.<anonymous> (/usr/lib/node_modules/homebridge/bin/homebridge:17:22)
    at Module._compile (module.js:556:32)
    at Object.Module._extensions..js (module.js:565:10)
    at Module.load (module.js:473:32)
    at tryModuleLoad (module.js:432:12)
    at Function.Module._load (module.js:424:3)
nitaybz commented 7 years ago

looks like you did not uninstalled homebridge-tado how come you can't uninstall? did you update your npm recently? there is an issue that happens on npm version > 5 it's not just with this plugin, anything you'll try to install will act the same. please reinstall npm version 4.6, this version is more stable now... at least until they will figure this out

amirandap commented 7 years ago

@nitaybz give me your email so i can give you my tado credentials so you can check everything out

nitaybz commented 7 years ago

nitaybz@gmail.com, but you can check this solution first:

remove tado plugin, and install from here: sudo npm install -g https://github.com/nitaybz/homebridge-tado-ac#patch1 let me know if it helps.

rafacampoamor commented 7 years ago

Tried twice. Got errors... :/

pi@CampoaPi:~ $ sudo npm install -g https://github.com/nitaybz/homebridge-tado-ac#patch1
npm ERR! code 128
npm ERR! Command failed: /usr/bin/git clone --depth=1 -q -b patch1 https://github.com/nitaybz/homebridge-tado-ac.git /root/.npm/_cacache/tmp/git-clone-7bdde771
npm ERR! fatal: could not create leading directories of '/root/.npm/_cacache/tmp/git-clone-7bdde771': Permiso denegado
npm ERR! 

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2017-06-14T13_38_48_592Z-debug.log
pi@CampoaPi:~ $ npm install -g https://github.com/nitaybz/homebridge-tado-ac#patch1
npm WARN checkPermissions Missing write access to /usr/lib/node_modules/homebridge-tado-ac/node_modules/mkdirp
npm WARN checkPermissions Missing write access to /usr/lib/node_modules/homebridge-tado-ac/node_modules/q
npm WARN checkPermissions Missing write access to /usr/lib/node_modules/homebridge-tado-ac/node_modules/node-persist
npm WARN checkPermissions Missing write access to /usr/lib/node_modules/homebridge-tado-ac/node_modules/object-assign
npm WARN checkPermissions Missing write access to /usr/lib/node_modules/homebridge-tado-ac
npm WARN checkPermissions Missing write access to /usr/lib/node_modules/homebridge-tado-ac/node_modules
npm ERR! path /usr/lib/node_modules/homebridge-tado-ac/node_modules/mkdirp
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall access
npm ERR! Error: EACCES: permission denied, access '/usr/lib/node_modules/homebridge-tado-ac/node_modules/mkdirp'
npm ERR!     at Error (native)
npm ERR!  { Error: EACCES: permission denied, access '/usr/lib/node_modules/homebridge-tado-ac/node_modules/mkdirp'
npm ERR!     at Error (native)
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   syscall: 'access',
npm ERR!   path: '/usr/lib/node_modules/homebridge-tado-ac/node_modules/mkdirp' }
npm ERR! 
npm ERR! Please try running this command again as root/Administrator.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/pi/.npm/_logs/2017-06-14T13_39_51_706Z-debug.log
nitaybz commented 7 years ago

this is npm version 5 and above error... reinstall npm with version 4.6 if you're not sure about your npm version, use this npm -v

rafacampoamor commented 7 years ago

I uptadted to 5.0.3 but i don't know gow to downgrade. What's the command/s i have to use?

nitaybz commented 7 years ago

sudo npm install -g npm@4.6.1

rafacampoamor commented 7 years ago

Now got this... :/

events.js:160
      throw er; // Unhandled 'error' event
      ^

Error: listen EADDRINUSE :::51826
    at Object.exports._errnoException (util.js:1036:11)
    at exports._exceptionWithHostPort (util.js:1059:20)
    at Server._listen2 (net.js:1252:14)
    at listen (net.js:1288:10)
    at Server.listen (net.js:1384:5)
    at EventedHTTPServer.listen (/usr/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/util/eventedhttp.js:60:19)
    at HAPServer.listen (/usr/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/HAPServer.js:158:20)
    at Bridge.Accessory.publish (/usr/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Accessory.js:496:16)
    at Server._publish (/usr/lib/node_modules/homebridge/lib/server.js:114:16)
    at Server.run (/usr/lib/node_modules/homebridge/lib/server.js:91:10)
nitaybz commented 7 years ago

@rafacampoamor I'm not sure it's a plugin error.... looks like a connection error. does it happen all the time?

rafacampoamor commented 7 years ago

It didn't happen the first time I run homebridge after downgrading, but then I restarted it and this happen all the time…

I found this, so when I get home I'll do some tests…

nitaybz commented 7 years ago

let me know how it goes... you maybe already running an instance of homebridge in the background, maybe try to reboot the device

rafacampoamor commented 7 years ago

So now I have it working again (exactly, it was just to reboot and re-register homebridge on iOS. That's the good news!

The bad ones: As now it tells the status over WLAN or 4G, no command works, neither the OFF command (the only one that worked on the start).

What can I do to help you with this?

nitaybz commented 7 years ago

try installing again with: sudo npm install -g https://github.com/nitaybz/homebridge-tado-ac#patch1

rafacampoamor commented 7 years ago

The same. No command operating. HomeKit marks it as the order was given but the AC doesn't beep like when I send the command through the Tado app

nitaybz commented 7 years ago

what do you see in Tado app after you sent the command? is it received there?

nitaybz commented 7 years ago

please show me your config

rafacampoamor commented 7 years ago

In Homekit, it changes the status, but the app remains the same, and as soon as Homekit refreshes it gets back on the real status.

This is my config:

 {
            "accessory": "TADO",
            "name": "Aire Acondicionado",
            "homeID": "xxxxxx",
            "username": "rafa@xxxxx",
            "password": "xxxxxxxx",
            "maxValue": 31,
            "minValue": 16,
            "zone": 1,
            "useFanSpeed": "AUTO",
            "useSwing": false,
            "tadoMode": "TADO_MODE",
            "useFahrenheit": false
                },
nitaybz commented 7 years ago

you can't control your ac because you set the "useSwing" to false... because your air conditioner supports swing you've gotta write it in the config, either "OFF" or "ON", and you can use the normal version from npm sudo npm install -g homebridge-tado-ac

rafacampoamor commented 7 years ago

Restarting… I'll keep you informed

rafacampoamor commented 7 years ago

It works!!!

Thank you very much!!! 🥇 😄

nitaybz commented 7 years ago

glad to hear :) enjoy

KE55ARD commented 7 years ago

Hi, I'm having the same issues and my AC also supports swing, but both "OFF" and "ON" seem to make no difference in the config (even after 'service homebridge restart') any advice?

dgaust commented 7 years ago

Setting is true or false not off/on

Sent from Mobile


From: KE55ARD notifications@github.com<mailto:notifications@github.com> Sent: Monday, July 10, 2017 4:39 am Subject: Re: [ckuburlis/homebridge-tado] "ON" order (#39) To: ckuburlis/homebridge-tado homebridge-tado@noreply.github.com<mailto:homebridge-tado@noreply.github.com> Cc: Subscribed subscribed@noreply.github.com<mailto:subscribed@noreply.github.com>

Hi, I'm having the same issues and my AC also supports swing, but both "OFF" and "ON" seem to make no difference in the config (even after 'service homebridge restart') any advice?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/ckuburlis/homebridge-tado/issues/39#issuecomment-313937463, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ADQXZv4StE8AjeN1PtJkmfvXLjvg79ADks5sMR5SgaJpZM4N2YZG.

KE55ARD commented 7 years ago

I've tried "ON","OFF",true,false and none of them seem to allow anything other than turning the AC off.

nitaybz commented 7 years ago

please use this link: https://my.tado.com/api/v2/homes/homeID/zones/zoneNumber/capabilities?username=user@gmail.com&password=password replace the homeID, zoneNumber, username, password according to your own account details and show me the output.

nitaybz commented 7 years ago

and your config as well

KE55ARD commented 7 years ago

CONFIG: { "bridge": { "name": "Homebridge", "username": "CD:22:3D:E3:CE:30", "port": 51826, "pin": "031-45-154" },

"description": "Tado device in my bedroom", "accessories": [ { "accessory": "TADO", "name": "Tado", "homeID": "45964", "maxValue": 30, "minValue": 18, "zone": 1, "username": "james@kennard.me.uk", "password": "password", "useFanSpeed": "AUTO", "useSwing": true, "tadoMode": "MANUAL", "useFahrenheit": false } ] }

OUTPUT: {"type":"AIR_CONDITIONING","AUTO":{},"COOL":{"temperatures":{"celsius":{"min":18,"max":30,"step":1.0},"fahrenheit":{"min":64,"max":86,"step":1.0}},"fanSpeeds":["AUTO","HIGH","MIDDLE","LOW"]},"DRY":{},"FAN":{},"HEAT":{"temperatures":{"celsius":{"min":16,"max":30,"step":1.0},"fahrenheit":{"min":61,"max":86,"step":1.0}},"fanSpeeds":["AUTO","HIGH","MIDDLE","LOW"]}}

nitaybz commented 7 years ago

as you can see in the capabilities output, you don't have the swing option so please set it to false: "useSwing": false,

KE55ARD commented 7 years ago

ARG this is how I originally had it, but I think I had the wrong tado plugin at first, but tried to enable the swing setting (since my AC itself does actually support swing) then installed homebridge-tado-ac and didn't try swing:false again... Thanks!

nitaybz commented 7 years ago

you're welcome :) i have the same situation as my ac support swing but tado remote is not... the way to overcome it is to teach tado the ac commands, all of them! which is a bit frustrating but it will give you all the options.

KE55ARD commented 7 years ago

Aha, when I first setup my Tado I don't think it even had that option, it would only let me go through a ridiculously long and horrible process of trial and error for which set of instructions it would let me use, so may have to give this a try later, thanks :)