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"
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.
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 ?
Thanks for any tips.
It’d probably be helpful to see your sitemap entry, but you haven’t asked for a state display.
Number itm_vva_ei_ht_req_lw "VVA EXT I/O - Heat Request 1-16 [%d]"
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.
It’s a java thing
Well, that just makes sense. Would it be reasonable to add a link to this page in the documentation, or would that be frowned upon?
There is a link in the state presentation section
Doh. I was only looking in the “Label” section, and missed reading “(see below)”.
I’ll show myself out.
I’d take (see below) in context as meaning “look at the example”. I don’t think a reference to the “state presentation” section would hurt at all.
Done - just hotlinked the magic phrase. Should appear sometime.
Now that you mention it, I’m pretty sure that is how I interpreted it originally. Thanks for humouring me!
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