VoxCommando

VoxNastics (User Guides and Mods) => Integration Ideas => Topic started by: Simeon Tuitt on June 25, 2015, 12:02:59 AM

Title: Tado Heating Control With Robo Browser Help Needed Getting Error To Update
Post by: Simeon Tuitt on June 25, 2015, 12:02:59 AM
Hi There,

I need some help, I am trying to control and update my tado thermostat at the url:

https://my.tado.com/webapp/#/home-control/control-panel

I just need Robo Browser to navigate to the page, login and then select one of 3 options which I think I just need to do with Robo Browser code match and Robo Browser click to select the option directly from the following url:

https://my.tado.com/webapp/#/home-control/control-panel

But Robo Browser isn't loading instead it is giving me the following error message:
You are using an outdated browser. Please upgrade your browser to improve your experience.

I have the latest versions of all browsers and even redownloaded them all yesterday and I am still getting the error message, it seems to be something to do with my url type that is causing the issue because Robo Browser works fine for other urls.

Not sure if its the webapp style url causing the problem.

https://my.tado.com/webapp/#/home-control/control-panel

Any help you can give to help me use the RoboB.Navigate command to load the url would be greatly appreciated.

My steps for Robo Browser will be to
Navigate to and login to the following url and save login info:
https://my.tado.com/webapp/#/account/sign-in

Then navigate to the page where I have 3 settings to control my heating:
https://my.tado.com/webapp/#/home-control/control-panel
Off - NO FREEZE
Auto - AUTO
Manual - MANUAL

Below is the code from the page, so where it says MANUAL is what I am guessing I would just need to use RoboB.ElementByID, followed by RoboB.Click to select one of the above 3 options after navigating to the page.


<label class="btn btn-default ng-pristine ng-untouched ng-valid" ng-model="thermostat.setMode" btn-radio="'MANUAL'" ng-model-options="{ getterSetter: true }"> <div class="icon-setMode tado-icon-hand"></div> <div class="ng-binding">Manual</div> </label>

Having just checked the page source for my control page I see the following code at the top:

https://my.tado.com/webapp/#/home-control/control-panel

Has this source code at the top:
<!doctype html> <html class="no-js" ng-app="webapp"> <head> <meta charset="utf-8"> <title ng-bind="title">tado°</title> <meta name="description" content=""> <meta name="viewport" content="width=device-width,initial-scale=1"> <link rel="shortcut icon" href="favicon.ico" type="image/x-icon"> <link rel="stylesheet" href="styles/vendor.a3dbb0b9.css"> <link rel="stylesheet" href="styles/custom-bootstrap.a4b4848c.css"> <link rel="stylesheet" href="styles/main.19a5a22f.css"> <script src="https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false"></script> <script src="env.js"></script>  <body state="{{$state.current.name}}"> <!--[if lte IE 8]>
<p class="browsehappy alert alert-warning">You are using an <strong>outdated</strong> browser. Please upgrade
   your browser (http://browsehappy.com/) to improve your experience.</p>

Is there anyway to select Chrome as the default for Robo Browser this may help my issue since I am getting the error message with IE latest version which should be fine but due to that code above is stopping me navigating to my thermostat control page and scraping the url.

I did try changing my default browser to chrome but that didn't change anything with the Robo Browser error.

Thanks in advance for your help.
Sim
Title: Re: Tado Heating Control With Robo Browser Help Needed Getting Error To Update
Post by: jitterjames on June 25, 2015, 09:47:30 AM
By default Windows runs browser controls in .Net apps using compatibility mode for IE version 7.

Fortunately there is a very simple fix:
http://voxcommando.com/mediawiki/index.php?title=Use_latest_version_of_Internet_Explorer_in_RoboBrowser

Please let us know if this solves the problem for you.
Title: Re: Tado Heating Control With Robo Browser Help Needed Getting Error To Update
Post by: Foggy on June 25, 2015, 02:43:48 PM
Please let us know how you get on. I am very interested in this.

You may be interested in this.

http://techcrunch.com/2015/03/16/the-tado-smart-thermostat-just-got-smarter/

Best wishes.

James.
Title: Re: Tado Heating Control With Robo Browser Help Needed Getting Error To Update
Post by: Foggy on June 25, 2015, 02:51:55 PM
Found this.

http://www.tadoreview.com

James.
Title: Re: Tado Heating Control With Robo Browser Help Needed Getting Error To Update
Post by: Simeon Tuitt on June 26, 2015, 11:04:48 PM
Thanks James, the registry update fixed the Robo Browser issue, I just need to work out now how to get it to click one of the three options from the page I login to with saved settings:

Then navigate to the page where I have 3 settings to control my heating:
https://my.tado.com/webapp/#/home-control/control-panel

I have tried inputting the 3 variables under different commands using RoboB.ElementByName and tried RoboB.ElementByID for NO FREEZE, MANUAL and AUTO and then had the RoboB.Click followed by VC.Pause 1800 s I am using a slight modified version of the OurGroceries command as a working framework until I get my head around it all but it's got me stumped.

Off - NO FREEZE
Auto - AUTO
Manual - MANUAL

When I open Robo Browser INVESTIGATOR and CTRL over the NO FREEZE option I get:
<div class="icon-setMode tado-icon-standby"></div>


When I open Robo Browser, investigator and CTRL over the AUTO option I get:
<i class="tado-icon-sleep ng-scope" ng-switch-when="SLEEP">

When I open Robo Browser, investigator and CTRL over the MANUAL option I get:
<div class="icon-setMode tado-icon-hand"></div>

Hope someone can help me figure this out to get Robo Browser to click one of the 3 options, I just need to know how to do it with one of the options and then I can clone it for the others.

Foggy, thanks for the links, it was only a month or 2 ago I e-mailed Tado asking if they had an API and they told me they didn't for day to day consumers, but it is good it looks like they now have and making integration open for other things.

I did see the page of the guy who has his tado updating its status over twitter, he does include lots of variables and info which I will probably use at a later date, but for the mo I just want to get mine working with on and off commands.

After a night out on the town when I hit the sofa instead of bed and then realise how cold it is half way through the night, it would be nice to just say heating on, instead of having to reach for and pick up my phone if it has any juice left, open the tado app and turn it on and same for turning it off when I start to cook and don't have the coordination to make the fridge to rehydrate, lol.  8)
Title: Re: Tado Heating Control With Robo Browser Help Needed Getting Error To Update
Post by: Kalle on June 27, 2015, 02:35:55 AM
Hi Simeon, you can try following in investigator window:


When you use the CRTL and mouse over the element you want to use. Then you will see it marked in the "tree" on the right in the investigator window - click on the marked entry in the tree and now you will get the ID for the element which you can use with "RoboB.ElementByID" and "RoboB.Click" action.


See example pictures - maybe this will help you.
Title: Re: Tado Heating Control With Robo Browser Help Needed Getting Error To Update
Post by: Simeon Tuitt on June 27, 2015, 08:08:11 AM
Thanks Kalle, all my TAG IDs are coming back blank when doing the above even with script and highlighting enabled. I know there are labels from doing Google inspect element but the Robo Browser isn't showing any tags for the 3 buttons so I can't set any as triggers for my button click actions. Any ideas? Cheers. Sim  8)
Title: Re: Tado Heating Control With Robo Browser Help Needed Getting Error To Update
Post by: jitterjames on June 27, 2015, 09:09:56 AM
Explore the tree.  Climb to a parent element in the tree.
Title: Re: Tado Heating Control With Robo Browser Help Needed Getting Error To Update
Post by: Simeon Tuitt on June 27, 2015, 11:24:42 AM
Hi guys, I got it working by going for tags instead of ID or name. Thanks for the help Kalle.  8)
Title: Re: Tado Heating Control With Robo Browser Help Needed Getting Error To Update
Post by: Kalle on June 27, 2015, 01:01:40 PM
nice to hear you figured it out  :)
Title: Re: Tado Heating Control With Robo Browser Help Needed Getting Error To Update
Post by: jitterjames on June 27, 2015, 04:10:01 PM
Here's a more or less complete solution for setting your 3 Tado modes.  It includes logging in automatically, and letting you set the mode to off, auto, or manual.

You'll need to edit the "Sign in to Tado" command to use your username and password.

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.1.5.0-->
<commandGroup open="True" name="Tado" enabled="True" prefix="" priority="0" requiredProcess="" description="">
  <command id="582" name="Tado startup" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>RoboB.Select</cmdType>
      <params>
        <param>tado</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>RoboB.Navigate</cmdType>
      <params>
        <param>http://my.tado.com/webapp/#/home-control/</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>RoboB.Wait</cmdType>
      <params />
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>RoboB.Show</cmdType>
      <params />
      <cmdRepeat>0</cmdRepeat>
    </action>
    <action>
      <cmdType>RoboB.Navigate</cmdType>
      <params>
        <param>http://my.tado.com/webapp/#/home-control/control-panel</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <event>VC.Loaded</event>
  </command>
  <command id="605" name="sign in to Tado" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>TTS.Speak</cmdType>
      <params>
        <param>Logging in to Tay-doe</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>RoboB.Select</cmdType>
      <params>
        <param>tado</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>VC.Pause</cmdType>
      <params>
        <param>500</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>RoboB.ElementByName</cmdType>
      <params>
        <param>username</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>RoboB.Focus</cmdType>
      <params />
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>RoboB.SetText</cmdType>
      <params>
        <param>test@voxcommando.com</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>RoboB.ElementByName</cmdType>
      <params>
        <param>password</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>Robob.Focus</cmdType>
      <params />
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>Robob.SetText</cmdType>
      <params>
        <param>testtest</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>RoboB.ElementByName</cmdType>
      <params>
        <param>rememberMe</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>RoboB.Focus</cmdType>
      <params />
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>RoboB.Click</cmdType>
      <params />
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>RoboB.ElementByTag</cmdType>
      <params>
        <param>BUTTON</param>
        <param>0</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>RoboB.Focus</cmdType>
      <params />
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>RoboB.Click</cmdType>
      <params />
      <cmdRepeat>1</cmdRepeat>
    </action>
    <event>tado.sign-in</event>
  </command>
  <command id="604" name="++Turn thermostat {1}" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>RoboB.Select</cmdType>
      <params>
        <param>tado</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>RoboB.Show</cmdType>
      <params />
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>RoboB.SetWinSize</cmdType>
      <params>
        <param>800</param>
        <param>900</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>RoboB.GetURL</cmdType>
      <params />
      <cmdRepeat>1</cmdRepeat>
    </action>
    <if ifBlockDisabled="False" ifNot="False">
      <ifType>(A)Contains(B)</ifType>
      <ifParams>{LastResult}&amp;&amp;control-panel</ifParams>
      <then />
      <else>
        <action>
          <cmdType>RoboB.Navigate</cmdType>
          <params>
            <param>http://my.tado.com/webapp/#/home-control/control-panel</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
        <action>
          <cmdType>VC.Pause</cmdType>
          <params>
            <param>3000</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
        <action>
          <cmdType>RoboB.Wait</cmdType>
          <params />
          <cmdRepeat>1</cmdRepeat>
        </action>
        <action>
          <cmdType>VC.Pause</cmdType>
          <params>
            <param>3000</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
      </else>
    </if>
    <action>
      <cmdType>RoboB.GetURL</cmdType>
      <params />
      <cmdRepeat>1</cmdRepeat>
    </action>
    <if ifBlockDisabled="False" ifNot="False">
      <ifType>(A)Contains(B)</ifType>
      <ifParams>{LastResult}&amp;&amp;sign-in</ifParams>
      <then>
        <action>
          <cmdType>VC.TriggerEvent</cmdType>
          <params>
            <param>tado.sign-in</param>
            <param>{1}</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
        <action>
          <cmdType>VC.Pause</cmdType>
          <params>
            <param>1000</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
        <action>
          <cmdType>RoboB.Navigate</cmdType>
          <params>
            <param>https://my.tado.com/webapp/#/home-control/control-panel</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
        <action>
          <cmdType>VC.Pause</cmdType>
          <params>
            <param>3000</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
        <action>
          <cmdType>RoboB.Wait</cmdType>
          <params />
          <cmdRepeat>1</cmdRepeat>
        </action>
      </then>
      <else />
    </if>
    <action>
      <cmdType>TTS.Speak</cmdType>
      <params>
        <param>Switching to {1} mode.</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>RoboB.ElementRegex</cmdType>
      <params>
        <param>div</param>
        <param>{1}&lt;/div&gt;$</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>RoboB.Click</cmdType>
      <params />
      <cmdRepeat>1</cmdRepeat>
    </action>
    <phrase>Turn thermostat </phrase>
    <phrase optional="true">to</phrase>
    <payloadList>Off, Auto, Manual</payloadList>
    <phrase>mode</phrase>
  </command>
</commandGroup>
Title: Re: Tado Heating Control With Robo Browser Help Needed Getting Error To Update
Post by: Simeon Tuitt on July 05, 2015, 11:14:22 PM
Thanks for this James, appreciated. I did try it on both versions of vox but it takes me to the tado sign in page and doesn't log in with my credentials, any ideas?

Cheers.
Sim  8)
Title: Re: Tado Heating Control With Robo Browser Help Needed Getting Error To Update
Post by: nime5ter on July 06, 2015, 09:37:26 AM
We would need to see your Vox log showing what happens when you try to use the commands.

http://voxcommando.com/mediawiki/index.php?title=Log
Title: Re: Tado Heating Control With Robo Browser Help Needed Getting Error To Update
Post by: nime5ter on July 06, 2015, 11:40:11 AM
You can edit the log to put a placeholder [myusername] and [mypassword] in place of your real log-in information, if that's why you deleted part of the log,but we can't help diagnose the problem unless we can see the full log documenting everything that took place.

What's important is what is happening directly before the portion that you posted.
Title: Re: Tado Heating Control With Robo Browser Help Needed Getting Error To Update
Post by: Simeon Tuitt on July 06, 2015, 12:45:29 PM
Hi @ nime5ter I only deleted the other stuff because the log was huge and all the other stuff was before running the tado command, I grabbed the portion that starts the tado command and ends it. It is only the login which is the issue it is not entering the text for my username and password into the fields on the tado login page in robo browser.

If I have tado as saved login already it works but that is the set up I already have from when I set robo browser to login to the saved page and click one of the three options.

I like James idea of saving the password and username because when I delete my internet history or cache it means I have to set robo browser up for saved login again, James option would save that step.

Because of the length of the log wasn't sure whether it would be showing private login, username and passwords to things I have set up and it is way to long to manually go through to check if my security details are being included in it.

Does the log file output username, password details etc?

Cheers.
Sim  8)
Title: Re: Tado Heating Control With Robo Browser Help Needed Getting Error To Update
Post by: nime5ter on July 06, 2015, 01:03:10 PM
My point was only that I can't tell you why it isn't properly logging in if you don't show the part where it is trying to log in.

If you entered your username and password info where indicated in the commands that James posted above, the command group should work as follows:

1. When you first launch VC, the 1st command is automatically triggered. It is just invisibly setting up the Tado RoboBrowser, in preparation for you to issue your thermostat command.
2. When you issue the "Turn thermostat to auto/off/manual mode" voice command, the command checks to see whether you still need to log in or whether you're already logged in (by checking whether the Tado Robobrowser is stuck on the sign-in page or whether it is able to navigate properly to the control panel page).

If you are not yet logged in, it should automatically log in for you, by triggering the "sign-in to Tado" command. Once it has signed in, it will automatically navigate to the control panel page and complete your request. If you are already signed in, it will immediately complete your request.

So, by not giving us your full log (as the wiki instructions indicate that users should do) you prevent us from seeing whether it properly recognizes that you are not signed in and attempts to sign in. All we can see is the last part of the command failing. The last part of the command is always going to fail if it's not logging in properly -- or there could be some other reason. Without being able to see the complete execution of the entire script, there is no way for us to deduce the problem.

... Yes, the log will have your login info in it if you have entered those into the VC command where indicated. It will show your email address and the password you use. That information you can redact, but as you're still learning how VC works and don't seem to quite understand the command structure yet, it is better for you to let us decide what log information is relevant and what isn't.

If you're concerned about the length of the log, you can restart VC and then immediately execute the Tado commands and then close VC right away. That way the log should be a reasonable length.
Title: Re: Tado Heating Control With Robo Browser Help Needed Getting Error To Update
Post by: jitterjames on July 06, 2015, 01:51:27 PM
You can also mail the log to me privately, so you don't have to worry about your log being posted publicly on the forum, just in case there is something private in there.  I have no interest in your passwords etc. :)
Title: Re: Tado Heating Control With Robo Browser Help Needed Getting Error To Update
Post by: Simeon Tuitt on July 07, 2015, 01:36:27 AM
Thanks @nime5ter and James. @nime5ter I don't mind sending mods my log but if I had posted the entire log initially not knowing my login credentials were contained they would of been public which isn't something I would want and although my log should be short it is quite long after just starting as I have a lot in there, thanks for taking the time to cover things in this thread though @nime5ter, appreciate it.  8)

So you guys cool with me PMing anything that has login details or private information in future?

James I will send the log over later Today, sure I can trust you, don't you guys leave your doors open unlocked over there, lol?

it is 5:29am here now in the UK and heading to bed now. I worked out the issue with the IP cameras and how to get them working as whole home mics, I updated the thread in the whole home mics section with the info to do it if you want to try using your IP camera as an open air mic for vox.  8)
Title: Re: Tado Heating Control With Robo Browser Help Needed Getting Error To Update
Post by: jitterjames on July 07, 2015, 08:39:27 AM
So you guys cool with me PMing anything that has login details or private information in future?

Once we've established that we need to see a log, or something else that might be considered sensitive information, then yes, it's fine to PM or email it to us.

Just to be clear though, we are not cool with people PMing anyone with support requests.
Title: Re: Tado Heating Control With Robo Browser Help Needed Getting Error To Update
Post by: Haddood on July 07, 2015, 04:56:20 PM
Here's a more or less complete solution for setting your 3 Tado modes.  It includes logging in automatically, and letting you set the mode to off, auto, or manual.

You'll need to edit the "Sign in to Tado" command to use your username and password.

just wondering if this is ready to be added to the Gems  8)
Title: Re: Tado Heating Control With Robo Browser Help Needed Getting Error To Update
Post by: jitterjames on July 07, 2015, 05:28:37 PM
It works for me.  I'm still waiting to find out why it doesn't work for Mr. Tuitt.

It could be user error, or it might be about adjusting delays etc.