[677] Tado thermostat

Use this forum to discuss possible implementation of a new feature before opening a ticket.
A developer shall edit the topic title with "[xxx]" where xxx is the id of the accompanying tracker id.
Duplicate posts about the same id. +1 posts are not allowed.

Moderators: leecollings, remb0

eXisTa
Posts: 10
Joined: Wednesday 20 May 2015 23:26
Target OS: Raspberry Pi / ODroid
Domoticz version: V3.7392
Location: Netherlands
Contact:

[677] Tado thermostat

Post by eXisTa »

There has been a somewhat hidden api available for the thermostat from Tado. Could we implement this into Domoticz?

More info: http://c-mobberley.com/wordpress/2014/0 ... ostat-api/

Example API call: https://my.tado.com/mobile/1.9/getCurre ... word=xxxxx
(the only thing that was changed is the version number in the url.

This is the result:
{"success":true,"operation":"HOME","autoOperation":"HOME","operationTrigger":"SYSTEM","insideTemp":21.979999542236328,"setPointTemp":21.100000381469727,"controlPhase":"COOLDOWN","boxConnected":true,"gwConnected":true,"tsConnected":true,"currentUserPrivacyEnabled":null,"currentUserGeoStale":null,"deviceUpdating":false,"homeId":4550,"pendingDeviceInstallation":false}
Last edited by eXisTa on Monday 11 January 2016 11:41, edited 1 time in total.
User avatar
groetg
Posts: 39
Joined: Tuesday 06 January 2015 20:41
Target OS: Raspberry Pi / ODroid
Domoticz version: V2.4025
Location: Heerhugowaard, Holland
Contact:

Re: Tado thermostat

Post by groetg »

I am also intersted!
Knipsel2.PNG
Knipsel2.PNG (54.74 KiB) Viewed 12447 times
Master: RPI Model 2B
Sub 1: RPI Model 2B
RFX transmitter/receiver 433 Mhz
13 KAKU units (3 window sensors, 1 door sensor, 7 light switches, 1 dusk sensor, 1 motion sensor)
4 IP cam
Meteostick
OTGW
P1 cable
Davis Vantage Pro weatherstation (incl. solar/UV)
maxtrash
Posts: 106
Joined: Tuesday 06 August 2013 1:31
Target OS: -
Domoticz version:
Contact:

Re: Tado thermostat

Post by maxtrash »

even before clicking the Api-link I was thinking about node-red. And after clicking it I found out they he was actually mentioning it.

the standard SD image for domoticz for the raspberry PI contains node red. If you search for MQTT on this forum you'll find links and examples to the wiki as well.
definately seems doable

viewtopic.php?f=5&t=838
eXisTa
Posts: 10
Joined: Wednesday 20 May 2015 23:26
Target OS: Raspberry Pi / ODroid
Domoticz version: V3.7392
Location: Netherlands
Contact:

Re: Tado thermostat

Post by eXisTa »

I've altered an existing Python script to get a single value from the Tado API.
It fits my needs for now but if someone can do it better, please do.

You can add this line to your crontab via "crontab -e":

Code: Select all

*/1 * * * * /usr/bin/python /home/pi/domoticz/scripts/python/tadodomoticz.py 2>&1 >> /dev/null

Code: Select all

import urllib
import urllib2
import sys
from optparse import OptionParser
import base64

try:
   import json
except ImportError:
   try:
       import simplejson as json
   except ImportError:
       print "No json library available. I recommend installing either python-json"
       print "or simpejson."
       sys.exit(-1)

# Username with which you usually login to tado.com
tadoUsername = "xxxxxx"
# Password for tado.com
tadoPassword = "xxxxxx"
# Your Domoticz installation (usually localhost:8080, without http://)
domoticzURL = "localhost:443"
# the IDX from the Temp/Humid dummy device in Domoticz
domoticzIDX = "xx"
# the username of your Domoticz installation (optional)
domoticzusername = "xxxxx"
# the password of your Domoticz installation (optional)
domoticzpassword = "xxxxxx"

base64string = base64.encodestring('%s:%s' % (domoticzusername, domoticzpassword)).replace('\n', '')

req = urllib2.Request("https://my.tado.com/mobile/1.9/getCurrentState?username=" + tadoUsername + "&password=" + tadoPassword)

res = urllib2.urlopen(req).read()

res = json.loads(res)

tadoInsidetemp = res["insideTemp"]

#---------------------------------------
# Upload the data to the Domoticz Switch
#---------------------------------------
print "Domoticz URL"
print domoticzURL
print "Domoticz IDX"
print domoticzIDX
print "Temperature of Tado device"
print tadoInsidetemp
url = ("https://" + domoticzURL + "/json.htm?type=command&param=udevice&idx=" + domoticzIDX + "&nvalue=0&svalue=" + str(tadoInsidetemp))
print "Complete URL"
print url
request = urllib2.Request(url)
request.add_header("Authorization", "Basic %s" % base64string)
urllib2.urlopen(request)
User avatar
groetg
Posts: 39
Joined: Tuesday 06 January 2015 20:41
Target OS: Raspberry Pi / ODroid
Domoticz version: V2.4025
Location: Heerhugowaard, Holland
Contact:

Re: Tado thermostat

Post by groetg »

I will try it, thanx!

Answer from Tado (in Dutch):
Imke Schmitz (tado° Help Center)
5 Jan, 13:17
Beste Guido,
Bedankt voor je antwoord. Onze API zal publiek worden gemaakt in het eerste kwartaal van 2016 (exacte publicatiedatum is nog niet bekend). Bedankt voor je geduld!
Met vriendelijke groeten,
Imke
tado°

Translation:
Thank you for your answer. Our API will be made public in the first quarter of 2016 (exact release date is not yet known). Thank you for your patience!

When the API functions full, is it possible to integrate it into Domoticz??
Master: RPI Model 2B
Sub 1: RPI Model 2B
RFX transmitter/receiver 433 Mhz
13 KAKU units (3 window sensors, 1 door sensor, 7 light switches, 1 dusk sensor, 1 motion sensor)
4 IP cam
Meteostick
OTGW
P1 cable
Davis Vantage Pro weatherstation (incl. solar/UV)
eXisTa
Posts: 10
Joined: Wednesday 20 May 2015 23:26
Target OS: Raspberry Pi / ODroid
Domoticz version: V3.7392
Location: Netherlands
Contact:

Re: Tado thermostat

Post by eXisTa »

Is it possible to feed the virtual sensor the heatingOn state so I can see when the furnace is on?
The idea would be to have 1 SetPoint sensor which has the SetPoint data en the furnace state.
pollefinario
Posts: 21
Joined: Wednesday 10 February 2016 12:40
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: [677] Tado thermostat

Post by pollefinario »

Is er inmiddels al meer mogelijk?
Ik heb het volgende opGitHub gevonden https://github.com/WebSpider/tado_domoticz

Edit:
Have there been any updates in the mean time?
I've found the following on GitHub https://github.com/WebSpider/tado_domoticz
Last edited by pollefinario on Thursday 22 December 2016 22:30, edited 1 time in total.
markk
Posts: 267
Joined: Tuesday 14 January 2014 14:50
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: [677] Tado thermostat

Post by markk »

One of the great features of Tado is the Geofencing. I use pilot with Domoticz to tell if the family are at home/not at home, at work/not at work etc. However, in order to know how low to drop the heating when the last person leaves the house, Tado is not only able to see if people are at home or not, it can also tell how far they are from home. This would be a great feature to add to Domoticz.
Running Domoticz on Pi3 with RFXtrx433e. LWRF power sockets and dimmer switches. Integrated my existing wirefree alarm PIRs and door contacts with domoticz. Geofencing with Pilot. Harmony Hub. Tado for Heating. Now playing with mysensors.
fluxcapacitor
Posts: 4
Joined: Sunday 01 November 2015 23:35
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: [677] Tado thermostat

Post by fluxcapacitor »

pollefinario wrote:Is er inmiddels al meer mogelijk?
Ik heb het volgende opGitHub gevonden https://github.com/WebSpider/tado_domoticz
This is an English forum so let me translate your post:
pollefinario wrote:Now is it possible?
I found the following link https://github.com/WebSpider/tado_domoticz
Indeed this may do the trick! Thank you :)
Does someone has a link to ask Domoticz team to implement a code in their next official release?
User avatar
groetg
Posts: 39
Joined: Tuesday 06 January 2015 20:41
Target OS: Raspberry Pi / ODroid
Domoticz version: V2.4025
Location: Heerhugowaard, Holland
Contact:

Re: [677] Tado thermostat

Post by groetg »

Is it also possible to see the geofence state in domoticz? Or not only publish the setpoint, but CHANGE the setpoint?

The script of https://github.com/WebSpider/tado_domoticz works, so maybe it could be implemented in Domoticz? It works!
Master: RPI Model 2B
Sub 1: RPI Model 2B
RFX transmitter/receiver 433 Mhz
13 KAKU units (3 window sensors, 1 door sensor, 7 light switches, 1 dusk sensor, 1 motion sensor)
4 IP cam
Meteostick
OTGW
P1 cable
Davis Vantage Pro weatherstation (incl. solar/UV)
gavacac
Posts: 12
Joined: Tuesday 06 December 2016 20:57
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: [677] Tado thermostat

Post by gavacac »

I've got the script from https://github.com/WebSpider/tado_domoticz working for reading the current temperature of my Tado Smart AC Controller.

The bit I am struggling with is how to set the setpoint/turn on heating/cooling.

I am able to send messages to the Tado api via a REST client (eg. the Chrome Advanced Rest Client), but I can't work out how to integrate this into Domoticz. For example, I would like to turn the heating or cooling on when the current temperature reaches a certain temperature.

Using a REST client, I use the following criteria to turn on cooling to 20 degrees celcius:
Request type: PUT
Host: https:/mytado.com/api/v2/homes/<5 digit code>/zones/1/overlay?username=<tado username>&password=<tado password>
Authentication: No authentication
Body: {"setting":{"type":"AIR_CONDITIONING","power":"ON","mode":"COOL","temperature":{"celsius":20},"swing":"ON"},"termination":{"type":"MANUAL"}}

The '5 digit code' I believe is an identifier for my home.

So the big question is how can I use Domoticz to send the command t the api? Any suggestions?

Thanks
pollefinario
Posts: 21
Joined: Wednesday 10 February 2016 12:40
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: [677] Tado thermostat

Post by pollefinario »

I'm very interested in this also.
Wouldn't it be possible to make this a "native" domoticz device?
doh
Posts: 82
Joined: Monday 01 December 2014 13:28
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: London, UK
Contact:

Re: [677] Tado thermostat

Post by doh »

pollefinario wrote:I'm very interested in this also.
Wouldn't it be possible to make this a "native" domoticz device?
Hi
I'm about to invest in a smart Thermostat and think Tado looks best. Has the integration with Domoticz moved on at all? Does it work ok and how controllable is it via Domoticz? (do I even need to bother if all the family members are "geo-fenced"?)
thanks
markk
Posts: 267
Joined: Tuesday 14 January 2014 14:50
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: [677] Tado thermostat

Post by markk »

doh wrote:
pollefinario wrote:I'm very interested in this also.
Wouldn't it be possible to make this a "native" domoticz device?
Hi
I'm about to invest in a smart Thermostat and think Tado looks best. Has the integration with Domoticz moved on at all? Does it work ok and how controllable is it via Domoticz? (do I even need to bother if all the family members are "geo-fenced"?)
thanks
I have Tado and Domoticz but can't see much, if any, benefit of linking the two. Tado keeps my heating at a pre-determined comfortable temperature if someone is home, drops it down as the last person leaves home, and back up again when the first person starts returning home. I installed mine a couple of years ago and can count on one hand the amount of times I've manually adjusted anything.
Running Domoticz on Pi3 with RFXtrx433e. LWRF power sockets and dimmer switches. Integrated my existing wirefree alarm PIRs and door contacts with domoticz. Geofencing with Pilot. Harmony Hub. Tado for Heating. Now playing with mysensors.
gavacac
Posts: 12
Joined: Tuesday 06 December 2016 20:57
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: [677] Tado thermostat

Post by gavacac »

markk wrote:
doh wrote:
pollefinario wrote:I'm very interested in this also.
Wouldn't it be possible to make this a "native" domoticz device?
Hi
I'm about to invest in a smart Thermostat and think Tado looks best. Has the integration with Domoticz moved on at all? Does it work ok and how controllable is it via Domoticz? (do I even need to bother if all the family members are "geo-fenced"?)
thanks
I have Tado and Domoticz but can't see much, if any, benefit of linking the two. Tado keeps my heating at a pre-determined comfortable temperature if someone is home, drops it down as the last person leaves home, and back up again when the first person starts returning home. I installed mine a couple of years ago and can count on one hand the amount of times I've manually adjusted anything.
For me, there is benefit as the control I need is not provided by Tado. I have an AC unit in a cabin in my garden. I keep various things in the cabin (paperwork, computers etc) and I want to make sure that it never gets too cold (e.g. below 12 degrees) or too hot (e.g. above 26 degrees). Unfortunately, the minimum controllable temperature on the AC unit is 18 degrees and therefore the minimum temperate that Tado can set is the same. I don't want the cabin to be kept above 18 degrees all the time as it would be too expensive.

Currently, I have an automated solution using the 'Tasker' app on my Android phone. This turns the heating on for 30 mins if the temperature goes below 12 and turns the cooling on for 30 mins if the temperature goes above 26. This does work OK, but I've been trying to migrate all my home automation to RPi/Domoticz.

As I said in a post above, I have got a script running which checks the Tado temperature and updates a virtual temperature sensor in Domoticz. The bit I have been struggling with is how to set the temperature and turn on heating/cooling via a script.

I thought I was making progress recently. I found out how to send an HTTP PUT command via the command line on the RPi using curl. However, I keep getting authentication problems even though I can send exactly the same command via the Chrome Advanced Rest Client successfully.

From other research (http://blog.scphillips.com/posts/2016/01/the-tado-api/), it appears you have to log in before sending any requests to the API. I have drawn a blank about how to do this all via a script. If anyone has any pointers, they would be much appreciated.
User avatar
groetg
Posts: 39
Joined: Tuesday 06 January 2015 20:41
Target OS: Raspberry Pi / ODroid
Domoticz version: V2.4025
Location: Heerhugowaard, Holland
Contact:

Re: [677] Tado thermostat

Post by groetg »

I used the script of Webspider: https://github.com/WebSpider/tado_domoticz

Recently this stopped working, probably because Tado changed the API location, as you can read here: http://blog.scphillips.com/posts/2017/0 ... do-api-v2/

When I now ssh a the command to run:

Code: Select all

tado_heathum.py
I get the error in SSH: We failed to open "https://my.tado.com/j_spring_security_c ... rname=xxxx ".
We failed with error code - 404.

Can anybody help to get the script running again?
Master: RPI Model 2B
Sub 1: RPI Model 2B
RFX transmitter/receiver 433 Mhz
13 KAKU units (3 window sensors, 1 door sensor, 7 light switches, 1 dusk sensor, 1 motion sensor)
4 IP cam
Meteostick
OTGW
P1 cable
Davis Vantage Pro weatherstation (incl. solar/UV)
gavacac
Posts: 12
Joined: Tuesday 06 December 2016 20:57
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: [677] Tado thermostat

Post by gavacac »

Same problem. Mine stopped working on 16th Jan. Hadn't got round to working out why but if they've changed the API that would make sense.
rjblake
Posts: 142
Joined: Friday 21 October 2016 9:25
Target OS: NAS (Synology & others)
Domoticz version:
Location: Netherlands
Contact:

Re: [677] Tado thermostat

Post by rjblake »

groetg wrote:I used the script of Webspider: https://github.com/WebSpider/tado_domoticz

Recently this stopped working, probably because Tado changed the API location, as you can read here: http://blog.scphillips.com/posts/2017/0 ... do-api-v2/

When I now ssh a the command to run:

Code: Select all

tado_heathum.py
I get the error in SSH: We failed to open "https://my.tado.com/j_spring_security_c ... rname=xxxx ".
We failed with error code - 404.

Can anybody help to get the script running again?
I don't have a Tado (although I'm looking at replacing my Toon with one); but there is an update/modification to the interface.py located here that might help solve your problem https://github.com/eblekkenhorst/PyTado ... terface.py
rjblake
Posts: 142
Joined: Friday 21 October 2016 9:25
Target OS: NAS (Synology & others)
Domoticz version:
Location: Netherlands
Contact:

Re: [677] Tado thermostat

Post by rjblake »

groetg wrote:I used the script of Webspider: https://github.com/WebSpider/tado_domoticz

Recently this stopped working, probably because Tado changed the API location, as you can read here: http://blog.scphillips.com/posts/2017/0 ... do-api-v2/

When I now ssh a the command to run:

Code: Select all

tado_heathum.py
I get the error in SSH: We failed to open "https://my.tado.com/j_spring_security_c ... rname=xxxx ".
We failed with error code - 404.

Can anybody help to get the script running again?
Are you just looking to update the Temp & Humidity values in Domoticz, or control setpoint as well? If just the temp and humidity, I have a quick and dirty PHP script to do that https://github.com/rjblake/tado
timop
Posts: 57
Joined: Sunday 03 January 2016 17:10
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: [677] Tado thermostat

Post by timop »

Hi rjblake,
I tested your php script and when running it says:
"Token Age: 1490382015 | PHP Fatal error: Call to undefined function curl_init() in /home/pi/domoticz/scripts/tado.php on line 82"

and line 82 is: "$ch = curl_init();"

am I missing something packages?
I havent set setpoint device in domoticz because I didnt understand how to add it so its just
$tado_setpointIDX = "";

edit: I found repair from internet :)
installing php5-curl solved problem

how often do you run this script (and in crontab) ?
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest