openhab / openhab-core

Core framework of openHAB
https://www.openhab.org/
Eclipse Public License 2.0
912 stars 420 forks source link

OH3 rules based on .rules files not fireing after a reboot #2221

Closed ako-3004 closed 3 years ago

ako-3004 commented 3 years ago

Sorry to open another issue with this behaviour, found other issues with a similar - but not the same behavior. The problem is also discussed here https://community.openhab.org/t/rules-stopped-working-after-upgrading-to-oh3/112201 but the solution does not work for me - it seems there is still a bug.

I already own a OH2.5 on a raspberry 3, for not running into conflicts my decision was to start from scratch and build up a new and clean system. So I set up a completely new OH3 based on openhabian-image on raspberry pi 4 (8 GB). There I created the first things, items and rules based on files from my OH2.5.

Based on many tests I can confirm that all rules run fine and without errors after beeing edited and saved, but never run after a system reboot.

On system boot the log reports 2 rule files to be loaded successful:

2021-03-01 02:43:18.321 [INFO ] [.core.internal.i18n.I18nProviderImpl] - Location set to '48.147768538753304,8.543313145637514'.
2021-03-01 02:43:18.324 [INFO ] [.core.internal.i18n.I18nProviderImpl] - Locale set to 'de_DE'.
2021-03-01 02:43:26.030 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'home.mqtt.wohnzimmer.licht.items'
2021-03-01 02:43:26.635 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'home.mqtt.wohnzimmer.wohnwand.items'
2021-03-01 02:43:26.666 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'home.mqtt.wohnzimmer.led.items'
2021-03-01 02:43:27.266 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'home.sitemap'
2021-03-01 02:43:27.578 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'mqtt.things'
2021-03-01 02:43:30.039 [INFO ] [.core.model.lsp.internal.ModelServer] - Started Language Server Protocol (LSP) service on port 5007
2021-03-01 02:43:30.280 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'home.mqtt.wohnzimmer.led.rules'
2021-03-01 02:43:33.712 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'home.mqtt.wohnzimmer.wohnwand.rules'
2021-03-01 02:43:37.388 [WARN ] [.transport.servlet.ServletController] - Can't find the request for http://192.168.1.15:8080/rest/sitemaps/events/subscribe's Observer 
2021-03-01 02:43:37.689 [INFO ] [org.openhab.ui.internal.UIService   ] - Started UI on port 8080
2021-03-01 02:43:39.427 [INFO ] [ab.ui.habpanel.internal.HABPanelTile] - Started HABPanel at /habpanel
2021-03-01 02:43:40.985 [INFO ] [ternal.communicator.client.RpcClient] - Interface 'WIRED' on gateway '3014F711A061A7DA498F9CA2' not available, disabling support
2021-03-01 02:43:41.010 [INFO ] [ternal.communicator.client.RpcClient] - Interface 'CUXD' on gateway '3014F711A061A7DA498F9CA2' not available, disabling support
2021-03-01 02:43:41.137 [INFO ] [ommunicator.AbstractHomematicGateway] - HmGatewayInfo[id=CCU,type=CCU2,firmware=3.49.17.20200131,address=QEQ0406690,rf=true,wired=false,hmip=true,cuxd=false,group=true]
2021-03-01 02:43:43.259 [INFO ] [.transport.mqtt.MqttBrokerConnection] - Starting MQTT broker connection to '192.168.1.15' with clientid d0f88ce1-df85-4d19-a8a3-ab517c72bad2
2021-03-01 02:43:43.291 [INFO ] [.transport.mqtt.MqttBrokerConnection] - Starting MQTT broker connection to '192.168.1.15' with clientid openHAB3
2021-03-01 02:43:43.638 [INFO ] [e.automation.internal.RuleEngineImpl] - Rule engine started.

one rule for example has this simple code. I tried wit logInfo() on many rules, after reboot none of them ever fires.

rule "System_started" 
when
    System started
    or Time cron "0/8 * * ? * * *"
then
    logInfo("home.mqtt.wohnzimmer.led.items", "rule System_started_and_time_cron_trigger")
[...]

so it should be triggered after system start and every 10 seconds. But it does not. then after a reboot I just have to open the rule file, change it and safe it. Almost instant, the rule begins to work and fires based on its cron setting.

2021-03-01 02:51:27.519 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'home.mqtt.wohnzimmer.led.rules'
2021-03-01 02:51:32.076 [INFO ] [cript.home.mqtt.wohnzimmer.led.items] - rule System_started_and_time_cron_trigger
2021-03-01 02:51:40.076 [INFO ] [cript.home.mqtt.wohnzimmer.led.items] - rule System_started_and_time_cron_trigger

All rules work correctly after beeing manually initialized (Some switches and LED RGB Controls) without any errors. But never after a reboot.

I would describe myself as a basic OH user, with basic experience. I try my best to give needed information for finding a solution for this.

Rossko57 commented 3 years ago

See forum post https://community.openhab.org/t/issues-after-update-to-oh-3/115352

... Loading model 'home.mqtt.wohnzimmer.led.rules' ... Loading model 'home.mqtt.wohnzimmer.wohnwand.rules'

The filenames using dot notation with the same words are the problem.

ako-3004 commented 3 years ago

Sometimes things are fixed quite easy... thanks a lot! That did it!