Page 8 of 14

Re: NEST Account migration

Posted: Friday 28 February 2020 20:21
by rolandbreedveld
meel4chris wrote: Friday 28 February 2020 18:52
That's what I tried this afternoon but that resulted in the same errors...
Did you enable the eventsystem in Domoticz, also lua and dzvents ?
(Settings-tab others, lowest 2 items)

Re: NEST Account migration

Posted: Friday 28 February 2020 20:23
by rolandbreedveld
meel4chris wrote: Friday 28 February 2020 18:52 That's what I tried this afternoon but that resulted in the same errors...
Did you enable the eventsystem in Domoticz, also lua and dzvents ?
(Settings-tab others, lowest 2 items)

Re: NEST Account migration

Posted: Friday 28 February 2020 20:38
by meel4chris
rolandbreedveld wrote:
meel4chris wrote: Friday 28 February 2020 18:52 That's what I tried this afternoon but that resulted in the same errors...
Did you enable the eventsystem in Domoticz, also lua and dzvents ?
(Settings-tab others, lowest 2 items)
Yes, just checked but these were already checked.


Verzonden vanaf mijn iPhone met Tapatalk

Re: NEST Account migration

Posted: Friday 28 February 2020 21:38
by rolandbreedveld
meel4chris wrote: Friday 28 February 2020 20:38
rolandbreedveld wrote:
meel4chris wrote: Friday 28 February 2020 18:52 That's what I tried this afternoon but that resulted in the same errors...
Did you enable the eventsystem in Domoticz, also lua and dzvents ?
(Settings-tab others, lowest 2 items)
Yes, just checked but these were already checked.


Verzonden vanaf mijn iPhone met Tapatalk
Googled on your error, (the 1st one)
Error: EventSystem: in /home/pi/domoticz/dzVents/runtime/dzVents.lua: /home/pi/domoticz/dzVents/runtime/Utils.lua:1: module 'JSON' not found:
There is something wrong with your installation, missing library's or wrong paths:
viewtopic.php?t=18571

Re: NEST Account migration

Posted: Saturday 29 February 2020 11:30
by Ptje
rolandbreedveld wrote: Tuesday 25 February 2020 12:02
Ptje wrote: Tuesday 25 February 2020 10:55 Hello Roland,

And when I update the setting point in Domoticz and I execute the script, it changes the settings back in Domoticz to the old setting point. When I change de set point on the Nest self and I execute the script, it updates Domoticz well.
Is this a wrong setting ?
I think this won't happen if you wait a few seconds, take the iphone (or Android) Nest app next to you, I the trigger for setpoint runs the dzVents event, it takes a short time when it's evaluated by Google/Nest, in my case 1-3 seconds.
If you don't see your nest changing to the new setpoint, you'r dzVents-event is not there or not correct configured.
Hello Roland,

What do you mean with not correct configured ? I did nothing changed in " dzVents_script_Nest_Setpoint.txt " My setpoint is Called Nest. dzVents is activated in de the Domoticz settings. Even it does not work. Do I have to rename our replace the "dzVents_script_Nest_Setpoint.txt " ?

Greetings,
Peter

Re: NEST Account migration

Posted: Saturday 29 February 2020 12:04
by rolandbreedveld
@Ptje
Changed the README, not everyone understands the dzvents part:

In the Domoticz event gui, create a new event->dzvents->device cut-and-paste the content of the example file dzVents_script_Nest_Setpoint.txt in it.
My setpoint device is called "Nest", so you perhaps you need to change it. I also use Homebridge/Homekit so I can easy say to my iPhone "Hi Siri, set Nest 20 degrees.
Better don't use spaces in the device names if you call them from dzvents event's. I had a couple of times problems with this, removing the spaces solved it.

Re: NEST Account migration

Posted: Saturday 29 February 2020 12:34
by meel4chris
rolandbreedveld wrote:
meel4chris wrote: Friday 28 February 2020 20:38
rolandbreedveld wrote: Did you enable the eventsystem in Domoticz, also lua and dzvents ?
(Settings-tab others, lowest 2 items)
Yes, just checked but these were already checked.


Verzonden vanaf mijn iPhone met Tapatalk
Googled on your error, (the 1st one)
Error: EventSystem: in /home/pi/domoticz/dzVents/runtime/dzVents.lua: /home/pi/domoticz/dzVents/runtime/Utils.lua:1: module 'JSON' not found:
There is something wrong with your installation, missing library's or wrong paths:
viewtopic.php?t=18571
Yes! Removing the dzvents from the eventname resolves it. I had seen that post before but thought the thread was only applicable for synology. Better reading next time. Temperature changes made in domoticz are also made in the nest. Not the otherway around, if I change the setting on the nest, I don’t see the temperature changing in domoticz. This should also change right?


Verzonden vanaf mijn iPhone met Tapatalk

Re: NEST Account migration

Posted: Saturday 29 February 2020 13:05
by rolandbreedveld
meel4chris wrote: Saturday 29 February 2020 12:34 Not the otherway around, if I change the setting on the nest, I don’t see the temperature changing in domoticz. This should also change right?
Will updated on the cron-run every 5 minutes, to test run the get_nest.sh script manually, use the same user which is running domoticz, or remove the cache files afterwards (see readme)

Re: NEST Account migration

Posted: Saturday 29 February 2020 13:13
by meel4chris
rolandbreedveld wrote:
meel4chris wrote: Saturday 29 February 2020 12:34 Not the otherway around, if I change the setting on the nest, I don’t see the temperature changing in domoticz. This should also change right?
Will updated on the cron-run every 5 minutes, to test run the get_nest.sh script manually, use the same user which is running domoticz, or remove the cache files afterwards (see readme)
Yes it works both ways now! I also had to add 127.0.0.* to local networks.

Thanks for all your help! I’m very happy this works again. I almost bought an Anna Plugwise this week to replace the nest but this is much better!


Verzonden vanaf mijn iPhone met Tapatalk

Re: NEST Account migration

Posted: Saturday 29 February 2020 14:04
by rolandbreedveld
meel4chris wrote: Saturday 29 February 2020 13:13 Yes it works both ways now! I also had to add 127.0.0.* to local networks.
Thanks for all your help! I’m very happy this works again. I almost bought an Anna Plugwise this week to replace the nest but this is much better!
you're welcome, I'll add this also to the readme

Re: NEST Account migration

Posted: Saturday 29 February 2020 15:36
by Ptje
rolandbreedveld wrote: Saturday 29 February 2020 12:04 @Ptje
Changed the README, not everyone understands the dzvents part:

In the Domoticz event gui, create a new event->dzvents->device cut-and-paste the content of the example file dzVents_script_Nest_Setpoint.txt in it.
My setpoint device is called "Nest", so you perhaps you need to change it. I also use Homebridge/Homekit so I can easy say to my iPhone "Hi Siri, set Nest 20 degrees.
Better don't use spaces in the device names if you call them from dzvents event's. I had a couple of times problems with this, removing the spaces solved it.
Hello Roland,

Perfect, that was the problem. Now it works perfect. Thank you for your time and patients.

Greetings,
Peter

Re: NEST Account migration

Posted: Sunday 01 March 2020 13:15
by flemm
rolandbreedveld wrote: Friday 28 February 2020 17:42
flemm wrote: Friday 28 February 2020 13:28 I have a question about the dzvents script, as well. After some struggle I got your script to work, and it's awesome! Finally able to control my Nest properly through domoticz. Thanks a lot.

One question though, since I added the dzevents setpoint script, my CPU usage increased quite a bit. From <1% to about 5%, with bumps to 7%. I know it's still not much, but it surprises me that such a simple script could increase it so much. And i'm quite a freak when it comes to running things as smooth as possible.. When I disable the script, it immediately drops back to the previous values. I'll post a graph as well.

Is there something i can do to make it less heavy on the CPU? Maybe limit the numbers of checks or something? Or is this a dzevents-related side effect? I have absolutely no experience in scripting or knowledge about how this plugin works, so maybe i'm just asking stupid questions..

Thanks!
strange, I don't have that behaviour, I also shouldn't be, because it's only fired on a device change, did you created it from the domoticz event gui, create a new event->dzvents->device ?
Thanks for your reply. Yes, i did. I checked the log, and as you pointed out it's only triggered by a device change. After disabling dzvents in the settings, i noticed the CPU dropped immediately. So, it's not caused by the script, but by dzvents in general. In another post i found it could be affected by the level of logging, but that's set to errors only. Is it normal that dzvents usses 'a lot' of CPU power in general, just by being switched on?

Re: NEST Account migration

Posted: Sunday 01 March 2020 17:21
by rolandbreedveld
flemm wrote: Sunday 01 March 2020 13:15 Thanks for your reply. Yes, i did. I checked the log, and as you pointed out it's only triggered by a device change. After disabling dzvents in the settings, i noticed the CPU dropped immediately. So, it's not caused by the script, but by dzvents in general. In another post i found it could be affected by the level of logging, but that's set to errors only. Is it normal that dzvents usses 'a lot' of CPU power in general, just by being switched on?
You'r Welcome,
I looked at my device to compare.
My older pi2 with a SSD harddisk, is using 15% CPU average (short peaks are much higher)
with Domoticz, Mosquito as mqtt broker, Dashticz (with a wall-tablet 24/7 connected), Homebridge and Cacti (snmp-monitoring tool for all my network devices)
Also with about 10 cron-job scripts, and 16 LUA, dzvents or Blocky events
So a lot of software on a small device, lowering the dzvents loglevel did decrease cpu usage with 1-2 %
Do you measure the cpu usage in the right way? I do not hope you use "top", this is not for serious measuring, it gives only short momental usage, for reliable numbers on unix you better use sar.
But actually, for this type of info you better open a new forum-topic, while it has nothing to do with Nest.

Re: NEST Account migration

Posted: Monday 02 March 2020 7:59
by flemm
rolandbreedveld wrote: Sunday 01 March 2020 17:21
flemm wrote: Sunday 01 March 2020 13:15 Thanks for your reply. Yes, i did. I checked the log, and as you pointed out it's only triggered by a device change. After disabling dzvents in the settings, i noticed the CPU dropped immediately. So, it's not caused by the script, but by dzvents in general. In another post i found it could be affected by the level of logging, but that's set to errors only. Is it normal that dzvents usses 'a lot' of CPU power in general, just by being switched on?
You'r Welcome,
I looked at my device to compare.
My older pi2 with a SSD harddisk, is using 15% CPU average (short peaks are much higher)
with Domoticz, Mosquito as mqtt broker, Dashticz (with a wall-tablet 24/7 connected), Homebridge and Cacti (snmp-monitoring tool for all my network devices)
Also with about 10 cron-job scripts, and 16 LUA, dzvents or Blocky events
So a lot of software on a small device, lowering the dzvents loglevel did decrease cpu usage with 1-2 %
Do you measure the cpu usage in the right way? I do not hope you use "top", this is not for serious measuring, it gives only short momental usage, for reliable numbers on unix you better use sar.
But actually, for this type of info you better open a new forum-topic, while it has nothing to do with Nest.
Wow, thanks for checking and your extensive explanation. I just started using domoticz on a Pi 3b+ a few weeks ago, so i'm not running a lot of scripts, and do not have a lot of knowledge of the system in general (yet.. ;)). I'll check how the cpu usage is measured. And indeed, you are right, if i have other issues with of questions about my CPU usage i'll start a different topic. Thanks! And thanks once more for your Nest script!

Re: NEST Account migration

Posted: Sunday 08 March 2020 20:38
by krizzz
Wow, love the work that has been done. It is working beautifully. Finally I can set my temperature through Domoticz again.

The readme file on Github explains it al perfectly.

Re: NEST Account migration

Posted: Monday 09 March 2020 12:49
by Justintime
rolandbreedveld wrote:
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
Maybe you can make a dedicated thread for this? Or write something In the wiki?

Had to scroll several pages to find your Github?

Thanks for making the Thermostat useful again.

Re: NEST Account migration

Posted: Monday 09 March 2020 20:31
by krizzz
Justintime wrote: Monday 09 March 2020 12:49
rolandbreedveld wrote:
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
Maybe you can make a dedicated thread for this? Or write something In the wiki?

Had to scroll several pages to find your Github?

Thanks for making the Thermostat useful again.
I am already thankful he is making the plugin possible. Everybody is free to contribute in the wiki. So IF you have the time to donate (Your time) the would be a great solution!

Re: NEST Account migration

Posted: Monday 09 March 2020 20:39
by krizzz
krizzz wrote: Sunday 08 March 2020 20:38 Wow, love the work that has been done. It is working beautifully. Finally I can set my temperature through Domoticz again.

The readme file on Github explains it al perfectly.
OK, 2 things I need to add vs previous post after working with the new setup.

- CPU usage has increased. I only measure Cpu usage with the internal device within Domoticz created for my Pi. Normally I was around a 2% average CPU load, now I am on a continuously 28% average. I don't know HOW, but I am only pointing it out.
- Also I tried to add the line

Code: Select all

*/5 * * * * /home/pi/nest-api/get_nest.sh >/dev/null 2>&1
to my crontab but the nest devices are not updating so probably the code does not work. See below my crontab entries, anyones spots a problem?

Seems to be the nodes installation. I have similar issues vs these guys (viewtopic.php?f=28&t=30670)

Code: Select all

0 10 * * * sudo ~/domoticz/scripts/speedtest.sh
0 22 * * * sudo ~/domoticz/scripts/speedtest.sh
*/5 * * * * /home/pi/nest-api/get_nest.sh >/dev/null 2>&1
And Yes, the speedtest.sh file works fine

Re: NEST Account migration

Posted: Tuesday 10 March 2020 12:30
by rolandbreedveld
krizzz wrote: Monday 09 March 2020 20:39 - Also I tried to add the line

Code: Select all

*/5 * * * * /home/pi/nest-api/get_nest.sh >/dev/null 2>&1
to my crontab but the nest devices are not updating so probably the code does not work. See below my crontab entries, anyones spots a problem?
did you try a call by hand?, to see if there are errors: first the read-call:
php get_nest.php
then the call to update a device, example here is for the away,heat or eco device (replace IDX for the number of 1 of your devices:
curl -X GET "http://127.0.0.1/json.htm?type=command& ... itchcmd=On"
(don't forget to remove the cache files if you use a different user, see the readme)
krizzz wrote: Monday 09 March 2020 20:39 0 10 * * * sudo ~/domoticz/scripts/speedtest.sh
0 22 * * * sudo ~/domoticz/scripts/speedtest.sh
*/5 * * * * /home/pi/nest-api/get_nest.sh >/dev/null 2>&1[/code]
And Yes, the speedtest.sh file works fine
what is the content of the speedtest script?
get_nest.sh and the dzvents script are consuming a bit cpu when running, but this is very short, but if you measure cpu exact the same time, you get wrong results, as said before in this treath, a lot of people (also on the "High CPU usage with node" issue) are using top, top is a nice tool to see top-processes and to look at the wait-io,but not usable to measure cpu-usage.
(This is always the problemen if you take a sample, while other processes are running)
on unix the best way to do reliable cpu performance measurement,is sar (e.q. "sar 60 100")
more about sar: https://www.raspberrypi.org/forums/view ... hp?t=72274

28% because of this script, unless something is wrong, looks impossible to me, see also the post in this threat from "01 Mar 2020, 17:21"
my old pi2, with a lot of stuff running on it, Domoticz, 2 node instances, mqtt broker, 123solar, a lot of cron-scripts and cacti uses about 15%

Re: NEST Account migration

Posted: Tuesday 10 March 2020 22:54
by Justintime
@krizzz
Are the permissions permissions set right to execute the get_nest.sh?

Chmod +x /home/pi/nest-api/get_nest.sh