I have configured the persistence using a mysql DB.
Now I’ve noticed, if I restart openhab service (at least) one item starts as NULL and then switches to the correct value. The item itself is a String item that fetches its value via http binding.
Is it expected it starts with NULL value, followed by a change to the correct value?
I would have expected it starts with the value from the DB, then it updates the value via http binding.
I’d like to check if the String item contains a new / changed value. In this case a notification will be sent to my smartphone. As mentioned above, the item starts as NULL and thus my rule (when item changed) triggers.
How can I avoid this?
In the rule I use
if (MyStringitem.previousState == NULL)
Unfortunately this leads to an error message:
The name ‘NULL’ cannot be resolved to an item or type