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