Having problem retrieving values from thermostat

I’m having issues with retrieving the temperature from my thermostat. I have a ct50 thermostat and placing a get request to http://192.168.29.189/tstat returns:
`{
“temp”: 71.5,
“tmode”: 3,
“fmode”: 0,
“override”: 0,
“hold”: 0,
“tstate”: 0,
“fstate”: 0,
“time”: {
“day”: 2,
“hour”: 14,
“minute”: 8
},
“t_type_post”: 0
}

This is what my home.items looks like:
``Number Thermostat_Sensor “Temperature [%.1f F]” {http="<[tstat:60000:JSONPATH($.temp)]"}
`
This is what my home.sitemap looks like:
Frame label=“Thermostat Temperature” {
Text item=Thermostat_Sensor label=“Temp [%.1f F]”
}

I made changes to openhab.cfg so create a cache item:
http:tstat.url=http://192.168.29.189/tstat
http:tstat.updateInterval=60000

Instead of using JSONPATH I tried doing a js transformation by placing a file called getTemp.js in the transform directly with:

JSON.parse(input).temp;

and modifying my home.items to:
Number Thermostat_Sensor “Temperature [%.1f F]” {http="<[tstat:60000:JS(getTemp.js)]"}

I even tried calling the url directly instead of a cache and that did not work either. Anyways, I’ve searched around and tried everything and looking at the openhab log it just shows:
2015-11-11 14:35:06.767 [ERROR] [o.u.i.items.ItemUIRegistryImpl] - Cannot retrieve item Thermostat_Sensor for widget org.openhab.model.sitemap.Text

Any help on this would be greatly appreciated!

Have a look at this thread. It covers most of the configuration for retrieving and displaying values from these thermostats

Yeah! so I read through that thread first and based everything off what I read in that thread pretty much. Do you see any reason why I would be getting an error?

I will look at my configuration this weekend to see if anything different stands out.

Till then I’ll ask the obvious. Have you restarted, and confirmed the HTTP binding is installed ?

I don’t know how to confirm the http binding is installed. This is what I have done. I just ran sudo service openhab stop. Sudo service openhab start. Before that I dropped the http binding (org.openhab.binding.http-1.7.1.jar) into the addons folder. I can’t tell if the HTTP binding is installed or not. The directions on the github just show how to bind it to an item.

You Should see this in your openhab log at startup

2015-11-13 17:42:51.441 [INFO ] [.service.AbstractActiveService] - HTTP Refresh Service has been started

Also try altering your items file so that is the only line in the file. Could be a typo elsewhere in the file is messing things up

Add the following line to your logback.xml file. In the bottom half you’ll see where all of these logger calls are made. Just add it below the last one there.

<logger name="org.openhab.binding.http" level="TRACE" />

Then when you view your openhab.log you’ll see all activity for the http binding.

ok so the line “HTTP Refresh Service has been started” does not show up in openhab.log anywhere. I erased everything from the items file except for that line and I still get the same issue.

I tried p912s’ suggestion:
<logger name="org.openhab.binding.http" level="TRACE" />

And now nothing is being logged to openhab.log at all.

I think I’m going to just do a clean fresh install of it. Any suggestions on doing a fresh install? I’ve seen a few instructions online but they’re all slightly different.

Did you copy the http binding to the addons directory in OpenHAB?

yes.

copied: org.openhab.binding.http-1.7.1.jar
to: /etc/openhab/configurations/addons

This is what the bottom of my logback,xml file looks like.

<!-- temporary workaround for https://bugs.eclipse.org/bugs/show_bug.cgi?id=402750 -->
<logger name="OSGi" level="OFF" />

<!-- temporary workaround to circumvent error messages with any obvious effect -->
<logger name="org.atmosphere.cpr.AtmosphereFramework" level="OFF" />
<logger name="org.atmosphere.cpr.DefaultAnnotationProcessor" level="OFF" />

<logger name="org.openhab.binding.astro" level="DEBUG" />
<logger name="org.openhab.binding.http" level="DEBUG" /> 
<logger name="org.openhab.binding.hue" level="DEBUG" /> 

 <root level="WARN">
	<appender-ref ref="FILE" />
	<appender-ref ref="STDOUT" />
</root>

In my openhab.log file I see these lines right at the beginning of a boot cycle.
2015-11-16 11:22:30.390 [DEBUG] [.b.http.internal.HttpActivator] - HTTP binding has been started.
2015-11-16 11:22:30.401 [INFO ] [.service.AbstractActiveService] - HTTP Refresh Service has been started

And a few lines after that.
2015-11-16 11:22:30.403 [DEBUG] [.o.b.http.internal.HttpBinding] - item ‘Tstat_mode’ is fetched from cache
2015-11-16 11:22:30.405 [DEBUG] [.o.b.http.internal.HttpBinding] - updating cache for ‘tstat’ (‘http://192.168.224.50/tstat’)

And then a few lines after that.
2015-11-16 11:22:32.846 [DEBUG] [.o.b.http.internal.HttpBinding] - transformed response is ‘1’
2015-11-16 11:22:32.848 [DEBUG] [.o.b.http.internal.HttpBinding] - item ‘Tstat_temp’ is fetched from cache
2015-11-16 11:22:32.849 [DEBUG] [.o.b.http.internal.HttpBinding] - transformed response is ‘66.5’
2015-11-16 11:22:32.853 [DEBUG] [.o.b.http.internal.HttpBinding] - item ‘Tstat_SetpointH’ is fetched from cache
2015-11-16 11:22:32.855 [DEBUG] [.o.b.http.internal.HttpBinding] - transformed response is ‘67.0’
2015-11-16 11:22:32.856 [DEBUG] [.o.b.http.internal.HttpBinding] - item ‘Tstat_SetpointC’ is fetched from cache
2015-11-16 11:22:32.859 [DEBUG] [.o.b.http.internal.HttpBinding] - transformed response is ‘null’
2015-11-16 11:22:32.861 [DEBUG] [.o.b.http.internal.HttpBinding] - Couldn’t create state of type ‘class org.openhab.core.library.items.NumberItem’ for value ‘null’
2015-11-16 11:22:32.863 [DEBUG] [.o.b.http.internal.HttpBinding] - item ‘Tstat_hold’ is fetched from cache
2015-11-16 11:22:32.864 [DEBUG] [.o.b.http.internal.HttpBinding] - transformed response is ‘1’
2015-11-16 11:22:32.866 [DEBUG] [.o.b.http.internal.HttpBinding] - item ‘Tstat_fan’ is fetched from cache
2015-11-16 11:22:32.867 [DEBUG] [.o.b.http.internal.HttpBinding] - transformed response is ‘0’

ok that’s weird. I’m going to redo everything off a fresh install.

Ok I installed a new image and reinstalled openhab. Everything works PERFECTLY! THanks for your time! Also, I noticed you have the same thermostat as me. Would you be willing to share the sitemap/items setup for the thermostat? It would save me some time for sure.

Yeah! Good News!

Glad to hear it’s working!

Most everything in my setup is in the previous post - How to return current temp from my thermostat?