# Need Help to Adjust Temperature thru HTTP Binding

**URL:** <https://community.openhab.org/t/need-help-to-adjust-temperature-thru-http-binding/49038>\
**Category:** Scripts & Rules\
**Created:** [August 8, 2018, 1:10am UTC](https://community.openhab.org/t/need-help-to-adjust-temperature-thru-http-binding/49038 "2018-08-08T01:10:52Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Home\_Agecra](https://community.openhab.org/user_avatar/community.openhab.org/home_agecra/32/22297_2.png) [@Home\_Agecra](https://community.openhab.org/u/Home_Agecra)\
**Post date:** [August 8, 2018, 1:10am UTC](https://community.openhab.org/t/need-help-to-adjust-temperature-thru-http-binding/49038/1 "2018-08-08T01:10:53Z")

</div>

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

```auto
	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

```auto
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](https://community.openhab.org/t/how-to-return-current-temp-from-my-thermostat/3141) where I followed the rule.

Here’s the .rule

```auto
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.

```auto
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.

---

<div class="post-metadata">

**Author:** ![rlkoshak](https://community.openhab.org/user_avatar/community.openhab.org/rlkoshak/32/75251_2.png) [@rlkoshak](https://community.openhab.org/u/rlkoshak)\
**Post date:** [August 8, 2018, 3:19pm UTC](https://community.openhab.org/t/need-help-to-adjust-temperature-thru-http-binding/49038/2 "2018-08-08T15:19:59Z")

</div>

> **[HTTP - Bindings](https://v2.openhab.org/addons/bindings/http1/)**
>
> If you want to have openHAB request a URL when commands are sent to items, or have it poll a given URL frequently and update items' states, install and configure this binding.

> **[HTTP Actions - Actions](https://www.openhab.org/docs/configuration/actions.html#http-actions)**
>
> Actions are predefined methods that are called from openHAB rules and scripts. They are automatically imported and can be used to execute openHAB-specific operations or to send commands or data to external hardware or services. There are a set of...

The sendHttpPutRequest Action only supports three arguments. You are passing four arguments.

You will probably need to use curl to do this as there is no way to pass the bearer auth code I know of.
