rossko57
(Rossko57)
June 26, 2021, 6:30pm
33
So, there’s no reason to think it won’t still be NULL? All Items are created with state NULL and that’s the way they stay, unless restored by persistence (which would necessitate having a non-NULL state in the past), poked by a rule, or poked by a binding.
It’s up to you, which are you expecting to have happened?
Might be useful -
Ultimately you need to bootstrap the Number Item with a value before the Setpoint will work. You can do this using a System started rule that you only keep around for one trigger to populate the Number with an initial value and then rely on persistence and restore on startup to preserve the value from then on.
It needs a value to begin with,before adding/subtracting.
You might use a “bootstrap rule” to update your Item with some state (0?) at system start if it is currently NULL.
Info: if you link that Item to a modbus data Thing with read capability … the next read poll will overwrite your “initialized” Item state anyway.
A first poll will most likely have already run before your rule, and your rule will overwrite the polled data.
At the next poll after your rule has run, the polled data will overwrite your rule data again.
It is possible to make write-only modbus data Things, if that is what you have in mind.
A tweak to your rule that only “initializes” if no pol…