NEST Account migration

For heating/cooling related questions in Domoticz

Moderator: leecollings

Post Reply
User avatar
rolandbreedveld
Posts: 156
Joined: Wednesday 09 March 2016 11:25
Target OS: Raspberry Pi / ODroid
Domoticz version: 2021.1
Contact:

Re: NEST Account migration

Post by rolandbreedveld »

jeroenkl wrote: Saturday 08 February 2020 19:44 PHP Fatal error: Uncaught Error: Call to undefined function curl_init() in /home/pi/nest-api/nest.class.php:1256
Hi Jeroen
answer is simple your missing php-curl, php5-curl or php7-curl, depending of your php version
sudo apt install ....
succes,Roland
Raspberry Pi(SSD)+UPS HAT,Dashticz on WallTablet,HomeBridge, P1, HarmonyHub,FritzBox,API to 123Solar+ABB-PowerOne+SMA,ESP-Leds(flashed LSC),Tasmota,Shelly,MQTT,Mosquito,Node-Red,http://wiki.breedveld.net/index.php?title=RPiWaterMeter, Mercedes-Me
jeroenkl
Posts: 113
Joined: Sunday 14 July 2013 22:00
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: NL
Contact:

Re: NEST Account migration

Post by jeroenkl »

rolandbreedveld wrote: Saturday 08 February 2020 21:58
jeroenkl wrote: Saturday 08 February 2020 19:44 PHP Fatal error: Uncaught Error: Call to undefined function curl_init() in /home/pi/nest-api/nest.class.php:1256
Hi Jeroen
answer is simple your missing php-curl, php5-curl or php7-curl, depending of your php version
sudo apt install ....
succes,Roland
Thanks!
Yes indeed, need to install it ;-)


pi@raspberrypi:~ $ php -v
PHP 7.3.11-1~deb10u1 (cli) (built: Oct 26 2019 14:14:18) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.11, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.3.11-1~deb10u1, Copyright (c) 1999-2018, by Zend Technologies

pi@raspberrypi:~ $ sudo apt install php-curl

I've got only a nest protect, should your script run properly?

BR,
Jeroen
mark.sellwood
Posts: 101
Joined: Tuesday 04 March 2014 10:33
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Surrey, UK
Contact:

Re: NEST Account migration

Post by mark.sellwood »

Hi, Sorry to hijack this, but its related.
Does this script do anything with Nest Hello Doorbells?
3 x Pi, 1 Master, 2 Slaves, 1x Aeotec Z-Stick S2, 4xSP103 PIR, 5xPowerNode 1, 1xSmart Energy Switch Gen5, 4xFGSS101 Smoke Sensor, 2xFGD212, 9xFGS212 , 7xFGS221/2, 1xAD142 , 1xTKB TZ68E , 2xAeotec Multi Sensor, 3 x NodOn CRC-3-1-00.
User avatar
rolandbreedveld
Posts: 156
Joined: Wednesday 09 March 2016 11:25
Target OS: Raspberry Pi / ODroid
Domoticz version: 2021.1
Contact:

Re: NEST Account migration

Post by rolandbreedveld »

mark.sellwood wrote: Sunday 09 February 2020 11:16 Hi, Sorry to hijack this, but its related.
Does this script do anything with Nest Hello Doorbells?
Also @jeroenkl
If the script
php nest-api.php
gives the output of your devices, it can be easily added, I only have a NestV3, so I can’t see it.
A doorbell however needs quick response, I don’t know these, the initiation to Domoticz should come from it, perhaps someone knows how these works.
Raspberry Pi(SSD)+UPS HAT,Dashticz on WallTablet,HomeBridge, P1, HarmonyHub,FritzBox,API to 123Solar+ABB-PowerOne+SMA,ESP-Leds(flashed LSC),Tasmota,Shelly,MQTT,Mosquito,Node-Red,http://wiki.breedveld.net/index.php?title=RPiWaterMeter, Mercedes-Me
Vomera
Posts: 184
Joined: Wednesday 06 September 2017 9:11
Target OS: Linux
Domoticz version:
Contact:

Re: NEST Account migration

Post by Vomera »

Hi Guys,

nice to see there is solution for the nest thermostat.

I was wondering if the Google Nest Thermostat E is also supported with the script.

All i can see in the logging is, number of NEST Devices:

Code: Select all

20-02-12 15:40:39.234 (Nest) Processing 'onHeartbeatCallback' message
2020-02-12 15:40:39.234 (Nest) Calling message handler 'onHeartbeat'.
2020-02-12 15:40:39.234 (Nest) onHeartbeat called
2020-02-12 15:40:39.234 (Nest) onHeartbeat called, run again in 4 heartbeats.
2020-02-12 15:40:39.234 (Nest) Number of NEST devices: 0
2020-02-12 15:40:49.225 (Nest) Pushing 'onHeartbeatCallback' on to queue
2020-02-12 15:40:49.250 (Nest) Processing 'onHeartbeatCallback' message
2020-02-12 15:40:49.250 (Nest) Calling message handler 'onHeartbeat'.
2020-02-12 15:40:49.250 (Nest) onHeartbeat called
2020-02-12 15:40:49.251 (Nest) onHeartbeat called, run again in 3 heartbeats.
2020-02-12 15:40:59.226 (Nest) Pushing 'onHeartbeatCallback' on to queue
2020-02-12 15:40:59.267 (Nest) Processing 'onHeartbeatCallback' message
2020-02-12 15:40:59.269 (Nest) Calling message handler 'onHeartbeat'.
2020-02-12 15:40:59.269 (Nest) onHeartbeat called
2020-02-12 15:40:59.269 (Nest) onHeartbeat called, run again in 2 heartbeats.
2020-02-12 15:41:09.230 (Nest) Pushing 'onHeartbeatCallback' on to queue
2020-02-12 15:41:09.236 (Nest) Processing 'onHeartbeatCallback' message
2020-02-12 15:41:09.236 (Nest) Calling message handler 'onHeartbeat'.
2020-02-12 15:41:09.236 (Nest) onHeartbeat called
2020-02-12 15:41:09.236 (Nest) onHeartbeat called, run again in 1 heartbeats.
2020-02-12 15:41:19.232 (Nest) Pushing 'onHeartbeatCallback' on to queue
2020-02-12 15:41:19.252 (Nest) Processing 'onHeartbeatCallback' message
2020-02-12 15:41:19.252 (Nest) Calling message handler 'onHeartbeat'.
2020-02-12 15:41:19.252 (Nest) onHeartbeat called
2020-02-12 15:41:19.253 (Nest) Start thread
2020-02-12 15:41:19.253 (Nest) Thread: GetNestCredentials done
2020-02-12 15:41:19.816 (Nest) Thread: GetDevicesAndStatus done
2020-02-12 15:41:19.816 (Nest) End threa
I changed the token and cookie value in the nest.py

edit: when i call it with python3 nest.py nothing happends
Joncho
Posts: 2
Joined: Thursday 14 November 2019 10:55
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.10717
Location: Netherlands
Contact:

Re: NEST Account migration

Post by Joncho »

So I read the news today about Google forcing to use 2FA login for its Nest products. Does this mean this solution willl become useless as well?
User avatar
heggink
Posts: 972
Joined: Tuesday 08 September 2015 21:44
Target OS: Raspberry Pi / ODroid
Domoticz version: 12451
Location: NL
Contact:

Re: NEST Account migration

Post by heggink »

I sincerely hope not. If that happens, we should all send our products back to Google. It's been s constant struggle with my thermostat. One more issue and I will call it quits and buy something else.

Sent from phone.

Docker in Truenas scale, close to latest beta
DASHTICZ 🙃
RFXCOM, zwavejs2mqtt, zigbee2mqtt,
P1 meter & solar panel
Google home, Wifi Cams motion detection
Geofence iCloud, Bluetooth & Wifi ping
Harmony hub, Nest, lots more :-)
Marcello1970
Posts: 9
Joined: Thursday 20 March 2014 15:33
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Hasselt, The Netherlands
Contact:

Re: NEST Account migration

Post by Marcello1970 »

Is it possible to chance the location of the temporary files. I use a RAM drive on my Raspberry, so I prefer that the files be stored there. It would be nice its a option in the nest_devices.cfg file.

An other issue is that I have manually chance the rights of the both temporary files to make the scripts work. After an update I have to do it again.
Would you know what that could be?
User avatar
rolandbreedveld
Posts: 156
Joined: Wednesday 09 March 2016 11:25
Target OS: Raspberry Pi / ODroid
Domoticz version: 2021.1
Contact:

Re: NEST Account migration

Post by rolandbreedveld »

Marcello1970 wrote: Thursday 20 February 2020 18:23 Is it possible to chance the location of the temporary files. I use a RAM drive on my Raspberry, so I prefer that the files be stored there. It would be nice its a option in the nest_devices.cfg file.

An other issue is that I have manually chance the rights of the both temporary files to make the scripts work. After an update I have to do it again.
Would you know what that could be?
Hi Marcello
this is a standard php option:
/etc/php5/cli/php.ini for command line interface (/etc/php5/apache2/php.ini for use from apache
sys_temp_dir = "/tmp" <<< this is the one
soap.wsdl_cache_dir="/tmp" <<< better change this one too

for the 2nd question, that happens if you run the script from different accounts, example you test it with "root", while Domoticz is running as user "pi"
so if you test with a different user, don't forget to remove the cachefiles. ( rm -f /tmp/nest_php* , or rm -f /var/tmp/nest_php* )

suc6!
Raspberry Pi(SSD)+UPS HAT,Dashticz on WallTablet,HomeBridge, P1, HarmonyHub,FritzBox,API to 123Solar+ABB-PowerOne+SMA,ESP-Leds(flashed LSC),Tasmota,Shelly,MQTT,Mosquito,Node-Red,http://wiki.breedveld.net/index.php?title=RPiWaterMeter, Mercedes-Me
dens1975
Posts: 26
Joined: Monday 12 February 2018 17:03
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: NEST Account migration

Post by dens1975 »

Hi,

First of all thanks for this api/script. It looks like it almost works for me. I can switch the switches and set the temperature. Only thing is that my temperature and humidity isn't updated in my Domoticz devices. I'm on a Synology NAS.

when I excecute get_nest.sh I get the output:
Update TEMP to 20.2
Update HUMIDITY to 45.0
Update SETPOINT to 19.5

What I'm I missing?
User avatar
rolandbreedveld
Posts: 156
Joined: Wednesday 09 March 2016 11:25
Target OS: Raspberry Pi / ODroid
Domoticz version: 2021.1
Contact:

Re: NEST Account migration

Post by rolandbreedveld »

dens1975 wrote: Friday 21 February 2020 16:22 Hi,

First of all thanks for this api/script. It looks like it almost works for me. I can switch the switches and set the temperature. Only thing is that my temperature and humidity isn't updated in my Domoticz devices. I'm on a Synology NAS.

when I excecute get_nest.sh I get the output:
Update TEMP to 20.2
Update HUMIDITY to 45.0
Update SETPOINT to 19.5

What I'm I missing?
what if you update it manually, here for the temperature? : (replace IDX and VALUE)
curl -X GET "http://127.0.0.1:8080/json.htm?type=com ... alue=VALUE"
Raspberry Pi(SSD)+UPS HAT,Dashticz on WallTablet,HomeBridge, P1, HarmonyHub,FritzBox,API to 123Solar+ABB-PowerOne+SMA,ESP-Leds(flashed LSC),Tasmota,Shelly,MQTT,Mosquito,Node-Red,http://wiki.breedveld.net/index.php?title=RPiWaterMeter, Mercedes-Me
dens1975
Posts: 26
Joined: Monday 12 February 2018 17:03
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: NEST Account migration

Post by dens1975 »

ok, thanks! I now see what's wrong. It's looking for my domoticz on port 8080 but mine is on 8084. I changed all port numbers in get_nest.sh and now it's working.
User avatar
rolandbreedveld
Posts: 156
Joined: Wednesday 09 March 2016 11:25
Target OS: Raspberry Pi / ODroid
Domoticz version: 2021.1
Contact:

Re: NEST Account migration

Post by rolandbreedveld »

dens1975 wrote: Friday 21 February 2020 16:37 ok, thanks! I now see what's wrong. It's looking for my domoticz on port 8080 but mine is on 8084. I changed all port numbers in get_nest.sh and now it's working.
in the following version it will be configurable:
https://github.com/rolandbreedveld/nest-api/
Raspberry Pi(SSD)+UPS HAT,Dashticz on WallTablet,HomeBridge, P1, HarmonyHub,FritzBox,API to 123Solar+ABB-PowerOne+SMA,ESP-Leds(flashed LSC),Tasmota,Shelly,MQTT,Mosquito,Node-Red,http://wiki.breedveld.net/index.php?title=RPiWaterMeter, Mercedes-Me
User avatar
heggink
Posts: 972
Joined: Tuesday 08 September 2015 21:44
Target OS: Raspberry Pi / ODroid
Domoticz version: 12451
Location: NL
Contact:

Re: NEST Account migration

Post by heggink »

My cookie expired a couple of days ago. I now check so I can get the new cookie as soon as it expires. Took a few weeks...

Sent from phone.

Docker in Truenas scale, close to latest beta
DASHTICZ 🙃
RFXCOM, zwavejs2mqtt, zigbee2mqtt,
P1 meter & solar panel
Google home, Wifi Cams motion detection
Geofence iCloud, Bluetooth & Wifi ping
Harmony hub, Nest, lots more :-)
User avatar
rolandbreedveld
Posts: 156
Joined: Wednesday 09 March 2016 11:25
Target OS: Raspberry Pi / ODroid
Domoticz version: 2021.1
Contact:

Re: NEST Account migration

Post by rolandbreedveld »

heggink wrote: Sunday 23 February 2020 20:52 My cookie expired a couple of days ago. I now check so I can get the new cookie as soon as it expires. Took a few weeks...

Sent from phone.
I started it on 16-jan and never had to change the cookie, perhaps if the system is not running for a while, the cookie and or token will become invalid.
Raspberry Pi(SSD)+UPS HAT,Dashticz on WallTablet,HomeBridge, P1, HarmonyHub,FritzBox,API to 123Solar+ABB-PowerOne+SMA,ESP-Leds(flashed LSC),Tasmota,Shelly,MQTT,Mosquito,Node-Red,http://wiki.breedveld.net/index.php?title=RPiWaterMeter, Mercedes-Me
Ptje
Posts: 73
Joined: Sunday 06 March 2016 23:56
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: Schaijk
Contact:

Re: NEST Account migration

Post by Ptje »

Hello,

I'm jealous at everybody who has it work. I tried for a long time, but I can't get it done. In the past I used my Nest for heatpump, airco and normal heating. Now it is useless for me and I consider to buy another thermostaat.

There is no example or something what in detail is the cookie and token ?

Greetings,
Peter
User avatar
rolandbreedveld
Posts: 156
Joined: Wednesday 09 March 2016 11:25
Target OS: Raspberry Pi / ODroid
Domoticz version: 2021.1
Contact:

Re: NEST Account migration

Post by rolandbreedveld »

Ptje wrote: Monday 24 February 2020 14:21 Hello,

I'm jealous at everybody who has it work. I tried for a long time, but I can't get it done. In the past I used my Nest for heatpump, airco and normal heating. Now it is useless for me and I consider to buy another thermostaat.

There is no example or something what in detail is the cookie and token ?

Greetings,
Peter
if you follow the readme step by step you'll find out.
https://github.com/rolandbreedveld/nest-api
Raspberry Pi(SSD)+UPS HAT,Dashticz on WallTablet,HomeBridge, P1, HarmonyHub,FritzBox,API to 123Solar+ABB-PowerOne+SMA,ESP-Leds(flashed LSC),Tasmota,Shelly,MQTT,Mosquito,Node-Red,http://wiki.breedveld.net/index.php?title=RPiWaterMeter, Mercedes-Me
Ptje
Posts: 73
Joined: Sunday 06 March 2016 23:56
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: Schaijk
Contact:

Re: NEST Account migration

Post by Ptje »

Hello,

cookie: OCAK=1FQYSpvNpDvkUp-kot-5ATrHc5cTEOckawg_osZKBM0; <<<< I have to leave this away ?
This is the start from te cookie ? >>>>>>>>>SID=uAdtxYOIwIyzFOewOlDSbmnEJ

Greetings,

Peter
User avatar
rolandbreedveld
Posts: 156
Joined: Wednesday 09 March 2016 11:25
Target OS: Raspberry Pi / ODroid
Domoticz version: 2021.1
Contact:

Re: NEST Account migration

Post by rolandbreedveld »

Ptje wrote: Monday 24 February 2020 16:53 Hello,

cookie: OCAK=1FQYSpvNpDvkUp-kot-5ATrHc5cTEOckawg_osZKBM0; <<<< I have to leave this away ?
This is the start from te cookie ? >>>>>>>>>SID=uAdtxYOIwIyzFOewOlDSbmnEJ

Greetings,

Peter
you need the complete data from the cookie field, it's a long string starts with XXXX= (OCAK in your case), don't forget to terminate it with ';
be shure take it from the "Request Headers" part
Raspberry Pi(SSD)+UPS HAT,Dashticz on WallTablet,HomeBridge, P1, HarmonyHub,FritzBox,API to 123Solar+ABB-PowerOne+SMA,ESP-Leds(flashed LSC),Tasmota,Shelly,MQTT,Mosquito,Node-Red,http://wiki.breedveld.net/index.php?title=RPiWaterMeter, Mercedes-Me
Ptje
Posts: 73
Joined: Sunday 06 March 2016 23:56
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: Schaijk
Contact:

Re: NEST Account migration

Post by Ptje »

Hello Roland,

What do you mean with terminate ? Do I have to remove the ' ?

Greetings
Peter
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest