NEST Account migration

For heating/cooling related questions in Domoticz

Moderator: leecollings

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 »

@LarsK
what is see is that AWAYMOD on your nest is off, and on on Domoticz, it's switched off on domotics,that looks fine, what happens further?
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
LarsK
Posts: 9
Joined: Saturday 28 March 2020 11:41
Target OS: Linux
Domoticz version:
Contact:

Re: NEST Account migration

Post by LarsK »

Hi, this morning at 9:15, I have turned off the cron task to update NEST. So Domoticz is not being updated anymore.

When I look in NEST app, in HOME/AWAY - ACTIVITY (Thuis/afwezig - Activiteitengeschiedenis), exactly every 5 minutes, Home/away switches. Nest app shows:

20:00 Home
20:05 Away
20:10 Home
2015 Away
etc.
etc.

This stopped, this morning at 9:15, when I stopped the cron job.

Hope this makes sense.

KR, Lars
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 »

LarsK wrote: Saturday 28 March 2020 14:42 Hi, this morning at 9:15, I have turned off the cron task to update NEST. So Domoticz is not being updated anymore.

When I look in NEST app, in HOME/AWAY - ACTIVITY (Thuis/afwezig - Activiteitengeschiedenis), exactly every 5 minutes, Home/away switches. Nest app shows:

20:00 Home
20:05 Away
20:10 Home
2015 Away
etc.
etc.

This stopped, this morning at 9:15, when I stopped the cron job.

Hope this makes sense.

KR, Lars
It looks like you swapped the unset_nest_away_mode.php and set_nest_away_mode.php command's in the virtual device, can that be the issue ?
Here the example for the ECOMODE:
Image
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
LarsK
Posts: 9
Joined: Saturday 28 March 2020 11:41
Target OS: Linux
Domoticz version:
Contact:

Re: NEST Account migration

Post by LarsK »

thanks, yes I think I did, let me figure this out.
KR, Lars
LarsK
Posts: 9
Joined: Saturday 28 March 2020 11:41
Target OS: Linux
Domoticz version:
Contact:

Re: NEST Account migration

Post by LarsK »

I think this solved it, thanks a lot!
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 »

LarsK wrote: Saturday 28 March 2020 16:45 I think this solved it, thanks a lot!
nice, congrats!
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
LarsK
Posts: 9
Joined: Saturday 28 March 2020 11:41
Target OS: Linux
Domoticz version:
Contact:

Re: NEST Account migration

Post by LarsK »

Hi,

I ran into another issue.

Every evening at 20:15, I have my Nest app programmed to put Nest temperature back to 15 degrees (getting ready for the night, room will slowly cool down).

In the past two nights, this change to 15 degrees was not effectuated. I suspect, caused by the Domoticz integration, as it was working well before.

However, I tested bringing back the temp to 15 degrees using the Nest program (in Nest app), today and yesterday during the daytime. I just programmed the Nest to go down to 15 degrees at 10:15, and that worked perfectly well. Only in the evening , the Nest program doesn't work... Weird...?

So I manually entered 15 in Nest app last night.

This is my log from Domoticz:

2020-03-31 19:00:04.226 Status: Incoming connection from: 127.0.0.1
2020-03-31 19:10:04.072 Status: EventSystem: reset all device statuses...
2020-03-31 19:10:04.194 Status: dzVents: Info: Handling events for: "Nest", value: "21.00"
2020-03-31 19:10:04.194 Status: dzVents: Info: ------ Start internal script: Nest SetPoint: Device: "Nest (Nest Thermostaat)", Index: 62
2020-03-31 19:10:04.194 Status: dzVents: Nest Setpoint Called, change SetPoint to :21.0 ...
2020-03-31 19:10:05.472 Status: dzVents: Info: ------ Finished Nest SetPoint
2020-03-31 20:15:04.738 Status: EventSystem: reset all device statuses...
2020-03-31 20:15:04.853 Status: dzVents: Info: Handling events for: "Nest", value: "21.00"
2020-03-31 20:15:04.853 Status: dzVents: Info: ------ Start internal script: Nest SetPoint: Device: "Nest (Nest Thermostaat)", Index: 62
2020-03-31 20:15:04.853 Status: dzVents: Nest Setpoint Called, change SetPoint to :21.0 ...
2020-03-31 20:15:07.892 Status: dzVents: Info: ------ Finished Nest SetPoint
2020-03-31 20:25:03.969 Status: User: Admin initiated a switch command (61/Nest Heat/Off)
2020-03-31 20:25:04.573 Status: EventSystem: reset all device statuses...
2020-03-31 20:25:04.668 Status: dzVents: Info: Handling events for: "Nest", value: "15.00"
2020-03-31 20:25:04.668 Status: dzVents: Info: ------ Start internal script: Nest SetPoint: Device: "Nest (Nest Thermostaat)", Index: 62
2020-03-31 20:25:04.668 Status: dzVents: Nest Setpoint Called, change SetPoint to :15.0 ...
2020-03-31 20:25:05.828 Status: dzVents: Info: ------ Finished Nest SetPoint
2020-03-31 21:30:03.828 Status: EventSystem: reset all device statuses...

Version: 2020.1 (build 11838)
Build Hash: 372611b76
Compile Date: 2020-03-26 15:21:15
dzVents Version: 3.0.1
on debian

regards, Lars
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 »

LarsK wrote: Wednesday 01 April 2020 10:30 Hi,

I ran into another issue.

Every evening at 20:15, I have my Nest app programmed to put Nest temperature back to 15 degrees (getting ready for the night, room will slowly cool down).

In the past two nights, this change to 15 degrees was not effectuated. I suspect, caused by the Domoticz integration, as it was working well before.

However, I tested bringing back the temp to 15 degrees using the Nest program (in Nest app), today and yesterday during the daytime. I just programmed the Nest to go down to 15 degrees at 10:15, and that worked perfectly well. Only in the evening , the Nest program doesn't work... Weird...?

So I manually entered 15 in Nest app last night.

This is my log from Domoticz:

2020-03-31 19:00:04.226 Status: Incoming connection from: 127.0.0.1
2020-03-31 19:10:04.072 Status: EventSystem: reset all device statuses...
2020-03-31 19:10:04.194 Status: dzVents: Info: Handling events for: "Nest", value: "21.00"
2020-03-31 19:10:04.194 Status: dzVents: Info: ------ Start internal script: Nest SetPoint: Device: "Nest (Nest Thermostaat)", Index: 62
2020-03-31 19:10:04.194 Status: dzVents: Nest Setpoint Called, change SetPoint to :21.0 ...
2020-03-31 19:10:05.472 Status: dzVents: Info: ------ Finished Nest SetPoint
2020-03-31 20:15:04.738 Status: EventSystem: reset all device statuses...
2020-03-31 20:15:04.853 Status: dzVents: Info: Handling events for: "Nest", value: "21.00"
2020-03-31 20:15:04.853 Status: dzVents: Info: ------ Start internal script: Nest SetPoint: Device: "Nest (Nest Thermostaat)", Index: 62
2020-03-31 20:15:04.853 Status: dzVents: Nest Setpoint Called, change SetPoint to :21.0 ...
2020-03-31 20:15:07.892 Status: dzVents: Info: ------ Finished Nest SetPoint
2020-03-31 20:25:03.969 Status: User: Admin initiated a switch command (61/Nest Heat/Off)
2020-03-31 20:25:04.573 Status: EventSystem: reset all device statuses...
2020-03-31 20:25:04.668 Status: dzVents: Info: Handling events for: "Nest", value: "15.00"
2020-03-31 20:25:04.668 Status: dzVents: Info: ------ Start internal script: Nest SetPoint: Device: "Nest (Nest Thermostaat)", Index: 62
2020-03-31 20:25:04.668 Status: dzVents: Nest Setpoint Called, change SetPoint to :15.0 ...
2020-03-31 20:25:05.828 Status: dzVents: Info: ------ Finished Nest SetPoint
2020-03-31 21:30:03.828 Status: EventSystem: reset all device statuses...

Version: 2020.1 (build 11838)
Build Hash: 372611b76
Compile Date: 2020-03-26 15:21:15
dzVents Version: 3.0.1
on debian

regards, Lars
Hi Lars,
what happens at 20:15:04.853 (21dg) and 20:25:04.668 (15dg) ?
something triggers these events in Domoticz, the 2nd one looks a manual action.
you can schedule the 15 dg on your Nest or in Domoticz, I do it too on my Nest
can you activate the logging for the nest-api script, change your crontab to something like:
*/5 * * * * /home/pi/nest-api/get_nest.sh >/var/log/nest-api.log 2>&1
(you need to update to the latest version with "git pull" I added time-stamps to it, so you can compare both loggings)

Thinking, can it be possible that both the cron-job and the Nest schedule, are running exactly on the same time ?
This can alway be a problem with software as it's controlled from more than 1 point.
if so try to schedule it in the Nest on 20:16 instead of 20:15, I'm interested if this solves the issue.

suc6, Roland
https://github.com/rolandbreedveld/nest ... /README.md
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
LarsK
Posts: 9
Joined: Saturday 28 March 2020 11:41
Target OS: Linux
Domoticz version:
Contact:

Re: NEST Account migration

Post by LarsK »

Thanks, I changed the Cron job, as per your suggestion. Let's see what happens tonight.

Answering your question: At 20:15, Nest program should change temp into 15 degrees. As it didn't, at 20:25, I did this manually (in Nest app).

Not sure how to program Nest to change temp at 20:16, as Nest app (at least in IOS) seems to support only 15-minute blocks. I'm neither sure how to let the Cron job run every 5 minutes, but at minute 1, 6, 11, 16 etc of the hour. Could we add a 1-minute pause to the Cron job? I mean, it will start every five minutes, at 20:00, 20:05, 20:10 etc, but will start with a 1 minute pause, which effectively means it will pick up the Nest set temp of 20:01, 20:06 etc, hopefully after Nest app changed temp.

I will keep you updated.

Kind regards, Lars
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 »

LarsK wrote: Wednesday 01 April 2020 12:26 Thanks, I changed the Cron job, as per your suggestion. Let's see what happens tonight.

Answering your question: At 20:15, Nest program should change temp into 15 degrees. As it didn't, at 20:25, I did this manually (in Nest app).

Not sure how to program Nest to change temp at 20:16, as Nest app (at least in IOS) seems to support only 15-minute blocks. I'm neither sure how to let the Cron job run every 5 minutes, but at minute 1, 6, 11, 16 etc of the hour. Could we add a 1-minute pause to the Cron job? I mean, it will start every five minutes, at 20:00, 20:05, 20:10 etc, but will start with a 1 minute pause, which effectively means it will pick up the Nest set temp of 20:01, 20:06 etc, hopefully after Nest app changed temp.

I will keep you updated.

Kind regards, Lars
What you easy can do, id keep the cronjob at "*/5" and add "sleep 60" to it:
*/5 * * * * sleep 60;/home/pi/nest-api/get_nest.sh >/var/log/nest-api.log 2>&1

you also can put the sleep command to the get_nest.sh script, after the first line
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 »

LarsK wrote: getting ready for the night, room will slowly cool down).
I read it again, you said this, does that mean that the Nest will go down in steps?
let's say 21.5 -> 21.0-> 20.5 etc
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
LarsK
Posts: 9
Joined: Saturday 28 March 2020 11:41
Target OS: Linux
Domoticz version:
Contact:

Re: NEST Account migration

Post by LarsK »

Hi Roland, apologies for not being clear, no, Nest goes down, from 21 immediately to 15, no steps in between. Then, the room slowly cools off.
I will add the sleep command to the Cron job. Let's see what happens tonight!
Kind Regards, Lars
LarsK
Posts: 9
Joined: Saturday 28 March 2020 11:41
Target OS: Linux
Domoticz version:
Contact:

Re: NEST Account migration

Post by LarsK »

Yes, the sleep command in Cron job solved it!
KR, Lars
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 »

LarsK wrote: Thursday 02 April 2020 8:50 Yes, the sleep command in Cron job solved it!
KR, Lars
Great I'll add it to the readme, to be aware of 2 scheduled jobs at the same time.
regards, Roland
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
krissie
Posts: 3
Joined: Friday 18 May 2018 11:51
Target OS: Windows
Domoticz version:
Contact:

Re: NEST Account migration

Post by krissie »

Hey

Can some one confirm the format of the cookie and token ,is like is this example :

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';

cookie = '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';

if i run python nest.py i get this error :


File "nest.py", line 266
issue_token = 'https://accounts.google.com/o/oauth2/if ... e.nest.com';
^
IndentationError: expected an indented block

Do i have the put this token and cookie in the "nest.py" and in the domoticz hardware setup ?
drwurn
Posts: 68
Joined: Sunday 10 June 2018 16:59
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: NEST Account migration

Post by drwurn »

Hi,

I get this error after installing the plugin.
2020-04-19 16:48:31.006 Error: (GoogleNest) failed to load 'plugin.py', Python Path used was '/home/pi/domoticz/plugins/Domoticz-NEST-plugin-master/:/usr/lib/python37.zip:/usr/lib/python3.7:/usr/lib/python3.7/lib-dynload:/usr/local/lib/python3.7/dist-packages:/usr/lib/python3/dist-packages:/usr/lib/python3.7/dist-packages'.
2020-04-19 16:48:31.006 Error: (NEST) Module Import failed, exception: 'ModuleNotFoundError'
2020-04-19 16:48:31.006 Error: (NEST) Module Import failed: ' Name: pytz'
2020-04-19 16:48:31.006 Error: (NEST) Error Line details not available.
I have downloaded the plugin, filled in the issue_token and cookie.
Have rebooted but the error remains.

I'm running a freshly installed buster and domoticz system
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 »

drwurn wrote: Sunday 19 April 2020 16:57 Hi,

I get this error after installing the plugin.
2020-04-19 16:48:31.006 Error: (GoogleNest) failed to load 'plugin.py', Python Path used was '/home/pi/domoticz/plugins/Domoticz-NEST-plugin-master/:/usr/lib/python37.zip:/usr/lib/python3.7:/usr/lib/python3.7/lib-dynload:/usr/local/lib/python3.7/dist-packages:/usr/lib/python3/dist-packages:/usr/lib/python3.7/dist-packages'.
2020-04-19 16:48:31.006 Error: (NEST) Module Import failed, exception: 'ModuleNotFoundError'
2020-04-19 16:48:31.006 Error: (NEST) Module Import failed: ' Name: pytz'
2020-04-19 16:48:31.006 Error: (NEST) Error Line details not available.
I have downloaded the plugin, filled in the issue_token and cookie.
Have rebooted but the error remains.

I'm running a freshly installed buster and domoticz system
Plugin is not working, see older posts, that's the reason I build this:
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
drwurn
Posts: 68
Joined: Sunday 10 June 2018 16:59
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: NEST Account migration

Post by drwurn »

Plugin is not working, see older posts, that's the reason I build this:
https://github.com/rolandbreedveld/nest-api/
So the only thing I need is what you've build?
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 »

drwurn wrote: Sunday 19 April 2020 17:11
Plugin is not working, see older posts, that's the reason I build this:
https://github.com/rolandbreedveld/nest-api/
So the only thing I need is what you've build?
Yes, I started with the php script from gboudreau, this is modified and included
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
drwurn
Posts: 68
Joined: Sunday 10 June 2018 16:59
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: NEST Account migration

Post by drwurn »


Yes, I started with the php script from gboudreau, this is modified and included
It's up and running, thanks!
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests