rossko57
(Rossko57)
February 26, 2020, 2:36am
8
Yes, I would agree. The problem arises when we use a Number type as “multistate switch” - say Fan Speed 0 1 2 3
Typical usage in a rule is then something like
if( state == 2) do whatever
or switch-case equivalents
and that fails if state is 2.0
Usually it doesn’t happen, because we set 0 1 2 3 in rules or mappings or blah.
But at least some of the persistence services will store “3” but restore “3.0” due to internal processes.
Hi all,
I have been using OH2 + persistence with JDBC + mysql.
Since few days (update to 2.4 ?), integer values are restored from persistence with “.0” (for number items). For example, I used to restore “9” for 9AM, now it restores “9.0”.
As a consequence, the Selection module on the sitemap does not identify the value 9.0 as 9, and selection is not restored to its previous state.
Is there an extra parameter to avoid this ?
Thanks,
Rudy
Hey all, I just did a complete fresh install of openhabian on my rpi3b+ I decided to try out the influxdb + grafana in the options and opted to setup influxdb persistence. I enjoy the configuration a lot, the only problem I have is the decimal .0 is added to every number item I have when states are restored from persistence. I have a few rules that require it to not have a decimal after the number.
Is there a way to stop influxdb from adding the decimal when restoring item values?
Upgrading from 2.3 to 2.4, I noticed upon restart, my persistence values restored from rrd4j are initialized to floating point rather than integer.
For example I have this item.
Number Light_tmr_minutes “Auto-Off [%d]”
And it is persisted with this configuraiton:
Light_tmr_minutes : strategy = everyChange, restoreOnStartup
And set this way in the UI:
Selection item=Light_tmr_minutes icon=time mappings=[0=“Off”,5=“5min”,15=“15min”,60=“1hr”]
Prior to 2.3, if I set this timer to 15 in…