Hi,
Needing some help again. My last post was about the Nest binding but could not really able to make it to work on my end. Instead I used the HTTP binding and polling that made the NEST integration working.
What help I need this time is I want to be able to adjust the Target Temperature setting on my Nest thermostat.
I tried the Setpoint but I am kind of lost on how to configure it. I searched for some examples and tried it but it does not work for me. My syntax most probably are wrong.
Here is my sitemap
Group item=NEST label="Nest" icon="homey" {
Frame label="Nest Thermostat E" {
Text item=Hvac_mode label="HVAC Mode" valuecolor=[cool="blue", heat="orange", heat-cool="brown", eco="green", off="red"] icon="nest_e"
Text item=Hvac_State label="HVAC State" valuecolor=[off="red", cooling="blue", heating="orange"] icon="nest_e"
Setpoint item=Target_Temp label="Target Temperature" minValue=9 maxValue=32 step=0.5 icon="nest_e"
Text item=Ambient_Temp label="Ambient Temperature" valuecolor=[>23="red", <=23="blue"] icon="nest_e"
Text item=Therm_Hum label="Humidity" valuecolor=[<=30="red",<=49="green",>49="brown"] icon="nest_e"
Text item=Home_Away label="Home-Away Status" valuecolor=[home="green", away="blue"] icon="nest_e"
}
Frame label="Nest CO2+Smoke" {
Text item=Smoke_UI_Color label="CO2+Smoke UI Color" valuecolor=[gray="gray", green="green", yellow="yellow", red="red"] icon="nest_protect"
Text item=Smoke_Battery_Low label="Battery" valuecolor=[ok="green", replace="red"] icon="nest_protect"
Text item=Smoke_CO_Alarm label="CO2 Alarm" valuecolor=[ok="green"] icon="nest_protect"
Text item=Smoke_Smoke_Alarm label="Smoke Alarm" valuecolor=[ok="green"] icon="nest_protect"
}
}
And here’s my .items
Group NEST (nest_product)
// ITEMS Thermostat
String nestE_NetCon "Thermostat Connected [MAP(cosmokenet.map):%s]" <thermostat> { http="<[nest:60000:JS(GetThermConValue.js)]" }
String Hvac_mode "HVAC Mode [MAP(hvacmode.map):%s]" { http="<[nest:60000:JS(GetHvacModeValue.js)]" }
Number Target_Temp "Temperature [%.1f °C]" { http="<[nest:60000:JS(GetTargetTempValue.js)]" }
Number Ambient_Temp "Ambient Temperature [%.1f °C]" { http="<[nest:60000:JS(GetNestValue.js)]" }
Number Therm_Hum "Humidity [%.1f %%]" { http="<[nest:60000:JS(GetNestTherValue.js)]" }
String Hvac_State "HVAC State [MAP(hvac_state.map):%s]"
I was searching for topics about setting temperature and found this thread where I followed the rule.
Here’s the .rule
rule "Set Target Temperature SetPoint"
when
Item Target_Temp received command
then
output = sendHttpPutRequest("https://developer-api.nest.com/devices/thermostats/IVR7xImkXXXXXXXX", "application/json", "Bearerc.FC1Rrhw16udbUpcOxihuBUDtZ0PXXXXXXXXXXXX", '{"target_temperature_c":' + receivedCommand + '}')
logInfo("HVAC","HVAC Command sent - output: "+output)
end
But I am getting this error log. Please let me know what causing the error and how to correct it.
Appreciate your help. Thanks.
2018-08-07 18:18:13.385 [ERROR] [ntime.internal.engine.RuleEngineImpl] - Rule 'Set Target Temperature SetPoint': An error occurred during the script execution: Could not invoke method: org.eclipse.smarthome.model.script.actions.HTTP.sendHttpPutRequest(java.lang.String,java.lang.String,java.lang.String,int) on instance: null
Thanks again.