NEST Account migration

For heating/cooling related questions in Domoticz

Moderator: leecollings

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,

Does someone has any idea what my problem is. I have tried for days, but I can't get it work. I only get this.

2020-01-16 00:14:53.597 (Schaijk) Pushing 'onHeartbeatCallback' on to queue
2020-01-16 00:14:53.637 (Schaijk) Processing 'onHeartbeatCallback' message
2020-01-16 00:14:53.637 (Schaijk) Calling message handler 'onHeartbeat'.
2020-01-16 00:14:53.637 (Schaijk) onHeartbeat called
2020-01-16 00:14:53.637 (Schaijk) onHeartbeat called, run again in 28 heartbeats

I have read this topic several times, but I don's see what I'm doing wrong. Can somebody help ?

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 »

can't get the plugin working, Domoticz hangs after some minutes.
So waiting for official Domoticz Nest-Google support, I used the original php code from https://github.com/gboudreau/nest-api
created some virtual devices: switches, temp, Humidity and setpoind, build a unix cron-script arround it to update the device via the Domoticz json api.
also a a trigger script to enter eco-mode if no one is at home, and a dzVents event to change the setpoint

works pretty fine!

if you'r like it, code is below
Nest with Google account.png
Nest with Google account.png (88.4 KiB) Viewed 9915 times
Attachments
nest-api.tgz
(241.96 KiB) Downloaded 91 times
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 »

Hi Roland,
You missed one hardcoded idx in your script for setting the setpoint.
Since I needed the Eco mode switch, this is very helpful! Many thanks as well.
H
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: Thursday 16 January 2020 23:59 Hi Roland,
You missed one hardcoded idx in your script for setting the setpoint.
Since I needed the Eco mode switch, this is very helpful! Many thanks as well.
H
Hi Heggink, which one are you missing?
both setpoint and eco-mode are there, I both use them,
set-point will trigger a dzvents script, which calls a phpfile to set the set-point, see the readme
the eco-mode switch self starts the enable/disable scripts, see the pictures and the readme
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
rmoria
Posts: 8
Joined: Saturday 17 November 2018 17:40
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.10717
Location: Alkmaar, the Netherlands
Contact:

Re: NEST Account migration

Post by rmoria »

I get the following:

Code: Select all

PHP Fatal error:  Uncaught Error: Call to undefined function curl_init() in /home/pi/domoticz/scripts/nest-api/nest.class.php:1256
Stack trace:
#0 /home/pi/domoticz/scripts/nest-api/nest.class.php(1224): Nest->doRequest('GET', 'https://accoun...', NULL, true, Array)
#1 /home/pi/domoticz/scripts/nest-api/nest.class.php(1089): Nest->doGET('https://accoun...', Array)
#2 /home/pi/domoticz/scripts/nest-api/nest.class.php(124): Nest->login()
#3 /home/pi/domoticz/scripts/nest-api/get_nest.php(19): Nest->__construct(NULL, NULL, 'https://accoun...', 'OCAK=YXe7kE9rdi...')
#4 {main}
  thrown in /home/pi/domoticz/scripts/nest-api/nest.class.php on line 1256
Got $issue_token and $cookies as instructed

Code: Select all

$issue_token = 'https://accounts.google.com/o/oauth2/iframerpc?action=issueToken&response_type=token%20id_token&login_hint=AJDLjxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxHgtbA&client_id=733xxxxxxxxxxxxxxxxxxxxxxxxxxxxxrq.apps.googleusercontent.com&origin=https%3A%2F%2Fhome.nest.com&scope=openid%20profile%20email%20https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fnest-account&ss_domain=https%3A%2F%2Fhome.nest.com';

$cookies = 'OCAK=YXe7kE9rdiP1V-x_xxxxxxxxxxxxxxxxxxu4; SID=swfHHHpxxxxxxx-YSCLMxxxxxxxxxxxxxxxxxXy_mkWvjbFxxxxxxxxxxxxxxxxxxRQ.; __Secure-3PSID=swfHHHpVxxxxxxxxxxxxxxxxxiXy_mkWvjqY4a8e3Zxxxxxxxxxxxxw.; HSID=AOALvZYoUgVo4O9Rn; SSID=AEQ4aQav4D8mO411a; APISID=VNxxxxxxxxxxTPf-/AZkdHXik_9Pvtk6zr; SAPISID=K_jXxxxxxxxxxxxxxxxxxxxxxxxxxxvwp; __Secure-HSID=AOALxxxxxxxxxxn; __Secure-SSID=AExxxxxxxx411a; __Secure-APISID=VNP6xxxxxxxxx/AZkdHXik_9Pvtk6zr; __Secure-3PAPISID=K_jXOxxxxxxxxxxxxxxvwp; NID=196=HbxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxWQg72jBnkJv_bGcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxW2kFNyvogI1S-ZCn909xxxxxxxxx5_WnWXxxxxxxxxxxxxxxxxxrV8bNXwlcWM; CONSENT=YES+NL.nl+20151207-13-0; user_id=1xxxxxxxxxxxxxxxx; GAPS=1:o_PHSGxxxxxxxxxxxxxxxxxxxxxxxxxx3ILcqVdTQzxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxR0tOx_gS_AsU6xNveg:piJKoQwjcracw3k3; LSID=lso|s.NL|s.youtube:swfHHJIb6z6QvkV67CuOcxC1Z66EPAd-Z__UqXWMT9LKlokAI98tdshtXSGWwuRz2K3dlQ.; __Host-3PLSID=lso|s.NL|s.youtube:swfHHJIb6z6QvkV67CuOcxC1Z66EPAd-Z__UqXWMT9LKlokAJ1_PfLszcR9CrfLaB3WvHA.; ACCOUNT_CHOOSER=AFx_qI7n2OqzzcEcE-phsvO7ghFkIk0hoVwuU9MW6DuOkqshnryjnXG-giJg3iGnEccVcWgon0xB9qY059UF91qv0-7tdB3ikkcse_sElraYXBWkxqtFH3juy8ul23Qo3AylAOnPmcKO; SIDCC=AN0-TYsiA3N-V6jep5oxxxxxxxxxxxxxxxxxxxxxxxxxxxxDu0wh5A';
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 »

@rmoria

Dit you create your own token and cookie, as instructed on: https://github.com/FilipDem/Domoticz-NE ... ree/master ?
the ones in the delivered file are fake.
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 »

rolandbreedveld wrote:
heggink wrote: Thursday 16 January 2020 23:59 Hi Roland,
You missed one hardcoded idx in your script for setting the setpoint.
Since I needed the Eco mode switch, this is very helpful! Many thanks as well.
H
Hi Heggink, which one are you missing?
both setpoint and eco-mode are there, I both use them,
set-point will trigger a dzvents script, which calls a phpfile to set the set-point, see the readme
the eco-mode switch self starts the enable/disable scripts, see the pictures and the readme
The last device update in your shell script still used your hardcoded device ID (462?). I changed it myself to ${IDX}.

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 :-)
rmoria
Posts: 8
Joined: Saturday 17 November 2018 17:40
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.10717
Location: Alkmaar, the Netherlands
Contact:

Re: NEST Account migration

Post by rmoria »

Yes, I did. I just x-ed uit some stuff so I could post it.
Tried the keys from unrelated laptop and generated on my domoticz-pi3. All seem to have the same issue.

Is it possible to runwith just the google username/password ?
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 »

Thanxzz heggink
I understand, changed it together with some minor details.
Attachments
nest-api.tgz
(241.99 KiB) Downloaded 84 times
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
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 »

rmoria wrote: Friday 17 January 2020 16:45 Yes, I did. I just x-ed uit some stuff so I could post it.
Tried the keys from unrelated laptop and generated on my domoticz-pi3. All seem to have the same issue.

Is it possible to runwith just the google username/password ?
username and password is not possible, perhaps you missed a part of it, don't forget it is between quotes and ending with ;
$issue_token = 'xxxx';

But, looking at your error, I see you are missing some php packages, like php5-curl, If you install these, it should work:
apt-get install libapache2-mod-php5 libphp-adodb php-pear php5 php5-cli php5-common php5-curl php5-gd php5-json php5-mysql php5-readline curl
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
rmoria
Posts: 8
Joined: Saturday 17 November 2018 17:40
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.10717
Location: Alkmaar, the Netherlands
Contact:

Re: NEST Account migration

Post by rmoria »

Does it work with a newer version ? The sudo apt-get ... says there are no candidates for installation.
php -v gives :PHP 7.0.33-0+deb9u6 (cli) (built: Oct 24 2019 18:50:20)

Standard raspbian strech
tinushigh
Posts: 4
Joined: Friday 03 January 2020 20:29
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: NEST Account migration

Post by tinushigh »

tinushigh wrote: Wednesday 15 January 2020 16:29 Ok, in the First Place, Filip, thanks for all the work, both developping and supporting! Upvote/like/+1

Please, I am quite new to SSH / linux / python and Domoticz so I made a mistake and cant figure out what.
Symptom: about 2 minutes after roboot / restart, my Domoticz crashes with these 2 error messages:

Code: Select all

2020-01-15 16:24:12.654 Error: Domoticz(pid:1135, tid:1275('PluginMgr')) received fatal signal 6 (Aborted)
2020-01-15 16:24:12.655 Error: siginfo address=0x46f, address=(nil)
Question, where to start troubleshooting? How to solve this fatal error?

thanks in advance! A newbe
My PkuginMgr keeps crashing, right now your plugin is the only plugin I have installed. What do I do wrong?
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 »

rmoria wrote: Friday 17 January 2020 20:51 Does it work with a newer version ? The sudo apt-get ... says there are no candidates for installation.
php -v gives :PHP 7.0.33-0+deb9u6 (cli) (built: Oct 24 2019 18:50:20)

Standard raspbian strech
try php7.0-curl , think this is enough
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
tinushigh
Posts: 4
Joined: Friday 03 January 2020 20:29
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: NEST Account migration

Post by tinushigh »

rolandbreedveld wrote: Thursday 16 January 2020 12:25 can't get the plugin working, Domoticz hangs after some minutes.
So waiting for official Domoticz Nest-Google support, I used the original php code from https://github.com/gboudreau/nest-api
created some virtual devices: switches, temp, Humidity and setpoind, build a unix cron-script arround it to update the device via the Domoticz json api.
also a a trigger script to enter eco-mode if no one is at home, and a dzVents event to change the setpoint

works pretty fine!

if you'r like it, code is below

Nest with Google account.png
Dear Roland, I would love to get this working and copy your setup, unfortunately I'm so new to Domoticz that I need some explanation on how to install your setup. Do I use SSH? WinSCP? Where to put the files? I need some help with the first step.

Thanks in advance!
rmoria
Posts: 8
Joined: Saturday 17 November 2018 17:40
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.10717
Location: Alkmaar, the Netherlands
Contact:

Re: NEST Account migration

Post by rmoria »

rolandbreedveld wrote: Saturday 18 January 2020 12:12 try php7.0-curl , think this is enough
Yes, It works fine now ( after sudo apt-get install php7.0-curl)

Thanks
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 »

tinushigh wrote: Saturday 18 January 2020 21:11 Dear Roland, I would love to get this working and copy your setup, unfortunately I'm so new to Domoticz that I need some explanation on how to install your setup. Do I use SSH? WinSCP? Where to put the files? I need some help with the first step.

Thanks in advance!
pretty simple:
(on raspberry pi)
use winscp to copy the file to /home/pi
ssh to it
cd /home/pi
extract the file: tar xzvf nest-api.tgz
cd /home/pi/nest-api
be shure you have curl and php-curl:
look which php version you have: dpkg -l|grep php
sudo apt-get install php7.0-curl curl
or if you have php5:
sudo apt-get install php5-curl curl
follow the instructions from the README, and enclosed images
to create the Virtual Sensors, create in the Hardware menu "Dummy (Does nothing, use for virtual switches only)", after creating, via the button, add all Virtual devices, they will show up on devices, see README and images which ones.
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
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 »

Thank you for your effort, it works perfectly.

Only one question, is it difficult to also get the status Away / Home and to controle it?
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 »

That function is tied to the eco switch. Switch that on and it switched to away as well.

Sent from phone.


Last edited by heggink on Friday 24 January 2020 18:50, edited 1 time in total.
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 »

Marcello1970 wrote: Friday 24 January 2020 18:19 Thank you for your effort, it works perfectly.

Only one question, is it difficult to also get the status Away / Home and to controle it?
I will add it and post a new version
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
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 »

rolandbreedveld wrote: Friday 24 January 2020 19:53 I will add it and post a new version
Thank you in advance!
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest