I need to store a number of “global” variables so I was planning to use items for this as it would make it easy to show these values for information / debug purposes. These items would not be attached to any channels. So in my items file I just added items like:
Number itm_vva_ei_ht_req_lw "VVA EXT I/O - Heat Request 1-16"
etc...
I then use a jython script that reads a number of ModBus Items and I assign a calculated value to the items above. This seems to work as I see the changes appear in the log:
[jsr223.jython.Jython VVA testing ] - Set item to 1
[vent.ItemStateChangedEvent] - itm_vva_ei_ht_req_lw changed from 2 to 1
[jsr223.jython.Jython VVA testing ] - Set item to 2
[vent.ItemStateChangedEvent] - itm_vva_ei_ht_req_lw changed from 1 to 2
Now, the problem that I have is that the state of my “phantom” item is not updated (actually the state does not even show up) in my sitemap. Next to the label nothing shows up.
2 questions:
a) is this normal behaviour (not showing phantom items) or am I doing something wrong?
b) if it is normal behaviour, is there a way to “force” the item to show, eg by binding it to some “virtual” modbus item that is never refreshed ?
There’s very little about the state representation field in the Items documentation, other than to say that it exists. I’ve learned how to use it from searching the community, but I’m mostly guessing. So, I don’t know the difference between %d (as you’ve done above), %f (as in the Items documentation), or %s (I’m guessing that s=string).
Is there a definitive list of the basic states that could be added to the documentation? I’d try adding it, but my knowledge is incomplete.
Thanks Guys. Somehow I read over / missed the relevant section in the documentation.
If no state presentation and no square brackets are given, the Item will not provide a textual presentation of it’s internal state (i.e. in UIs no state is shown).
Feel pretty dumb right now