Page 1 of 1

Nest thermostat

Posted: Friday 10 February 2017 16:44
by DonLeo
Hallo Lua world,

Does someone have some more information to manipulate a Nest thermostat v3?

I'm using the presence detection to set the Nest on "Away" by using:
local nest_away = 'Home Living Room Away'
commandArray[nest_away]='On'
This works,
Then I change the Setpoint by:
commandArray['UpdateDevice']='509|15|15'
where 509 = IDX for my Nest Thermostat
first 15 not a clou, (nvalue)
second 15 = setpoint temperature (svalue)
Although I have an error message "Lua is running more than 10 seconds" it works, I know why I have this error message.

The problem is I should set the ECO mode of the thermostat, cause after changing the Setpoint, the scheduler from the thermostat is overriding my setpoint.

So can someone help me out here?

I know, there's an away function in the Nest itself but that is not waterproof, I'm using the Pilot app to detect the presence of my phones and thats 100% accurate, while the Nest app detects 5 out 10!

Leo

Re: Nest thermostat

Posted: Tuesday 18 April 2017 19:09
by Plaagje
Any luck fixing the problem? my setpoint command runs also for more then 10 seconds but it works..

Code: Select all

if (devicechanged['test']=='On') then
	commandArray['UpdateDevice'] = '368|0|21'
end
i also have no idea what to fill in at the nValue so i guess it should be '0' ?

i found another way to set it using an json command:

Code: Select all

if (devicechanged['test']=='On') then
	commandArray["OpenURL"]="http://127.0.0.1:8080/json.htm?type=command&param=udevice&idx=368&nvalue=0&svalue=21"
elseif (devicechanged['test']=='Off')then
	commandArray["OpenURL"]="http://127.0.0.1:8080/json.htm?type=command&param=udevice&idx=368&nvalue=0&svalue=18"
end

Re: Nest thermostat

Posted: Tuesday 18 April 2017 19:44
by Siewert308SW
I use "SetSetpoint" to set the setpoint on my Nest v3.
Works like acharm and don't have those "Longer then 10 seconds" error

commandArray['SetSetPoint:MySetPointIdx']='20.5'

Re: Nest thermostat

Posted: Wednesday 19 April 2017 17:11
by Plaagje
Siewert308SW wrote:I use "SetSetpoint" to set the setpoint on my Nest v3.
Works like acharm and don't have those "Longer then 10 seconds" error

commandArray['SetSetPoint:MySetPointIdx']='20.5'

I tried that, but nothing happens (Nest v3)

Re: Nest thermostat

Posted: Wednesday 19 April 2017 17:13
by Siewert308SW
Plaagje wrote:
Siewert308SW wrote:I use "SetSetpoint" to set the setpoint on my Nest v3.
Works like acharm and don't have those "Longer then 10 seconds" error

commandArray['SetSetPoint:MySetPointIdx']='20.5'

I tried that, but nothing happens (Nest v3)
I assume that you set the correct idx as seen under settings->devices and not under hardware

Re: Nest thermostat

Posted: Wednesday 19 April 2017 17:16
by Plaagje
Siewert308SW wrote:
I assume that you set the correct idx as seen under settings->devices and not under hardware
Yes

Image

Code: Select all

commandArray['SetSetPoint:368']='20'

Re: Nest thermostat

Posted: Wednesday 19 April 2017 17:20
by Siewert308SW
Strange then, which Domoticz version are you running at the moment?
As for me i'm on the latest beta version.
I don't know in which version this "SetSetPoint" was introduced.

Re: Nest thermostat

Posted: Wednesday 19 April 2017 17:38
by Plaagje
Siewert308SW wrote:Strange then, which Domoticz version are you running at the moment?
As for me i'm on the latest beta version.
I don't know in which version this "SetSetPoint" was introduced.
I'm on v3.7320

You are using in your Nest script:

Code: Select all

commandArray["OpenURL"]="http://"..domoticz.ip..":"..domoticz.port.."/json.htm?type=command&param=udevice&idx="..nest_setpoint_idx.."&nvalue=0&svalue="..setpoint_high..""
Or have you not updated your pastebin?

-edit-

Maybe it doesnt work in current beta?

Re: Nest thermostat

Posted: Wednesday 19 April 2017 17:41
by Siewert308SW
Plaagje wrote:
Siewert308SW wrote:Strange then, which Domoticz version are you running at the moment?
As for me i'm on the latest beta version.
I don't know in which version this "SetSetPoint" was introduced.
I'm on v3.7320

You are using in your Nest script:

Code: Select all

commandArray["OpenURL"]="http://"..domoticz.ip..":"..domoticz.port.."/json.htm?type=command&param=udevice&idx="..nest_setpoint_idx.."&nvalue=0&svalue="..setpoint_high..""
Or have you not updated your pastebin?

-edit-

Maybe it doesnt work in current beta?
Not anymore due to the 10second error.
At the moment i use the one as i describe here earlier.
https://github.com/Siewert308SW/MyDomot ... eating.lua

Re: Nest thermostat

Posted: Wednesday 19 April 2017 17:52
by Plaagje
Fixed it, tostring was missing, the following code works

Code: Select all

local nest_setpoint_idx = 368
local setpoint_low = 17
local setpoint_high = 21

commandArray = {}

if (devicechanged['test']=='On') then
	commandArray['SetSetPoint:'..nest_setpoint_idx]=tostring(setpoint_high)
elseif (devicechanged['test']=='Off')then
	commandArray['SetSetPoint:'..nest_setpoint_idx]=tostring(setpoint_low)		
end

return commandArray
thanks Siewert, i think i going to 'borrow' your script ;-)

Re: Nest thermostat

Posted: Wednesday 19 April 2017 17:55
by Siewert308SW
Plaagje wrote:Fixed it, tostring was missing, the following code works

Code: Select all

local nest_setpoint_idx = 368
local setpoint_low = 17
local setpoint_high = 21

commandArray = {}

if (devicechanged['test']=='On') then
	commandArray['SetSetPoint:'..nest_setpoint_idx]=tostring(setpoint_high)
elseif (devicechanged['test']=='Off')then
	commandArray['SetSetPoint:'..nest_setpoint_idx]=tostring(setpoint_low)		
end

return commandArray
thanks Siewert, i think i going to 'borrow' your script ;-)
Yep... On a second thought i forgot to mention that.
Go ahead and use everything you want, but be aware some snippets use a function called from the functions.lua