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%
Hi Roland,
Just to answer your first question:
did you try a call by hand?, to see if there are errors: first the read-call:
php get_nest.php
for those who are using my nest-api script, and have problems,
you can call it now with "-d" option for extra debug info, see the readme: 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
het is een hele lange variable, de xxxxx staan voor de rest
I looked up the method again on your GitHub how to get the token. I tried various time the same procedure, and I really do not think I have done anything wrong. Please see below the part I copy paste into the nest.auth.php file:
krizzz wrote: ↑Friday 20 March 2020 22:16
I looked up the method again on your GitHub how to get the token. I tried various time the same procedure, and I really do not think I have done anything wrong. Please see below the part I copy paste into the nest.auth.php file:
it is correct right?
Looks good,but I think this error shows not a wrong token but a typo-failure, like if you forgot something like the '; on the end
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
krizzz wrote: ↑Friday 20 March 2020 22:16
I looked up the method again on your GitHub how to get the token. I tried various time the same procedure, and I really do not think I have done anything wrong. Please see below the part I copy paste into the nest.auth.php file:
it is correct right?
Looks good,but I think this error shows not a wrong token but a typo-failure, like if you forgot something like the '; on the end
I double checked it, but the '; paramaters are set perfectly. So this isn't also it.
I do noticed something in the nest-api folder. Other PHP files are getting a color. The nest.auth.php file does not. I do not know If this is strange behaviour?
krizzz wrote: ↑Saturday 21 March 2020 13:35
I do noticed something in the nest-api folder. Other PHP files are getting a color. The nest.auth.php file does not. I do not know If this is strange behaviour?
I have problem with functioning of plugin.
What works perfectly:
1) connecting to Nest servers
2) creating devices
3) refreshing status changed remotely on all 5 devices
4) setting up thermostat temperature
5) switching home/away
not working
1) switching heating on/off -> switch does not change inside domoticz and do not change nest thermostat setting
2) switch eco on/off -> switch does not change inside domoticz and do not change nest thermostat setting
I attach log:
"2020-03-22 14:22:57.206 (Nest) Start thread Push
2020-03-22 14:22:57.175 Status: User: admin initiated a switch command
(318/Nest - Hallway Away/On)
2020-03-22 14:22:58.082 (Nest - Hallway Away) Updating device from
0:'0' to have values 1:'1'.
2020-03-22 14:22:58.088 (Nest) Update Nest - Hallway Away: 1 - '1'
2020-03-22 14:22:58.088 (Nest) End thread Push
2020-03-22 14:23:00.685 (Nest) Pushing 'onCommandCallback' on to queue
2020-03-22 14:23:00.729 (Nest) Processing 'onCommandCallback' message
2020-03-22 14:23:00.729 (Nest) Calling message handler 'onCommand'.
2020-03-22 14:23:00.729 (Nest) onCommand called for Unit 1: Parameter
'Off', Level: 1
2020-03-22 14:23:00.729 (Nest) Hallway - Nest - Hallway Heating
2020-03-22 14:23:00.685 Status: User: admin initiated a switch command
(317/Nest - Hallway Heating/Off)
2020-03-22 14:23:01.790 (Nest) Pushing 'onCommandCallback' on to queue
2020-03-22 14:23:01.790 Status: User: admin initiated a switch command
(319/Nest - Hallway Eco mode/On)
2020-03-22 14:23:02.697 (Nest) End thread Push
2020-03-22 14:23:04.215 (Nest) Pushing 'onHeartbeatCallback' on to queue
2020-03-22 14:23:04.250 (Nest) Processing 'onHeartbeatCallback' message
2020-03-22 14:23:04.250 (Nest) Calling message handler 'onHeartbeat'.
2020-03-22 14:23:04.250 (Nest) onHeartbeat called
2020-03-22 14:23:04.251 (Nest) Start thread
2020-03-22 14:23:04.251 (Nest) Thread: GetNestCredentials done
2020-03-22 14:23:04.980 (Nest) Thread: GetDevicesAndStatus done
2020-03-22 14:23:04.980 (Nest) End thread"
rolandbreedveld wrote: ↑Saturday 21 March 2020 16:14
My setpoint device is called "Nest", so you perhaps you need to change it.
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.
Hi,
You can change it like this:
-- Nest SetPoint
-- dzVents script for updatting SetPoint of Nest thermostat with Google account
-- [email protected]
-- the name of my device is "Nest", change it if you likei, on both places.
local Nest = 'Przedpokój termostat'
return{
on = {
devices = {
Nest
}
},
execute = function(domoticz, device)
local setpoint = tostring(domoticz.devices(Nest).setPoint)
print("Nest Setpoint Called, change SetPoint to :" .. setpoint .. " ...")
cmd = "/usr/bin/php /home/pi/nest-api/nest_setpoint.php " .. setpoint
os.execute(cmd)
end
}
Then you can haver any name with any signs with spaces etc and dzvents will work flawlessly and it is easier to explain what to change
krizzz wrote: ↑Friday 20 March 2020 22:16
I looked up the method again on your GitHub how to get the token. I tried various time the same procedure, and I really do not think I have done anything wrong. Please see below the part I copy paste into the nest.auth.php file:
it is correct right?
Looks good,but I think this error shows not a wrong token but a typo-failure, like if you forgot something like the '; on the end
I double checked it, but the '; paramaters are set perfectly. So this isn't also it.
I do noticed something in the nest-api folder. Other PHP files are getting a color. The nest.auth.php file does not. I do not know If this is strange behaviour?
Did you solve the problem?
This morning I suddenly have the same issue, re-checked the token and cookie but didn't solve. Was working everything correctly a few days ago.
rolandbreedveld wrote: ↑Saturday 21 March 2020 11:38
Looks good,but I think this error shows not a wrong token but a typo-failure, like if you forgot something like the '; on the end
I double checked it, but the '; paramaters are set perfectly. So this isn't also it.
I do noticed something in the nest-api folder. Other PHP files are getting a color. The nest.auth.php file does not. I do not know If this is strange behaviour?
Did you solve the problem?
This morning I suddenly have the same issue, re-checked the token and cookie but didn't solve. Was working everything correctly a few days ago.
Today I had the same issue, if you run "get_nest.sh", or "php get_nest.php"
PHP Fatal error: Uncaught exception 'UnexpectedValueException' with message 'Response to login request doesn't contain required access token. Response: {"error":"USER_LOGGED_OUT","detail":"No active session found."}' in /home/pi/nest-api/nest.class.php:1100
for some reason the token and cookie stopped working after running fine for 2 months in my case
Did the steps in the readme again, don't forget to logout/login on the nest site, replaced the cookie and token with new ones, and it's working fine again.
But after fixing my crontab entry, the problem was that I added the script into the pi crontab and not root crontab, all devices are being updated. Also controlling al o the devices do change my Nest thermostat! So all is working, so why the strange error when executing the nest.auth.ph file. I don't know!
But after fixing my crontab entry, the problem was that I added the script into the pi crontab and not root crontab, all devices are being updated. Also controlling al o the devices do change my Nest thermostat! So all is working, so why the strange error when executing the nest.auth.ph file. I don't know!
you can't run nest.auth.php, this is a config file.
if you use different users, be sure you delete the cache files, see the readme 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
But after fixing my crontab entry, the problem was that I added the script into the pi crontab and not root crontab, all devices are being updated. Also controlling al o the devices do change my Nest thermostat! So all is working, so why the strange error when executing the nest.auth.ph file. I don't know!
you can't run nest.auth.php, this is a config file.
if you use different users, be sure you delete the cache files, see the readme https://github.com/rolandbreedveld/nest-api
thanks for this, this is working well, on my debian VirtualBox. Only issue I have: every 5 mintes, the cron job changes the home/away status of the Nest. Any thoughts on how to solve?
LarsK wrote: ↑Saturday 28 March 2020 11:44
Hi all,
thanks for this, this is working well, on my debian VirtualBox. Only issue I have: every 5 mintes, the cron job changes the home/away status of the Nest. Any thoughts on how to solve?
Thanks, Lars
run the script in debug mode “get_nest.sh -d”
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