Page 1 of 3
[677] Tado thermostat
Posted: Friday 01 January 2016 23:26
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}
Re: Tado thermostat
Posted: Saturday 02 January 2016 20:33
by groetg
I am also intersted!
- Knipsel2.PNG (54.74 KiB) Viewed 12467 times
Re: Tado thermostat
Posted: Monday 04 January 2016 1:04
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
Re: Tado thermostat
Posted: Monday 04 January 2016 22:57
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¶m=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)
Re: Tado thermostat
Posted: Tuesday 05 January 2016 14:09
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??
Re: Tado thermostat
Posted: Sunday 10 January 2016 10:48
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.
Re: [677] Tado thermostat
Posted: Thursday 10 November 2016 12:14
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
Re: [677] Tado thermostat
Posted: Thursday 17 November 2016 12:53
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.
Re: [677] Tado thermostat
Posted: Thursday 24 November 2016 11:02
by fluxcapacitor
This is an English forum so let me translate your post:
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?
Re: [677] Tado thermostat
Posted: Sunday 27 November 2016 10:49
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!
Re: [677] Tado thermostat
Posted: Thursday 22 December 2016 12:16
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
Re: [677] Tado thermostat
Posted: Thursday 22 December 2016 22:29
by pollefinario
I'm very interested in this also.
Wouldn't it be possible to make this a "native" domoticz device?
Re: [677] Tado thermostat
Posted: Wednesday 11 January 2017 11:40
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
Re: [677] Tado thermostat
Posted: Wednesday 11 January 2017 12:19
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.
Re: [677] Tado thermostat
Posted: Wednesday 11 January 2017 12:43
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.
Re: [677] Tado thermostat
Posted: Tuesday 24 January 2017 14:32
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:
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?
Re: [677] Tado thermostat
Posted: Tuesday 24 January 2017 15:33
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.
Re: [677] Tado thermostat
Posted: Saturday 28 January 2017 13:30
by rjblake
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
Re: [677] Tado thermostat
Posted: Friday 24 February 2017 23:04
by rjblake
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
Re: [677] Tado thermostat
Posted: Friday 24 March 2017 20:04
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) ?