digitalSTROM - restoreOnStartup does not work

I’m using the digitalSTROM (dS) binding but unfortunately persistence and restoreOnStartup does not work. As soon as I reboot my openHAB server, all dS items are turned on (just the OH switches, the physical lights keep their state).

For all other bindings and items the default persistence and restoreOnStartup strategy based on mabdb work. In my opinion this means that persistence and restore is set up correctly.

Does anyone have experience with persistence/restore with dS binding?

In my opinion the restore is to early. In the log/event files I see that all items get set to their prior state, but then get overwritten as soon as dS Binding is up.

Here’s a summary of events and openhab log for dS Binding as well as one specific item (directly some seconds after a reboot):

13:18:03.174 Loading model 'digitalstrom.items'
13:18:19.675 Link 'dim_gOG00wc_wandlampe-digitalstrom:GE:302ed89f43f02ba000010321:303505d7f80000400003e5cc:brightness' has been added.
13:18:35.369 dim_gOG00wc_wandlampe changed from NULL to 0
13:18:35.665 Initializing digitalSTROM Manager
13:18:36.554  Building digitalSTROM model
13:18:37.755 dim_gOG00wc_wandlampe changed from 0 to 100

The first state of the item = 0 is correct. This one is based on mapdb restore.

The DS binding will update the items to their actual states the restoreOnStartup will only send an update to the item, not a command and therefore not go through the binding.

To send a command to your items on startup you need to do something like this:
For example for the group “Lights”

rule "Restore lights"
    System started
    Lights.members.forEach[ light | light.sendCommand(light.previousState) ]

Hi Vincent

This is what I want. OH should just show the prior state of the items. I don’t want to send any command to a physical device. Right now the state of the items does not match with the state of the physical devices after a reboot. In my opinion dS binding updates all switches to ON and all dimmers to 100 after a reboot independent of the real state of a physical device.

Assuming restoreOnStartup has run you just need to light.sendCommand(light.state). Though with the startup timing issues you can’t always guarantee that all the Items have been restored when a System started Rule runs so it might be required to add a sleep or move the line to a timer to run a few seconds after the System started rule runs.

I’d put the binding into debug or trace logging and see if there is something logged telling you what it is doing during startup. You will need this info anyway for the next step.

I agree, based on what you describe and the logs you posted it does look like the binding is changing the Item. This appears to be incorrect so you will want to file an issue on the binding. I don’t know if this is a 1.x or 2.x addon. There is a separate repo on github for each:

It is an ESH Binding, so issue shoul be filed at

1 Like

Thanks for all your inputs!

@hmerk, @loci, @maxx92, @Tucka and all dS binding users: Do you experience the same thing with dS binding?

No, never had an issue that restored states don’t match real ones.

I will check on reboot. I have the issue when items are changed from within dss. status does not get updated in OH.