openHAB 4.3.2
RPi5 with openhabian
I have started delving into jruby for rules on openHAB
I was using blocky (i know, i know) before out of a need to get started with rules.
I have a thing that is monitoring a MQTT feed from a lithium solar battery where the feed sends the name of the cell with the highest voltage and the voltage in two items.
Each time the cell name can change to reflect the cell with the highest voltage
My jruby rule creates the new items as the cell name value changes which is great and stores the voltage accordingly. This is all working.
However when the script stops those are items deleted. Because they are not persistent.
I understand that I can add them to a group to make them persistent in the standard RRD4j Service.
This does not seem to ensure that they are “persistent” in the openHAB json DB or is it by adding them to this RRD4J persistence service (and make them restore on startup) is the only way to make them persistent. The documentation seems to only claim that they will not be persistent ) Note that by default items are not persisted to storage, and will be removed when the script unloads. It does not give any example of how to persist to the openHAB system (json) store if thats even possible.
My concern is if the jruby rule stops the items will be deleted and then any widgets using those will not be able to get any state info because the object (item) no longer exists.
Any advice on this would be great.