Dimmer state persistence with rrd4j

Hi there!

I’m trying to persist a Dimmer item using rrd4j persistence. The item definition of the item is the following:

Dimmer	Shutter_AutoShutterPosition    "Auto-Mode P [%d %%]"

In the logs I see the save and restore of the item:

Stored 'Shutter_AutoShutterPosition' with state '66' in rrd4j database

Restored item state from 'Aug 21, 2015 11:08:00 PM' for item 'Shutter_AutoShutterPosition' -> '0.66000000000000003108624468950438313186168670654296875'

The dimmer state is obviously being saved and restored using different datatypes.

Is this a bug or am I missing something?

Thanks!
Axel

I remember that I stumbled upon the same thing with rollershutter items that I tried to make persistent for a test.

I guess it is a bug. Maybe it’s worth to open an issue?!

I opened an issue https://github.com/openhab/openhab/issues/3090

1 Like

I have created a pull request that fixes this issue. During my tests it is now perfectly possible to restore DimmerItems and RollershutterItems.

No we need just one of the official devs… and some luck that I did it the right way :sweat:

Here is the link the pull request:

1 Like

Looks indeed like a bug!

I was just stumbling upon it because I still fight with the fact that all non persistent items are UNDEFINED after I change an item in one of the items files. Even items that are bound (via the Homematic binding for instance).
As this leads to a system which is partially not reliable anymore, I tried to made all relevant items persistent via RRD4J… including my Rolllershutters and Dimmers.

To my surprise my rollershutters start moving after I edited an item file :scream: :joy:
After I checking the logs it was clear why :yum:

Great! I’m gonna try your fix after I get back from vacation! Thanks!

I found that the standard UI (and also habdroid) seems to expect a state between 0 and 1 for choosing the appropriate dimmer icon.

Well. not if you define “slider” as icon. This one is expecting values between 0 and 100. At least at my side…

Hi
I’m experiencing this bug on version 1.8. Has it been fixed in 1.8.1? Is there a workaround?
Thanks.

Yes. It should be fixed.

Hello everyone.

I am still experiencing this issue in OH2 Beta 2.
Is this correct? or should it be fixed by now?

Thanks, regards.
Gonzalo