Lights Control Hardware (PLC)

The import goes just once at the beginning of the file.
It’s needed to use the x.setBit() method, if it went wrong there would be errors in your openhab.log. You’ve looked in there?
What does happen when you command a light? Your events.log will show us some idea of how far it gets.

In the log there is named a error in the first rule (Taster01.rules). It is missing EOF at ‘Die’ what ever that means?

Maybe you are able to understand that?openhab.log (46.3 KB)

It was ‘missing etc.’ previously. Since that time, the same rules file has loaded successfully, due to edits I guess. ‘Missing EOF’ is generally about mismatched brackets, missing rule end statements, or suchlike.

Most likely there is a small error crept in during copy-paste somewhere. An editor like VSCode helps to find mistakes like that,otherwise just look carefully.
No-obvious errors like quotemarks placement or type are hard to see.

Hi rossko57,

thats a good hint i will try that and give a feedback!
thank you again!

Ok i created a new xxx.rules and opened it in notepad++

It looks okay for me ?!

but the log saying the same:

2021-01-30 12:17:58.981 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'Wohnhaus01.items'
2021-01-30 12:20:59.713 [WARN ] [ab.core.service.AbstractWatchService] - Error while opening file during update: C:\Program Files\OpenHab\conf\rules\Taster01.rules
2021-01-30 12:21:01.261 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'Taster01.rules'
2021-01-30 12:21:01.885 [WARN ] [el.core.internal.ModelRepositoryImpl] - Configuration model 'Taster01.rules' has errors, therefore ignoring it: [28,1]: missing EOF at 'Die'

2021-01-30 12:21:02.917 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'Taster01.rules'
2021-01-30 12:21:03.043 [WARN ] [el.core.internal.ModelRepositoryImpl] - Configuration model 'Taster01.rules' has errors, therefore ignoring it: [28,1]: missing EOF at 'Die'

2021-01-30 12:21:51.354 [WARN ] [ab.core.service.AbstractWatchService] - Error while opening file during update: C:\Program Files\OpenHab\conf\rules\Taster02.rules
2021-01-30 12:21:52.823 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'Taster02.rules'
2021-01-30 12:21:55.105 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'Taster02.rules'
2021-01-30 12:30:26.448 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'Wohnhaus01.items'
2021-01-30 12:32:46.340 [ERROR] [internal.handler.ScriptActionHandler] - Script execution of rule with UID 'Taster02-1' failed: cannot invoke method public abstract org.openhab.core.types.State org.openhab.core.items.Item.getState() on null in Taster02
2021-01-30 12:32:47.178 [ERROR] [internal.handler.ScriptActionHandler] - Script execution of rule with UID 'Taster02-1' failed: cannot invoke method public abstract org.openhab.core.types.State org.openhab.core.items.Item.getState() on null in Taster02
2021-01-30 12:32:48.699 [ERROR] [internal.handler.ScriptActionHandler] - Script execution of rule with UID 'Taster02-1' failed: cannot invoke method public abstract org.openhab.core.types.State org.openhab.core.items.Item.getState() on null in Taster02
2021-01-30 12:34:22.885 [ERROR] [internal.handler.ScriptActionHandler] - Script execution of rule with UID 'Taster02-1' failed: cannot invoke method public abstract org.openhab.core.types.State org.openhab.core.items.Item.getState() on null in Taster02
2021-01-30 12:34:24.448 [ERROR] [internal.handler.ScriptActionHandler] - Script execution of rule with UID 'Taster02-1' failed: cannot invoke method public abstract org.openhab.core.types.State org.openhab.core.items.Item.getState() on null in Taster02
2021-01-30 12:34:27.042 [ERROR] [internal.handler.ScriptActionHandler] - Script execution of rule with UID 'Taster02-1' failed: cannot invoke method public abstract org.openhab.core.types.State org.openhab.core.items.Item.getState() on null in Taster02
2021-01-30 13:15:27.700 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'Taster01.rules'
2021-01-30 13:15:27.854 [WARN ] [el.core.internal.ModelRepositoryImpl] - Configuration model 'Taster01.rules' has errors, therefore ignoring it: [28,1]: missing EOF at 'Die'

2021-01-30 13:19:54.166 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'Taster01.rules'
2021-01-30 13:19:54.260 [WARN ] [el.core.internal.ModelRepositoryImpl] - Configuration model 'Taster01.rules' has errors, therefore ignoring it: [30,1]: missing EOF at 'Die'

2021-01-30 13:22:59.744 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'Wohnhaus01.items'
2021-01-30 13:24:35.328 [WARN ] [ab.core.service.AbstractWatchService] - Error while opening file during update: C:\Program Files\OpenHab\conf\items\Wohnhaus01.items
2021-01-30 13:24:36.354 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'Wohnhaus01.items'
2021-01-30 13:25:53.058 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'Wohnhaus01.items'
2021-01-30 13:28:24.137 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'Taster01.rules'
2021-01-30 13:28:24.231 [WARN ] [el.core.internal.ModelRepositoryImpl] - Configuration model 'Taster01.rules' has errors, therefore ignoring it: [28,1]: missing EOF at 'Die'

2021-01-30 13:29:39.323 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'Taster01.rules'
2021-01-30 17:18:51.512 [INFO ] [org.openhab.core.model.script.test  ] - Who is there?
2021-01-30 17:18:55.465 [INFO ] [org.openhab.core.model.script.test  ] - Who is there?
2021-01-30 17:50:31.215 [INFO ] [org.openhab.core.model.script.test  ] - Who is there?
2021-01-30 17:50:32.246 [INFO ] [org.openhab.core.model.script.test  ] - Who is there?
2021-01-30 17:50:40.543 [INFO ] [org.openhab.core.model.script.test  ] - Who is there?
2021-01-30 21:17:35.512 [INFO ] [org.openhab.core.model.script.test  ] - Who is there?
2021-01-31 09:41:19.376 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'Taster01.rules'
2021-01-31 09:41:20.229 [INFO ] [el.core.internal.ModelRepositoryImpl] - Validation issues found in configuration model 'Taster01.rules', using it anyway:
The import 'java.math.BigInteger' is never used.
2021-01-31 12:07:06.276 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'Taster01.rules'
2021-01-31 12:07:06.931 [INFO ] [el.core.internal.ModelRepositoryImpl] - Validation issues found in configuration model 'Taster01.rules', using it anyway:
The import 'java.math.BigInteger' is never used.

I cannot figure out what is wrong :frowning:

Without knowing the name or time there is no way for us to know what logs have anything to do with this one.

Please note that every rule must have a system-wide unique “name”. Copying rules from one file to another is a good quick way to narrow down - if you avoid that trap.

Please note that screenshots cannot be pasted into other people’s editors to check for weird characters etc. If your editor allows “make whitespace visible” or similar, worth a try.

Oh ok, the two rules which you have posted are named in Taster01.rules and Taster02.rules.
I just wanted to show that in the Editor are no fault are shown…

here are the two rule which i have added:

Taster01.rules.txt (1.2 KB) Taster02.rules.txt (573 Bytes)

Ok will check out if there is such a option

Taster01.rules and Taster02.rules validate okay for me.

01 includes an import that the one rule there doesn’t use, so there’s a WARN from that, but that is harmless. (The import is only for the bit-push rule)

I can’t find any text content “Die” so I expect you’ve already fixed that.
What errors do you currently get?

Where is the third bit-push rule, it’s necessary to work the modbus?

I think i missunderstood something?

The first rule that i have was updated by your instructions:

and then i added a second rule as you said:

but the third rule i don´t have one?

This one, this willbe why you got no action if you removed it

rule "simulate vlag pushbutton"
    // this rule pushes and releases buttons
...

it’s the one that uses the import.

What errors do you currently have in your openhab.log at rules load time?

there is the mistake i changed this one and though i have just two rules! Ok i will do it again with three rules and give a feedback :confounded:

sorry

Hi rossko57,

i created every rule from new and now it is working!

Thank you again!

1 Like