Items is "NULL" in Habpanel

  • Platform information:
    • Hardware: Raspberry Pi 3
    • OS: openhabian-pi-raspbian-201908050414
  • Issue of the topic: After reinstallation of OpenHab items no longer works in Habpanel.

default.items:

String MyTest "TEST WORKS"

Habpanel widget code:

Label: {{itemValue('MyTest')}}

Result:

Label: NULL

Log after default.items changes(OK):

2020-03-10 09:11:07.596 [INFO ] [el.core.internal.ModelRepositoryImpl] - Refreshing model 'default.items'

Tried activate more logging with:

ssh -p 8101 openhab@localhost
log:set DEBUG org.openhab.binding.http

What should I try or look for to get back item values in Habpanel?

I think you confuse Item label with state (value)

All Items are born with a state of NULL and stay that way untl you update them.

Thanks. I have more complex items but tried a minimal example in the post above. Any tips for simplest possible item?

uh, for what purpose? It’s pretty simple -

String MyTest "TEST WORKS"

creates an Item.
That Item has several properties; it is of type String, it has a label “TEST WORKS”, it has a name MyTest, it has a default icon, it has a state NULL at creation.

Sounds fair. Lets try a real example instead:

default.items:

String Img_HTML "[%s]" { http="<[http://192.168.1.31:9090/flickr:5000:JSONPATH($.data)]" }

Habpanel widget:

<p ng-bind-html=itemValue('Img_HTML')></p>

Result:

NULL

The following gives some json with html code in terminal:

>curl http://192.168.1.31:9090/flickr

Where can I see this call being made in OpenHab?

Have you looked in your openhab.log ?
Also in your events.log - if you never see your your Item being updated from NULL to some new state in there … it will always remain at state NULL.

Are you looking for something like this ?

rule "my first rule"
when
   System started
then
   MyTest.postUpdate("Banana")
end

I am monitoring:

  • /var/log/openhab2/openhab.log
  • /var/log/openhab2/events.log

But nothing about my items there.

In some way your rule example looks correct. But I am pretty sure I have not messed with rules before and this have been working before.

Are not my Items supposed to be triggered when I use them in Habpanel?

Okay.
As said, if you never see your Item updating in your events.log, then it has not updated, If it has not updated, then you can look at HABpanel as much as you like but will always see NULL.

What do actually want to investigate here, this Img_HTML Item?
What messages do you see from the HTTP binding in your openhab.log?
None? Have you installed the HTTP binding?

Don’t know what that means, “triggered”? If you use a control in HABpanel, it should send a command to your Item. That will be visible in your events.log. You have not shown us any HABpanel controls yet, so I don’t know what you’re expecting to happen.

I had missed to install the HTTP binding and it all now works again!
Thanks rossko57!!