fuetti
(fütti)
December 30, 2020, 8:16pm
1
Platform information:
Hardware: x86 HyperV VM
OS: Windows Server
Java Runtime Environment: zulu 11
openHAB version: 3.0.0
Issue of the topic:
I have severale rule files containing different kind of rules and many of them where broken after update to 3.0 - mainly because the change of time types and persistance type of contact and switched (float to int).
After I fixed this errors I noticed that in openhab.log there are logs missing. After little more debugging I found out, that I only see log entries in openhab.log from the rules file that was changed at last.
After I merged the content of two rule files in one both log entries startet to apprear in the log and seemto be executed normally. Other rules, that are still in a separate file are not executed.
For me this seems like a bug when using more than onle rule file!
Also it seems that I also get displayed the rules in the UI which are in the rules file that was changed last!
Can anyone confirm or disconfirm this behavior with OH3?
fuetti
(fütti)
January 1, 2021, 4:01pm
2
/bump - anyone else expeting this too? I am wondering what the source could be, if its only me having this problem?
ChrisSc
(Chris)
January 1, 2021, 7:24pm
3
Here’s an issue filed in openhab-core which seems to be related:
opened 08:33PM - 28 Dec 20 UTC
closed 01:29PM - 06 Jan 21 UTC
I have issue similar to #1829 , but with different behavior:
My setup
* Setu… p completely made from files configuration (.rules and .things files)
* Version: Openhab 3.0.0, run in docker
* Full config in github: https://github.com/petrows/smarthome-openhab
Problems
* Reload of rules DSL file may remove all other rules from other files matching the pattern `name-XXX.rules`, e.g. reloading of `light.rules` file also removes rules from files `light-astrocolor.rules` and `light-sunrize.rules`
* Reload of items files with same name as rules files may remove rules from this file, e.g. reloading of `heating.items` removes all rules from `heating.rules`.
Examples how i can reproduce this:
Just after start, all rules are loaded (56 rules total):
```
openhab> openhab:automation listRules
----------------------------------------------------------------------------------------------------
ID UID NAME STATUS
----------------------------------------------------------------------------------------------------
1 common-1 System started IDLE
2 common-2 Presence master IDLE
3 common-3 Waterleak IDLE
4 common-4 Test devices responce time IDLE
5 common-5 Fridge start at friday IDLE
6 common-6 Fridge stop at sunday IDLE
7 gen-1 Marina Desktop light apply color on ON IDLE
8 gen-2 Treppe Up light apply color on ON IDLE
9 gen-3 Treppe Down light apply color on ON IDLE
10 gen-4 Petro Desktop light apply color on ON IDLE
11 heating-1 Heating safe switch IDLE
12 heating-2 Heating NIGHT IDLE
13 heating-3 Heating MORNING IDLE
14 heating-4 Heating DAY IDLE
15 heating-5 Heating EVENING IDLE
16 heating-6 Auto command IDLE
17 heating-7 Heating NS boost switch IDLE
18 heating-8 Heating presense switch IDLE
19 heating-9 Heating master switch IDLE
20 light-1 Ligth master mode IDLE
21 light-10 KG Lager light changed IDLE
22 light-2 Ligth master mode status IDLE
23 light-3 Light safe switch IDLE
24 light-4 KG safe switch IDLE
25 light-5 NS follow table power IDLE
26 light-6 BZ force both lights work together IDLE
27 light-7 Sunset Rule IDLE
28 light-8 Petro desktop power IDLE
29 light-9 KG Treppe light changed IDLE
30 light-astrocolor-1 Astrocolor: Reset lamps state IDLE
31 light-astrocolor-2 Astrocolor: Set lamps color according to daytime IDLE
32 light-sunrise-1 Sinrise emulation auto off IDLE
33 light-sunrise-2 Sinrise emulation start IDLE
34 motion-1 KG Motion detect treppe IDLE
35 motion-2 KG Motion detect Lager IDLE
36 notification-1 Online notify IDLE
37 notification-2 LowBattery notify IDLE
38 notification-3 Sunset Rule 2 IDLE
39 remote-1 Spiegel control SW IDLE
40 remote-2 House verlassen SW IDLE
41 remote-3 KG Ladder BOTTOM btn IDLE
42 remote-4 KG Ladder UP btn IDLE
43 remote-5 KG Lager btn IDLE
44 remote-6 Petro desktop remote IDLE
45 remote-7 Marina desktop remote IDLE
46 remote-8 SZ remote sw IDLE
47 remote-9 KU Arbeitlicht SW IDLE
48 washmachine-1 Washmachine power IDLE
49 yeelight-1 Yeelight 1 power IDLE
50 yeelight-2 Yeelight 1 brightness IDLE
51 yeelight-3 Yeelight 1 color temp IDLE
52 yeelight-4 Yeelight 1 color IDLE
53 yeelight-5 mi-lamp-2.pws power IDLE
54 yeelight-6 mi-lamp-2.pws brightness IDLE
55 yeelight-7 mi-lamp-2.pws color temp IDLE
56 zigbee-1 Coordinator log IDLE
----------------------------------------------------------------------------------------------------
```
In ~10 seconds 4 rules are removed (52 rules left). Removed:
- Astrocolor https://github.com/petrows/smarthome-openhab/tree/6a75f1eb21caacc7dfd98405fafe79a8e2d185fb/rules/light-astrocolor.rules
- Sunrize: https://github.com/petrows/smarthome-openhab/tree/6a75f1eb21caacc7dfd98405fafe79a8e2d185fb/rules/light-sunrise.rules
```
openhab> openhab:automation listRules
----------------------------------------------------------------------------------------------------
ID UID NAME STATUS
----------------------------------------------------------------------------------------------------
1 common-1 System started IDLE
2 common-2 Presence master IDLE
3 common-3 Waterleak IDLE
4 common-4 Test devices responce time IDLE
5 common-5 Fridge start at friday IDLE
6 common-6 Fridge stop at sunday IDLE
7 gen-1 Marina Desktop light apply color on ON IDLE
8 gen-2 Treppe Up light apply color on ON IDLE
9 gen-3 Treppe Down light apply color on ON IDLE
10 gen-4 Petro Desktop light apply color on ON IDLE
11 heating-1 Heating safe switch IDLE
12 heating-2 Heating NIGHT IDLE
13 heating-3 Heating MORNING IDLE
14 heating-4 Heating DAY IDLE
15 heating-5 Heating EVENING IDLE
16 heating-6 Auto command IDLE
17 heating-7 Heating NS boost switch IDLE
18 heating-8 Heating presense switch IDLE
19 heating-9 Heating master switch IDLE
20 light-1 Ligth master mode IDLE
21 light-10 KG Lager light changed IDLE
22 light-2 Ligth master mode status IDLE
23 light-3 Light safe switch IDLE
24 light-4 KG safe switch IDLE
25 light-5 NS follow table power IDLE
26 light-6 BZ force both lights work together IDLE
27 light-7 Sunset Rule IDLE
28 light-8 Petro desktop power IDLE
29 light-9 KG Treppe light changed IDLE
30 motion-1 KG Motion detect treppe IDLE
31 motion-2 KG Motion detect Lager IDLE
32 notification-1 Online notify IDLE
33 notification-2 LowBattery notify IDLE
34 notification-3 Sunset Rule 2 IDLE
35 remote-1 Spiegel control SW IDLE
36 remote-2 House verlassen SW IDLE
37 remote-3 KG Ladder BOTTOM btn IDLE
38 remote-4 KG Ladder UP btn IDLE
39 remote-5 KG Lager btn IDLE
40 remote-6 Petro desktop remote IDLE
41 remote-7 Marina desktop remote IDLE
42 remote-8 SZ remote sw IDLE
43 remote-9 KU Arbeitlicht SW IDLE
44 washmachine-1 Washmachine power IDLE
45 yeelight-1 Yeelight 1 power IDLE
46 yeelight-2 Yeelight 1 brightness IDLE
47 yeelight-3 Yeelight 1 color temp IDLE
48 yeelight-4 Yeelight 1 color IDLE
49 yeelight-5 mi-lamp-2.pws power IDLE
50 yeelight-6 mi-lamp-2.pws brightness IDLE
51 yeelight-7 mi-lamp-2.pws color temp IDLE
52 zigbee-1 Coordinator log IDLE
----------------------------------------------------------------------------------------------------
```
If i will update removed file "light-astrocolor.rules" with white space change:
```
[INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'light-astrocolor.rules'
```
Rules return back to list (only from this file - nr 30 and 31):
```
openhab> openhab:automation listRules
----------------------------------------------------------------------------------------------------
ID UID NAME STATUS
----------------------------------------------------------------------------------------------------
1 common-1 System started IDLE
2 common-2 Presence master IDLE
3 common-3 Waterleak IDLE
4 common-4 Test devices responce time IDLE
5 common-5 Fridge start at friday IDLE
6 common-6 Fridge stop at sunday IDLE
7 gen-1 Marina Desktop light apply color on ON IDLE
8 gen-2 Treppe Up light apply color on ON IDLE
9 gen-3 Treppe Down light apply color on ON IDLE
10 gen-4 Petro Desktop light apply color on ON IDLE
11 heating-1 Heating safe switch IDLE
12 heating-2 Heating NIGHT IDLE
13 heating-3 Heating MORNING IDLE
14 heating-4 Heating DAY IDLE
15 heating-5 Heating EVENING IDLE
16 heating-6 Auto command IDLE
17 heating-7 Heating NS boost switch IDLE
18 heating-8 Heating presense switch IDLE
19 heating-9 Heating master switch IDLE
20 light-1 Ligth master mode IDLE
21 light-10 KG Lager light changed IDLE
22 light-2 Ligth master mode status IDLE
23 light-3 Light safe switch IDLE
24 light-4 KG safe switch IDLE
25 light-5 NS follow table power IDLE
26 light-6 BZ force both lights work together IDLE
27 light-7 Sunset Rule IDLE
28 light-8 Petro desktop power IDLE
29 light-9 KG Treppe light changed IDLE
30 light-astrocolor-1 Astrocolor: Reset lamps state IDLE
31 light-astrocolor-2 Astrocolor: Set lamps color according to daytime IDLE
32 motion-1 KG Motion detect treppe IDLE
33 motion-2 KG Motion detect Lager IDLE
34 notification-1 Online notify IDLE
35 notification-2 LowBattery notify IDLE
36 notification-3 Sunset Rule 2 IDLE
37 remote-1 Spiegel control SW IDLE
38 remote-2 House verlassen SW IDLE
39 remote-3 KG Ladder BOTTOM btn IDLE
40 remote-4 KG Ladder UP btn IDLE
41 remote-5 KG Lager btn IDLE
42 remote-6 Petro desktop remote IDLE
43 remote-7 Marina desktop remote IDLE
44 remote-8 SZ remote sw IDLE
45 remote-9 KU Arbeitlicht SW IDLE
46 washmachine-1 Washmachine power IDLE
47 yeelight-1 Yeelight 1 power IDLE
48 yeelight-2 Yeelight 1 brightness IDLE
49 yeelight-3 Yeelight 1 color temp IDLE
50 yeelight-4 Yeelight 1 color IDLE
51 yeelight-5 mi-lamp-2.pws power IDLE
52 yeelight-6 mi-lamp-2.pws brightness IDLE
53 yeelight-7 mi-lamp-2.pws color temp IDLE
54 zigbee-1 Coordinator log IDLE
----------------------------------------------------------------------------------------------------
```
And, they are functional (reacting on command `openhab:things trigger astro:sun:home:set#event START`) with proper log messages.
Here is the interesting part!
Updating of file `light` removes `light-astrocolor` again:
```
[INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'light.rules'
openhab> openhab:automation listRules
----------------------------------------------------------------------------------------------------
ID UID NAME STATUS
----------------------------------------------------------------------------------------------------
1 common-1 System started IDLE
2 common-2 Presence master IDLE
3 common-3 Waterleak IDLE
4 common-4 Test devices responce time IDLE
5 common-5 Fridge start at friday IDLE
6 common-6 Fridge stop at sunday IDLE
7 gen-1 Marina Desktop light apply color on ON IDLE
8 gen-2 Treppe Up light apply color on ON IDLE
9 gen-3 Treppe Down light apply color on ON IDLE
10 gen-4 Petro Desktop light apply color on ON IDLE
11 heating-1 Heating safe switch IDLE
12 heating-2 Heating NIGHT IDLE
13 heating-3 Heating MORNING IDLE
14 heating-4 Heating DAY IDLE
15 heating-5 Heating EVENING IDLE
16 heating-6 Auto command IDLE
17 heating-7 Heating NS boost switch IDLE
18 heating-8 Heating presense switch IDLE
19 heating-9 Heating master switch IDLE
20 light-1 Ligth master mode IDLE
21 light-10 KG Lager light changed IDLE
22 light-2 Ligth master mode status IDLE
23 light-3 Light safe switch IDLE
24 light-4 KG safe switch IDLE
25 light-5 NS follow table power IDLE
26 light-6 BZ force both lights work together IDLE
27 light-7 Sunset Rule IDLE
28 light-8 Petro desktop power IDLE
29 light-9 KG Treppe light changed IDLE
30 motion-1 KG Motion detect treppe IDLE
31 motion-2 KG Motion detect Lager IDLE
32 notification-1 Online notify IDLE
33 notification-2 LowBattery notify IDLE
34 notification-3 Sunset Rule 2 IDLE
35 remote-1 Spiegel control SW IDLE
36 remote-2 House verlassen SW IDLE
37 remote-3 KG Ladder BOTTOM btn IDLE
38 remote-4 KG Ladder UP btn IDLE
39 remote-5 KG Lager btn IDLE
40 remote-6 Petro desktop remote IDLE
41 remote-7 Marina desktop remote IDLE
42 remote-8 SZ remote sw IDLE
43 remote-9 KU Arbeitlicht SW IDLE
44 washmachine-1 Washmachine power IDLE
45 yeelight-1 Yeelight 1 power IDLE
46 yeelight-2 Yeelight 1 brightness IDLE
47 yeelight-3 Yeelight 1 color temp IDLE
48 yeelight-4 Yeelight 1 color IDLE
49 yeelight-5 mi-lamp-2.pws power IDLE
50 yeelight-6 mi-lamp-2.pws brightness IDLE
51 yeelight-7 mi-lamp-2.pws color temp IDLE
52 zigbee-1 Coordinator log IDLE
----------------------------------------------------------------------------------------------------
```
Rules from `light-astrocolor` disappears again. Also, they are not reacting on trigger anymore.
Please, let me know, if i can help you with some logs or something.