When restarting the openhab2 service or my raspberry pi3, rules show as uninitialized when paperui comes back up. I have MQTT binding installed, and have succesfully configured mysql persistence and jdbc yesterday. The rules issue was also there before I configured all this. I understand they were dependent on SQL/persistence, so I had hoped this issue would be resolved once I configured that.
I’ve already adjusted the configuration refresh settings in configurations/openhab.cfg as follows:
[quote=“sihui, post:2, topic:27629”]
Persistence is the correct way to solve that problem, but you have to configure it like:
[/quote]
This is my persistence strategy:
so where do I specify the mentioned setting then? Every google result that seems related to my problem still references it >_< If you could point me in the right direction, that would be helpful
I think I still need to make sure the rules load/init AFTER persistence is loaded, since I did find multiple google results mentioning rules become/stay uninitialized because the item used in them has no current value. So when it restores the stored value before it tries to init the rules, then it might just work instantly.
Most google results reference openhab1 though, so getting this to work in openhab2 is confusing.
so, is the folder used by openhab still
/etc/openhab2/configurations
, or is it
/etc/openhab2/conf
?
I’ve deleted openhab.cfg in my configurations folder, it doesn’t make a difference. So you were right in that is isn’t being used by openhab2.
As you have already found out, that is done through persistence and restoreOnStartup
To find out if the item value is persisted, you may use the REST Api:
http://<ip_adress_oh_server>:8080/doc/index.html
Go to Persistence -> GET /persistence/items/{itemname}, fill in your persistence service at “serviceID”, fill in your itemname at “itemname” and hit “Try it out”.
You should then see the persisted value (if your persistence service is working)
If you don’t have the REST Api available, install the “Rest Documentation” at MISC tab under Add-Ons.
Yes, looks good So no need to investigate further in items having no state at startup.
Unfortunately I’m not of any help regarding the experimental rule engine.
It’s still a topic about the rules being uninitialized so my question is now, where can I control when these rules initialize? In my first post I post the config I used in openhab.cfg, but since that’s obsolete I should be able to control those settings in another file, no?
but no idea what to add or remove. I can see it nicely follows openhab in choosing MySQL as the standard interface, but that’s about it. Can’t seem to find the bundles folder in which the file I need to edit resides
Hi there. Did you ever find a solution to this problem? I have an identical one and I too am using the experimental rules engine off which there is still naturally very little info available…
I found today a reason why some of my rules stopped working.
I had several rules that were rather similar (all for rollershutters)
so I first created one rule that worked well.
and then I created copies for other and I replaced the active parts (aka the buttons and the rollershutters)
That worked well for all of them, and still they always stopped working and when I reloaded them with an extra space or so, they worked again.
My problem was I all gave them the same rule name
“rule rollershutter changes"
and not
"rule rollershutter bedroom Parents changes”
“rule rollershutter bedroom Child 1 changes”
What I think happened was everytime I ran one, it replaced in memory the other rule (with the same name)
yes of course functions can’t have the same name, yet when I load multiple rule files with rules with the same name, openhab does not complain (or I don’t see it)