Page 1 of 4

Netatmo thermostat support

Posted: Wednesday 10 June 2015 10:25
by joske522
Hi guys,

Does anyone know how to integrate the Netatmo thermostat into Domoticz?

There is an API available: https://dev.netatmo.com/doc/devices/thermostat

Thanks in advance!

Re: Netatmo thermostat support

Posted: Thursday 18 June 2015 17:36
by leplan73
Hi,

Working on a native support !

I will keep you posted

Seb

Re: Netatmo thermostat support

Posted: Tuesday 23 June 2015 19:23
by gizmocuz
joske522 wrote:Hi guys,

Does anyone know how to integrate the Netatmo thermostat into Domoticz?

There is an API available: https://dev.netatmo.com/doc/devices/thermostat

Thanks in advance!
Send you a PM

Re: Netatmo thermostat support

Posted: Friday 10 July 2015 8:49
by joske522
Thanks guys! :-)

Re: Netatmo thermostat support

Posted: Tuesday 14 July 2015 12:16
by umbr3lla
Hi, did you manage to get your Netatmo Thermostat linked with Domoticz. I also have a netatmo thermostat and would like to the same.

Any help would be great.

Thanks

Re: Netatmo thermostat support

Posted: Sunday 09 August 2015 11:34
by gizmocuz
Just add it from the hardware settings, and supply your username/password

Re: Netatmo thermostat support

Posted: Sunday 16 August 2015 19:16
by mcflyyy
Any news on native support ?

Re: Netatmo thermostat support

Posted: Thursday 17 September 2015 12:53
by umbr3lla
gizmocuz wrote:Just add it from the hardware settings, and supply your username/password
This is only for if you have Netatmo Weatherstation.

Still waiting support for the thermostat device.

Re: Netatmo thermostat support

Posted: Tuesday 20 October 2015 21:59
by toutazimuth
Hi
No news about the support of Netatmo thermostat ?
I'm very interesting about this support by Domoticz, for this new heating season.
Btw, the Domoticz support of the Netatmo weather station is so perfect ;)
Thx

Re: Netatmo thermostat support

Posted: Saturday 07 November 2015 10:40
by gizmocuz
If someone can send me PM with there login details, i can have a look at implementing support for this

Re: Netatmo thermostat support

Posted: Tuesday 10 November 2015 8:42
by toutazimuth
For me, this is the same account and password for netatmo station weather and netatmo thermostat.
For information, the team netatamo weather station and Domoticz, is currently perfect.

Thx for your amazing work

Re: Netatmo thermostat support

Posted: Tuesday 10 November 2015 11:05
by Mommeke
Did you get an account login already from somebody, to work on implementation?
If not, I'm prepared to provide mine...

For now I'm controlling my netatmo thermostat through shell scripts (via domotiga and smartvisu)
It seems to work although I'm not using the refreshtoken (cause I'm not sure how), so I think the authentication part is not the best way.
Also I'm not a bash nor json expert. So I'm sure this could be written a lot better. But it all works...
Sharing this anyway, maybe it helps people to do more with their thermostat. It's an example how the api can be called.
Feel free to comment and improve.

client_id and client_secret can be retrieved from dev.netatmo.com when you 'create an app'
device_id and module_id were found in the data reply (written to /tmp/netatmo_data)
email and pass are the ones used for logging in to the thermostat webinterface.
Obviously I replaced the real values with dummy ones for this post.


away.sh: execute 'away.sh On' to enable away mode on the thermostat

Code: Select all

#!/bin/bash
#request token
curl -s -d "grant_type=password&client_id=12345&client_secret=6789&[email protected]&password=somepassword&scope=read_thermostat write_thermostat" "https://api.netatmo.net/oauth2/token" >/tmp/netatmo_token
#extract token values
access=`jq -r '.access_token' /tmp/netatmo_token`
refresh=`jq -r '.refresh_token' /tmp/netatmo_token`
#use token to request data
curl -s -d "access_token=$access" "https://api.netatmo.net/api/getthermostatsdata" >/tmp/netatmo_data
#extract data values
#this line seems to work best if not set to manual
setpoint=`jq -r '[.body.devices[].modules[].measured.setpoint_temp] | unique | .[]' /tmp/netatmo_data`
#this line seems better when set to manual mode, else the step up or down is calculated with a previous set value instead of the most current value. still have to figure this out better.
#setpoint=`jq -r '[.body.devices[].modules[].setpoint.setpoint_temp] | unique | .[]' /tmp/netatmo_data`
temp=`jq -r '[.body.devices[].modules[].measured.temperature] | unique | .[]' /tmp/netatmo_data`
mode=`jq -r '[.body.devices[].modules[].setpoint.setpoint_mode] | .[]' /tmp/netatmo_data`
# echo some values
if [ "$mode" == "away" ]
then status="On"
else
status="Off"
fi
echo "$status"
echo "$setpoint"
echo "$temp"
#switch
if [ "$1" == "On" ]
then
#set to away
curl -s -d "access_token=$access&device_id=70:ee:50:12:34:56&module_id=04:00:00:12:34:56&setpoint_mode=away" "https://api.netatmo.net/api/setthermpoint" >/dev/null
fi
replace setpoint_mode=away with setpoint_mode=program for normal operation (follows your schedule) or with setpoint_mode=hg for antifrost. Adjust the

Code: Select all

if [ "$mode" == "away" ]
line accordingly.


this script sets the desired temperature 0,5 degrees celcius higher for one hour: execute as "up.sh On"

Code: Select all

#!/bin/bash
#request token
curl -s -d "grant_type=password&client_id=12345&client_secret=6789&[email protected]&password=somepassword&scope=read_thermostat write_thermostat" "https://api.netatmo.net/oauth2/token" >/tmp/netatmo_token
#extract token values
access=`jq -r '.access_token' /tmp/netatmo_token`
refresh=`jq -r '.refresh_token' /tmp/netatmo_token`
#use token to request data
curl -s -d "access_token=$access" "https://api.netatmo.net/api/getthermostatsdata" >/tmp/netatmo_data
#extract data values
#setpoint=`jq -r '[.body.devices[].modules[].measured.setpoint_temp] | unique | .[]' /tmp/netatmo_data`
setpoint=`jq -r '[.body.devices[].modules[].setpoint.setpoint_temp] | unique | .[]' /tmp/netatmo_data`
temp=`jq -r '[.body.devices[].modules[].measured.temperature] | unique | .[]' /tmp/netatmo_data`
mode=`jq -r '[.body.devices[].modules[].setpoint.setpoint_mode] | .[]' /tmp/netatmo_data`
tijd=`jq -r '[.body.devices[].modules[].measured.time] | unique | .[]' /tmp/netatmo_data`
# echo some values
if [ "$mode" == "manual" ]
then status="On"
else
status="Off"
fi
echo "$status"
echo "$setpoint"
echo "$temp"
#switch
if [ "$1" == "On" ]
then
#calculate new temp
step="0.5"
newtemp=`echo "($setpoint + $step)" | bc`
#endtime
end=`date -d '+1 hour' "+%s"`
#increase temp
curl -s -d "access_token=$access&device_id=70:ee:50:12:34:56&module_id=04:00:00:12:34:56&setpoint_mode=manual&setpoint_temp=$newtemp&setpoint_endtime=$end" "https://api.netatmo.net/api/setthermpoint"
fi
to lower the temperature instead, you can use almost the same script but replace the + with a -

Code: Select all

newtemp=`echo "($setpoint - $step)" | bc`
more options and documentation at https://dev.netatmo.com/doc

Re: Netatmo thermostat support

Posted: Tuesday 10 November 2015 19:43
by DomoArie
Hi, I am wondering where this very good start of getting Netatmo thermostat integrated into Domoticz is at the moment.
I am considering buying this piece, but would like to steer it from my RBpi2 with Domoticz.
@Mommeke did put some interesting scripting material in this topic, but I noticed @gizmocuz was also active here... Any news and advise?

Re: Netatmo thermostat support

Posted: Wednesday 11 November 2015 7:21
by sbebrone
Hi,

I've submitted a PR to support this hardware last night:
https://github.com/domoticz/domoticz/pull/188

Following features are supported:
  • Temperature sensor
    Set point switch
Should be easy to add support for "away" mode switch.

Hope it'll get to the main repo soon. Feeback are more than welcome :)

Gtz,
Stéphane.

Re: Netatmo thermostat support

Posted: Wednesday 11 November 2015 9:21
by gizmocuz
sbebrone wrote:Hi,

I've submitted a PR to support this hardware last night:
https://github.com/domoticz/domoticz/pull/188

Following features are supported:
  • Temperature sensor
    Set point switch
Should be easy to add support for "away" mode switch.

Hope it'll get to the main repo soon. Feeback are more than welcome :)

Gtz,
Stéphane.
Hello Stephane,

Thank you very much for the hard work, left a bit feedback on github

Is it possible to send me a PM with the credentials so i can test it ? I think i want to merge this code in the existing netatmo class, and maybe if needed add a special constructor so we can differentiate it

Re: Netatmo thermostat support

Posted: Wednesday 11 November 2015 22:51
by course66
Hi gizmocuz,

if you need user/password to test netatmo thermostat over domoticz I can provide it to you.

ciao,
gabriele

Re: Netatmo thermostat support

Posted: Thursday 12 November 2015 18:32
by gizmocuz
course66 wrote:Hi gizmocuz,

if you need user/password to test netatmo thermostat over domoticz I can provide it to you.

ciao,
gabriele
I am also working on this with Stephane, but yes this would help a lot (double testing), send you a PM

Thanks in advance

Re: Netatmo thermostat support

Posted: Thursday 12 November 2015 23:05
by qqlapraline
I own a Netatmo thermostat and would be happy to help.
I guess I have to explicitely get the sources, recompile and run it ?
If this is the case, it will want for next weekend or the week after.

As I understand this is done as a new hardware, would that be possible to merge to the trunk so that I can't get this and try it ?
Regards.

QQ.

Re: Netatmo thermostat support

Posted: Saturday 14 November 2015 13:26
by gizmocuz
I think it should work now in the latest beta version

Re: Netatmo thermostat support

Posted: Saturday 14 November 2015 20:37
by course66
Yes, it works: thermostat temperature, away switch and set-point (only minor issues with set-point)

ciao,
gabriele