NEST Account migration

For heating/cooling related questions in Domoticz

Moderator: leecollings

Devious
Posts: 20
Joined: Sunday 30 December 2018 19:02
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.10717
Location: Oss NL
Contact:

Re: NEST Account migration

Post by Devious »

dressie wrote: Monday 02 December 2019 21:01
Filip wrote: Monday 02 December 2019 20:57 Do you have a nest protect (smoke alarm from nest)? Or only a thermostat?
I suppose not and this is then the problem. If this analysis is correct, delete than the following 2 lines in the function "GetDevicesAndStatus" and try again:

Code: Select all

for protect in self.status['topaz']:
    self.protect_list.append(str(protect))
I suppose this should solve your problem. Hopefully no side-effects because I cannot test it...
Please give feedback and if it works, I will adapt the script so that it take into account this scenario.

Filip
Yes! That did it! It works outside Domoticz right now, so time to see what happens in Domoticz!
no luck for me yet, but sinds i do only have a thermostat it's problable my fault somewhere ;)
ill try from the top :lol:
Filip
Posts: 100
Joined: Thursday 03 November 2016 10:12
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: NEST Account migration

Post by Filip »

Anyway I will update the zip file in the original post with a patch to take into account the availability of nest protect or not. Update is in the zip GoogleNest2.zip (
GoogleNest2.zip
(38.43 KiB) Downloaded 59 times
).

Don't use the file above, but rather this one:
GoogleNest3.zip
(38.17 KiB) Downloaded 181 times
Last edited by Filip on Monday 02 December 2019 22:27, edited 1 time in total.
Devious
Posts: 20
Joined: Sunday 30 December 2018 19:02
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.10717
Location: Oss NL
Contact:

Re: NEST Account migration

Post by Devious »

Used the new version.
when running i get the same result:
pi@raspberrypi:~/domoticz/plugins/GoogleNest $ python3 nest.py
Traceback (most recent call last):
File "nest.py", line 231, in <module>
thermostat.GetDevicesAndStatus()
File "nest.py", line 172, in GetDevicesAndStatus
if self.status['topaz']:
KeyError: 'topaz'
Filip
Posts: 100
Joined: Thursday 03 November 2016 10:12
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: NEST Account migration

Post by Filip »

Ah inderdaad. Ik was te snel... Is deze versie beter?

Please take the version from the beginning of the thread!
This contains normally all fixes already done.
Last edited by Filip on Wednesday 11 December 2019 10:56, edited 2 times in total.
dressie
Posts: 156
Joined: Monday 25 May 2015 22:44
Target OS: Raspberry Pi / ODroid
Domoticz version: V2020.2
Location: Netherlands
Contact:

Re: NEST Account migration

Post by dressie »

Everything is working right now. After testing outside Domoticz and receiving feedback from Nest, I did a reboot of Domoticz and the devices were created. I'll do some testing tomorrow, see if the plugin works two-ways (Nest->Domoticz & Domoticz->Nest).
Thanks for your work Filip! I really appreciated your time and effort!
User avatar
capman
Posts: 153
Joined: Friday 12 July 2013 20:48
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Belgium
Contact:

Re: NEST Account migration

Post by capman »

I got it working from the beginning , except there are no devices created :( . Then when a set the debug to true it created the devices and everything is visible :D ! I have the nest thermostate and smoke detection.
Thanks 4 your support !!
Devious
Posts: 20
Joined: Sunday 30 December 2018 19:02
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.10717
Location: Oss NL
Contact:

Re: NEST Account migration

Post by Devious »

Still not working for me.
thanks for all the effort you put in to try to get it to work for me Filip!

Anyone else got a NEST thermostat E that is working with domoticz?
Filip
Posts: 100
Joined: Thursday 03 November 2016 10:12
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: NEST Account migration

Post by Filip »

If you are a bit technical, you could analysis the nest website (with the Chrome developer tools) to see which URLs are used to get this information (and to see if there would be a difference with the Thermostat E).

It could indeed be possible that the Termostat E is defined as another device... (like there is a difference between the NEST Thermostat and the NEST Protect).

In the nest.py, you can find the URLs in the code that are currently used.

If the information is available, I am always open to see once to adapt/extend the plugin if necessary...

Filip
fezster
Posts: 3
Joined: Tuesday 26 November 2019 19:24
Target OS: Linux
Domoticz version:
Contact:

Re: NEST Account migration

Post by fezster »

Nest 3rd Gen here. No protect.

I removed these lines and now it works fine:

#Protects
del self.protect_list[:]
if self.status['topaz']:
for protect in self.status['topaz']:
self.protect_list.append(str(protect))


Thanks!
Filip
Posts: 100
Joined: Thursday 03 November 2016 10:12
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: NEST Account migration

Post by Filip »

If you take the latest version (at top of this thread). Then the problem should be solved without deleting these lines.
Filip
jberinga
Posts: 53
Joined: Tuesday 11 August 2015 14:20
Target OS: NAS (Synology & others)
Domoticz version: 2.2903
Location: The Netherlands
Contact:

Re: NEST Account migration

Post by jberinga »

The Nest (Thermostat) devices are created, but not updated. And also when I want to set another temperature this is not set on the thermostat.

What could cause this and how can I solve it.
dressie
Posts: 156
Joined: Monday 25 May 2015 22:44
Target OS: Raspberry Pi / ODroid
Domoticz version: V2020.2
Location: Netherlands
Contact:

Re: NEST Account migration

Post by dressie »

jberinga wrote: Tuesday 10 December 2019 13:33 The Nest (Thermostat) devices are created, but not updated. And also when I want to set another temperature this is not set on the thermostat.

What could cause this and how can I solve it.
Try to set 'debug' logging on, see if that helps and check what happens in the log when you try to change the temp. And what's your update time?
jberinga
Posts: 53
Joined: Tuesday 11 August 2015 14:20
Target OS: NAS (Synology & others)
Domoticz version: 2.2903
Location: The Netherlands
Contact:

Re: NEST Account migration

Post by jberinga »

dressie wrote: Tuesday 10 December 2019 13:44
jberinga wrote: Tuesday 10 December 2019 13:33 The Nest (Thermostat) devices are created, but not updated. And also when I want to set another temperature this is not set on the thermostat.

What could cause this and how can I solve it.
Try to set 'debug' logging on, see if that helps and check what happens in the log when you try to change the temp. And what's your update time?
Here is my log, as you can see the temperature is set with the plugin but not getting trough to the thermostat.
Spoiler: show
2019-12-10 16:57:44.537 Status: (Nest) Started.
2019-12-10 16:57:50.605 Status: (Nest) Initialized version 1.0.0, author 'Filip Demaertelaere'
2019-12-10 16:57:50.611 Status: (Nest) Entering work loop.
2019-12-10 16:59:01.314 (Nest) onCommand called for Unit 10: Parameter 'Set Level', Level: 18.0
2019-12-10 16:59:02.321 (Nest) Pushing 'onHeartbeatCallback' on to queue
2019-12-10 16:59:02.366 (Nest) Processing 'onHeartbeatCallback' message
2019-12-10 16:59:02.366 (Nest) Calling message handler 'onHeartbeat'.
2019-12-10 16:59:02.366 (Nest) onHeartbeat called
2019-12-10 16:59:02.367 (Nest) onHeartbeat called, run again in 12 heartbeats.
2019-12-10 16:59:12.324 (Nest) Pushing 'onHeartbeatCallback' on to queue
2019-12-10 16:59:12.343 (Nest) Processing 'onHeartbeatCallback' message
2019-12-10 16:59:12.356 (Nest) Calling message handler 'onHeartbeat'.
2019-12-10 16:59:12.356 (Nest) onHeartbeat called
2019-12-10 16:59:12.356 (Nest) onHeartbeat called, run again in 11 heartbeats.
2019-12-10 16:59:22.326 (Nest) Pushing 'onHeartbeatCallback' on to queue
2019-12-10 16:59:22.373 (Nest) Processing 'onHeartbeatCallback' message
2019-12-10 16:59:22.373 (Nest) Calling message handler 'onHeartbeat'.
2019-12-10 16:59:22.374 (Nest) onHeartbeat called
2019-12-10 16:59:22.374 (Nest) onHeartbeat called, run again in 10 heartbeats.
2019-12-10 16:59:32.374 (Nest) Pushing 'onHeartbeatCallback' on to queue
2019-12-10 16:59:32.398 (Nest) Processing 'onHeartbeatCallback' message
2019-12-10 16:59:32.398 (Nest) Calling message handler 'onHeartbeat'.
2019-12-10 16:59:32.399 (Nest) onHeartbeat called
2019-12-10 16:59:32.399 (Nest) onHeartbeat called, run again in 9 heartbeats.
2019-12-10 16:59:42.604 (Nest) Pushing 'onHeartbeatCallback' on to queue
2019-12-10 16:59:42.605 (Nest) Processing 'onHeartbeatCallback' message
2019-12-10 16:59:42.605 (Nest) Calling message handler 'onHeartbeat'.
2019-12-10 16:59:42.605 (Nest) onHeartbeat called
2019-12-10 16:59:42.605 (Nest) onHeartbeat called, run again in 8 heartbeats.
2019-12-10 16:59:52.607 (Nest) Pushing 'onHeartbeatCallback' on to queue
2019-12-10 16:59:52.635 (Nest) Processing 'onHeartbeatCallback' message
2019-12-10 16:59:52.636 (Nest) Calling message handler 'onHeartbeat'.
2019-12-10 16:59:52.636 (Nest) onHeartbeat called
2019-12-10 16:59:52.636 (Nest) onHeartbeat called, run again in 7 heartbeats.
2019-12-10 17:00:02.611 (Nest) Pushing 'onHeartbeatCallback' on to queue
2019-12-10 17:00:02.623 (Nest) Processing 'onHeartbeatCallback' message
2019-12-10 17:00:02.624 (Nest) Calling message handler 'onHeartbeat'.
2019-12-10 17:00:02.624 (Nest) onHeartbeat called
2019-12-10 17:00:02.624 (Nest) onHeartbeat called, run again in 6 heartbeats.
2019-12-10 17:00:12.615 (Nest) Pushing 'onHeartbeatCallback' on to queue
2019-12-10 17:00:12.647 (Nest) Processing 'onHeartbeatCallback' message
2019-12-10 17:00:12.664 (Nest) Calling message handler 'onHeartbeat'.
2019-12-10 17:00:12.665 (Nest) onHeartbeat called
2019-12-10 17:00:12.665 (Nest) onHeartbeat called, run again in 5 heartbeats.
2019-12-10 17:00:22.620 (Nest) Pushing 'onHeartbeatCallback' on to queue
2019-12-10 17:00:22.644 (Nest) Processing 'onHeartbeatCallback' message
2019-12-10 17:00:22.644 (Nest) Calling message handler 'onHeartbeat'.
2019-12-10 17:00:22.644 (Nest) onHeartbeat called
2019-12-10 17:00:22.644 (Nest) onHeartbeat called, run again in 4 heartbeats.
2019-12-10 17:00:32.622 (Nest) Pushing 'onHeartbeatCallback' on to queue
2019-12-10 17:00:32.624 (Nest) Processing 'onHeartbeatCallback' message
2019-12-10 17:00:32.624 (Nest) Calling message handler 'onHeartbeat'.
2019-12-10 17:00:32.625 (Nest) onHeartbeat called
2019-12-10 17:00:32.625 (Nest) onHeartbeat called, run again in 3 heartbeats.
2019-12-10 17:00:42.654 (Nest) Pushing 'onHeartbeatCallback' on to queue
2019-12-10 17:00:42.654 (Nest) Processing 'onHeartbeatCallback' message
2019-12-10 17:00:42.654 (Nest) Calling message handler 'onHeartbeat'.
2019-12-10 17:00:42.655 (Nest) onHeartbeat called
2019-12-10 17:00:42.655 (Nest) onHeartbeat called, run again in 2 heartbeats.
2019-12-10 17:00:52.656 (Nest) Pushing 'onHeartbeatCallback' on to queue
2019-12-10 17:00:52.672 (Nest) Processing 'onHeartbeatCallback' message
2019-12-10 17:00:52.672 (Nest) Calling message handler 'onHeartbeat'.
2019-12-10 17:00:52.672 (Nest) onHeartbeat called
2019-12-10 17:00:52.673 (Nest) onHeartbeat called, run again in 1 heartbeats.
2019-12-10 17:01:02.658 (Nest) Pushing 'onHeartbeatCallback' on to queue
2019-12-10 17:01:02.659 (Nest) Processing 'onHeartbeatCallback' message
2019-12-10 17:01:02.659 (Nest) Calling message handler 'onHeartbeat'.
2019-12-10 17:01:02.659 (Nest) onHeartbeat called
2019-12-10 17:01:02.671 (Nest) Start thread
2019-12-10 17:01:12.662 (Nest) Pushing 'onHeartbeatCallback' on to queue
2019-12-10 17:01:12.701 (Nest) Processing 'onHeartbeatCallback' message
2019-12-10 17:01:12.708 (Nest) Calling message handler 'onHeartbeat'.
2019-12-10 17:01:12.708 (Nest) onHeartbeat called
2019-12-10 17:01:12.708 (Nest) onHeartbeat called, run again in 17 heartbeats.
2019-12-10 17:01:22.665 (Nest) Pushing 'onHeartbeatCallback' on to queue
2019-12-10 17:01:22.688 (Nest) Processing 'onHeartbeatCallback' message
2019-12-10 17:01:22.688 (Nest) Calling message handler 'onHeartbeat'.
2019-12-10 17:01:22.688 (Nest) onHeartbeat called
2019-12-10 17:01:22.689 (Nest) onHeartbeat called, run again in 16 heartbeats.
2019-12-10 17:01:32.667 (Nest) Pushing 'onHeartbeatCallback' on to queue
2019-12-10 17:01:32.691 (Nest) Processing 'onHeartbeatCallback' message
2019-12-10 17:01:32.692 (Nest) Calling message handler 'onHeartbeat'.
2019-12-10 17:01:32.692 (Nest) onHeartbeat called
2019-12-10 17:01:32.692 (Nest) onHeartbeat called, run again in 15 heartbeats.
Filip
Posts: 100
Joined: Thursday 03 November 2016 10:12
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: NEST Account migration

Post by Filip »

Works perfectly at my side. Can change the settings and is propagated to the thermostat...
Try first to execute nest.py (in python3) to see the output on the screen. Please put your credentials in the main function of the nest.py.
Patch
Posts: 1
Joined: Friday 13 December 2019 17:11
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: NEST Account migration

Post by Patch »

Hey all.

I got the nest thermostat working on the domoticz software, however when i look in the domoticz log file i see a couple of errors showing up:

(this is a fraction of the errors i am getting)
2019-12-13 17:08:19.871 Error: (Nest Thermostaat) Device creation failed, Hardware/Unit combination (7:6) already exists in Domoticz.
2019-12-13 17:08:19.871 Error: (Nest Thermostaat) Device creation failed, Hardware/Unit combination (7:6) already exists in Domoticz.
2019-12-13 17:09:19.892 Error: (Nest Thermostaat) Device creation failed, Hardware/Unit combination (7:6) already exists in Domoticz.
2019-12-13 17:09:19.892 Error: (Nest Thermostaat) Device creation failed, Hardware/Unit combination (7:6) already exists in Domoticz.
2019-12-13 17:10:19.913 Error: (Nest Thermostaat) Device creation failed, Hardware/Unit combination (7:6) already exists in Domoticz.
2019-12-13 17:10:19.914 Error: (Nest Thermostaat) Device creation failed, Hardware/Unit combination (7:6) already exists in Domoticz.
2019-12-13 17:11:19.936 Error: (Nest Thermostaat) Device creation failed, Hardware/Unit combination (7:6) already exists in Domoticz.
2019-12-13 17:11:19.936 Error: (Nest Thermostaat) Device creation failed, Hardware/Unit combination (7:6) already exists in Domoticz.
2019-12-13 17:12:19.907 Error: (Nest Thermostaat) Device creation failed, Hardware/Unit combination (7:6) already exists in Domoticz.
2019-12-13 17:12:19.907 Error: (Nest Thermostaat) Device creation failed, Hardware/Unit combination (7:6) already exists in Domoticz.
2019-12-13 17:13:19.928 Error: (Nest Thermostaat) Device creation failed, Hardware/Unit combination (7:6) already exists in Domoticz.
2019-12-13 17:13:19.929 Error: (Nest Thermostaat) Device creation failed, Hardware/Unit combination (7:6) already exists in Domoticz.
2019-12-13 17:14:19.954 Error: (Nest Thermostaat) Device creation failed, Hardware/Unit combination (7:6) already exists in Domoticz.
2019-12-13 17:14:19.954 Error: (Nest Thermostaat) Device creation failed, Hardware/Unit combination (7:6) already exists in Domoticz.
2019-12-13 17:15:19.976 Error: (Nest Thermostaat) Device creation failed, Hardware/Unit combination (7:6) already exists in Domoticz.
2019-12-13 17:15:19.977 Error: (Nest Thermostaat) Device creation failed, Hardware/Unit combination (7:6) already exists in Domoticz.
2019-12-13 17:16:19.956 Error: (Nest Thermostaat) Device creation failed, Hardware/Unit combination (7:6) already exists in Domoticz.
2019-12-13 17:16:19.956 Error: (Nest Thermostaat) Device creation failed, Hardware/Unit combination (7:6) already exists in Domoticz.


Is there something i can do to to prevent the errors?

Any help would be kindly appreciated.


By the way, i only have the Nest thermostat. I removed any cody from the script that had to do with the Nest Protect.
jberinga
Posts: 53
Joined: Tuesday 11 August 2015 14:20
Target OS: NAS (Synology & others)
Domoticz version: 2.2903
Location: The Netherlands
Contact:

Re: NEST Account migration

Post by jberinga »

Filip wrote: Tuesday 10 December 2019 21:13 Works perfectly at my side. Can change the settings and is propagated to the thermostat...
Try first to execute nest.py (in python3) to see the output on the screen. Please put your credentials in the main function of the nest.py.
When executing with python3 the output is OK, but the devices in Domoticz are not updated and setting a temperature is not propagated to the thermostat.

Could it be that I have Domoticz running on a Synology NAS that the updates and setting temperature are failing? Or are the specific rights to be set for generating (temp) files, as I see in the code that a nest.json file is created\used?


Update: When I do a restart of Domoticz I can set the temperature 1 time, but the next temperature set won't be propagated. The last update of the Nest devices is the time when I did the restart of Domoticz.
Maybe this helps finding a solution...
Filip
Posts: 100
Joined: Thursday 03 November 2016 10:12
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: NEST Account migration

Post by Filip »

If you can do it once, it sound more like a crash... Don't know exactly what could be the difference between RPI and Synology... Perhaps there is a crash dump. There are normally no temp files created... The json is the format returned by the nest web service.

@Patch. I would recommend to use the last version. It should work even without having a Protect. I would also recommend to delete all the nest devices and/or nest hardware... Normally they will be created back on the fly.
Apievuisy
Posts: 11
Joined: Tuesday 13 August 2019 20:22
Target OS: -
Domoticz version:
Contact:

Re: NEST Account migration

Post by Apievuisy »

Very nice that people are working on this.

The only nest device i got is a nest thermostat v3.

I got the token and cookie like the way Fillip described.
When i run python nest.py (not python3, does nothing) i see various information about the thermostat.
After that i copied the files in the domoticz plugin folder.

When creating a new hardware component i now see Nest Thermostat/Protect Google.
It ask for the token and cookie again, so i provided it.

At first the plugin was giving me the following error:

Code: Select all

2019-12-20 14:52:53.896 Error: (GoogleNest) failed to load 'plugin.py', Python Path used was '/usr/local/domoticz/var/plugins/GoogleNest3/:/volume1/@appstore/py3k/usr/local/lib/python35.zip:/volume1/@appstore/py3k/usr/local/lib/python3.5/:/volume1/@appstore/py3k/usr/local/lib/python3.5/plat-linux:/volume1/@appstore/py3k/usr/local/lib/python3.5/lib-dynload:/volume1/@appstore/py3k/usr/local/lib/python3.5/site-packages'.
2019-12-20 14:52:53.896 Error: (Nest Thermostaat) Module Import failed, exception: 'ImportError'
2019-12-20 14:52:53.896 Error: (Nest Thermostaat) Module Import failed: ' Name: requests'
2019-12-20 14:52:53.896 Error: (Nest Thermostaat) Error Line details not available.
So i installed "requests"

After rebooting i receive the following error:

Code: Select all

2019-12-20 15:03:53.523 Error: Nest Thermostaat hardware (18) thread seems to have ended unexpectedly
Does anybody got any idea why this happens and how i can fix this problem?
Apievuisy
Posts: 11
Joined: Tuesday 13 August 2019 20:22
Target OS: -
Domoticz version:
Contact:

Re: NEST Account migration

Post by Apievuisy »

Ok, came a bit further i think. "Requests" was still not available for python3. I installed it.
Now i get the following output in the log:

Code: Select all

2019-12-20 16:27:10.479 (Nest Thermostaat) Debug logging mask set to: PYTHON PLUGIN QUEUE IMAGE DEVICE CONNECTION MESSAGE ALL
2019-12-20 16:27:10.479 (Nest Thermostaat) Images created.
2019-12-20 16:27:10.480 (Nest Thermostaat) Start thread
2019-12-20 16:27:10.477 Status: (Nest Thermostaat) Entering work loop.
2019-12-20 16:27:10.478 Status: (Nest Thermostaat) Initialized version 1.0.0, author 'Filip Demaertelaere'
2019-12-20 16:27:20.498 (Nest Thermostaat) Pushing 'onHeartbeatCallback' on to queue
2019-12-20 16:27:20.537 (Nest Thermostaat) Processing 'onHeartbeatCallback' message
2019-12-20 16:27:20.537 (Nest Thermostaat) Calling message handler 'onHeartbeat'.
2019-12-20 16:27:20.537 (Nest Thermostaat) onHeartbeat called
2019-12-20 16:27:20.537 (Nest Thermostaat) Start thread
2019-12-20 16:27:30.518 (Nest Thermostaat) Pushing 'onHeartbeatCallback' on to queue
2019-12-20 16:27:30.541 (Nest Thermostaat) Processing 'onHeartbeatCallback' message
2019-12-20 16:27:30.541 (Nest Thermostaat) Calling message handler 'onHeartbeat'.
2019-12-20 16:27:30.541 (Nest Thermostaat) onHeartbeat called
2019-12-20 16:27:30.541 (Nest Thermostaat) onHeartbeat called, run again in 29 heartbeats.
But there are no devices created. Does anybody know why?

EDIT: Somehow a final reboot was needed. The devices where created! Very nice!
Filip
Posts: 100
Joined: Thursday 03 November 2016 10:12
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: NEST Account migration

Post by Filip »

Indeed as mentioned earlier, a reboot is required.
I have another topic open for the support or threading (this makes it crash when updating the settings and a reboot is required).
Unfortunately not any feedback yet on viewtopic.php?f=6&t=30359.
Filip
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests