HTTP Binding not caching

I have been struggling with this setup for a while now, and i have just made a standalone ubuntu NUC for openhab.

Right now i am in the process of going through each binding and getting it configured.

I have a radio thermostat CT-30 wifi. it resides on my network at 192.168.1.17, if i go to that in a webbrowser i can see the page. and going to /tstat shows me the json info.

in addons, i have org.openhab.binding.http-1.8.0.jar and i have reset the computer and restarted openhab numerous times.

My http binding in the CFG shows

# timeout in milliseconds for the http requests (optional, defaults to 5000)
#http:timeout=10000

# the interval in milliseconds when to find new refresh candidates
# (optional, defaults to 1000)
#http:granularity=

# configuration of the first cache item
 http:tstat.url=http://192.168.1.17/tstat
 http:tstat.updateInterval=600000

# configuration of the second cache item  
 http:tstat2.url=http://192.168.1.17/tstat/datalog
 http:tstat2.updateInterval=600000

openhab.log shows

abstractactiveservice - http refresh service has been started

in my items i have

Number Tstat_mode “System Status” { http="<[tstat:600000:JSONPATH($.tmode)]" }
Number Tstat_temp “Indoor Temp [%.1f °F]” { http="<[tstat:600000:JSONPATH($.temp)]" }
Number Tstat_SetpointH “Set Heat Temperature [%.1f °F]” { http="<[tstat:600000:JSONPATH($.t_heat)]" }
Number Tstat_SetpointC “Set A/C Temperature [%.1f °F]” { http="<[tstat:600000:JSONPATH($.t_cool)]" }
Number Tstat_Setpoint “Set Temperature [%.1f °F]“
Number Tstat_hold “Hold Status” { http=”<[tstat:600000:JSONPATH($.hold)]” }
Number Tstat_fan “Fan Mode” { http="<[tstat:600000:JSONPATH($.fmode)]" }
DateTime Tstat_LastUpdate “Last contact [%1$tm-%1$td @ %1$tH:%1$tM]”

String Tstat2_rToday “Today [%s]” { http="<[tstat2:600000:JS(todayRuntime.js)]" }
String Tstat2_rYesterday “Yesterday [%s]” { http="<[tstat2:600000:JS(yesterdayRuntime.js)]" }

and so in my trace level http log its just constantly cycling through all of the things i have in items like this…

DEBUG o.o.b.h.internal.HttpBinding[:166] - item 'Tstat_mode' is not a valid URL or is a cache id yet to be initialised (tstat)
DEBUG o.o.b.h.internal.HttpBinding[:166] - item 'Tstat_temp' is not a valid URL or is a cache id yet to be initialised (tstat)
DEBUG o.o.b.h.internal.HttpBinding[:166] - item 'Tstat_SetpointH' is not a valid URL or is a cache id yet to be initialised (tstat)
DEBUG o.o.b.h.internal.HttpBinding[:166] - item 'Tstat2_rToday' is not a valid URL or is a cache id yet to be initialised (tstat2)

it works fine if i use the url in the call though, so instead of the cache as
Number Tstat_mode "System Status" { http="<[tstat:600000:JSONPATH($.tmode)]" }

if i use
Number Tstat_mode "System Status" { http="<[http://192.168.1.17/tstat:600000:JSONPATH($.tmode)]" }

that works fine. ive tried it now on windows, and ubuntu, and i have tried the using JSON, and JS and nothing seems to work.

Is there any configuration (outside of openhab.cfg) that needs to be done? am i missing permissions or firewalls or something?

Can it be, you have spaces at the beginning of cache definition? Spaces at beginning of line are no-goes (at least in openhab.cfg :slightly_smiling:

2 Likes

oh man, that was stupid. after removing the space it all works. i had just deleted the # as it was so i didnt even think of that.

thank you!

You’re welcome, that spaces bugged me many times :smile: