Openhab2 and ShellScript

Hello dear community

Unfortunately, I have found for my mistakes nothing in the search, maybe I see the forest in front of loud trees but I can not go now.
Following problem.
I have scripts to control and read out my ventilation system, these run on the console among the users openhabian and openhab without errors.

But in the interface (BasicUI) they do not work unfortunately.
The following error messages always occur in the log:

2017-07-10 20:04:15.915 [WARN ] [ome.core.thing.internal.ThingManager] - Cannot delegate command '0' for item 'lueftung_switch' to handler for channel 'exec:command:lueftungstatus:output', because no thing with the UID 'exec:command:lueftungstatus' could be found.
2017-07-10 20:04:15.926 [WARN ] [ome.core.thing.internal.ThingManager] - Cannot delegate command '0' for item 'lueftung_switch' to handler for channel 'exec:command:lueftungschalten:input', because no thing with the UID 'exec:command:lueftungschalten' could be found.
2017-07-10 20:04:15.929 [ItemCommandEvent          ] - Item 'lueftung_switch' received command 0
2017-07-10 20:04:15.940 [WARN ] [ome.core.thing.internal.ThingManager] - Cannot delegate update '0' for item 'lueftung_switch' to handler for channel 'exec:command:lueftungstatus:output', because no thing with the UID 'exec:command:lueftungstatus' could be found.
2017-07-10 20:04:15.945 [WARN ] [ome.core.thing.internal.ThingManager] - Cannot delegate update '0' for item 'lueftung_switch' to handler for channel 'exec:command:lueftungschalten:input', because no thing with the UID 'exec:command:lueftungschalten' could be found.
	
2017-07-10 20:05:16.419 [WARN ] [ome.core.thing.internal.ThingManager] - Cannot delegate command '0' for item 'lueftung_modus' to handler for channel 'exec:command:lueftungmodus1:output', because no thing with the UID 'exec:command:lueftungmodus1' could be found.
2017-07-10 20:05:16.422 [WARN ] [ome.core.thing.internal.ThingManager] - Cannot delegate command '0' for item 'lueftung_modus' to handler for channel 'exec:command:lueftungmodus_schalten1:input', because no thing with the UID 'exec:command:lueftungmodus_schalten1' could be found.


.thing

Thing exec:command:lueftungschalten [ command="/bin/bash /home/openhabian/scripts/lueftung_schalten.sh %2$s", interval=0, timeout=20, autorun=false ]
Thing exec:command:lueftungstatus [ command="/bin/bash /home/openhabian/scripts/lueftung_schalten.sh", interval=10, timeout=30, autorun=true ]
Thing exec:command:lueftungmodus_schalten1 [ command="/bin/bash /home/openhabian/scripts/lueftung_modus_schalten.sh %2$s", interval=30, timeout=30, autorun=false ]
Thing exec:command:lueftungmodus1 [ command="/bin/bash /home/openhabian/scripts/lueftung_modus_schalten.sh", interval=30, timeout=30, autorun=true ]

.item

String lueftung_switch "Status" <fan> [ "Switchable" ] { channel="exec:command:lueftungschalten:input", channel="exec:command:lueftungstatus:output", autoupdate="true" }
String lueftung_modus "Modus" <settings> { channel="exec:command:lueftungmodus_schalten1:input", channel="exec:command:lueftungmodus1:output", autoupdate="false" }

.sitemap

sitemap lueftung label="Lüftung"
{
	Frame label="Lüftung Schalten" {
                Switch item=lueftung_switch mappings=[ "0"="Strom", "1"="Akku", "2"="Aus" ]
                Switch item=lueftung_modus mappings=[ "0"="Automatik", "1"="Manuell" ]
        }



}

Where is my mistake?

I am grateful for any help and advice

I use the following bindings.

Exec Binding
binding-exec - 2.1.0


Exec Binding (1.x)
binding-exec1 - 1.10.0

Greetings Tobi

The problem is for some reason your .things file is not being loaded or parsed correctly. Consequently, the Things do not exist. Look for errors in openhab.log when the .things file is loaded. Open the .things file in ESH Designer 0.8 to look for syntax errors.

Is this “.thing”? Because it should be “.things”

Thx for the answer.

The file ending is .things

I’ll try the designer.

no config issue

Does anyone have an idea why that does not work? Or is there another way I can solve that?

Greetings Tobi

If you follow the openhab2 log, does it pick up the fact that you’ve updated the .things file whenever you edit it?

Yes that’s right. This must be so, or not?

Logfile with saved meine.things, after that i pushd every button in the Basic UI to produces this Errors.

Where is my mistake?

Log:

2017-07-14 11:21:09.542 [INFO ] [el.core.internal.ModelRepositoryImpl] - Refreshing model 'meine.things'
2017-07-14 11:21:10.088 [WARN ] [ome.core.thing.internal.ThingManager] - Cannot delegate command '0' for item 'lueftung_switch' to handler for channel 'exec:command:lueftungstatus:output', because no thing with the UID 'exec:command:lueftungstatus' could be found.
2017-07-14 11:21:10.093 [WARN ] [ome.core.thing.internal.ThingManager] - Cannot delegate command '0' for item 'lueftung_switch' to handler for channel 'exec:command:lueftungschalten:input', because no thing with the UID 'exec:command:lueftungschalten' could be found.
==> /var/log/openhab2/events.log <==
2017-07-14 11:21:10.097 [ItemCommandEvent          ] - Item 'lueftung_switch' received command 0
==> /var/log/openhab2/openhab.log <==
2017-07-14 11:21:10.104 [WARN ] [ome.core.thing.internal.ThingManager] - Cannot delegate update '0' for item 'lueftung_switch' to handler for channel 'exec:command:lueftungstatus:output', because no thing with the UID 'exec:command:lueftungstatus' could be found.
2017-07-14 11:21:10.106 [WARN ] [ome.core.thing.internal.ThingManager] - Cannot delegate update '0' for item 'lueftung_switch' to handler for channel 'exec:command:lueftungschalten:input', because no thing with the UID 'exec:command:lueftungschalten' could be found.
2017-07-14 11:21:11.473 [WARN ] [ome.core.thing.internal.ThingManager] - Cannot delegate command '1' for item 'lueftung_switch' to handler for channel 'exec:command:lueftungstatus:output', because no thing with the UID 'exec:command:lueftungstatus' could be found.
2017-07-14 11:21:11.476 [WARN ] [ome.core.thing.internal.ThingManager] - Cannot delegate command '1' for item 'lueftung_switch' to handler for channel 'exec:command:lueftungschalten:input', because no thing with the UID 'exec:command:lueftungschalten' could be found.
==> /var/log/openhab2/events.log <==
2017-07-14 11:21:11.480 [ItemCommandEvent          ] - Item 'lueftung_switch' received command 1
==> /var/log/openhab2/openhab.log <==
2017-07-14 11:21:11.488 [WARN ] [ome.core.thing.internal.ThingManager] - Cannot delegate update '1' for item 'lueftung_switch' to handler for channel 'exec:command:lueftungstatus:output', because no thing with the UID 'exec:command:lueftungstatus' could be found.
2017-07-14 11:21:11.490 [WARN ] [ome.core.thing.internal.ThingManager] - Cannot delegate update '1' for item 'lueftung_switch' to handler for channel 'exec:command:lueftungschalten:input', because no thing with the UID 'exec:command:lueftungschalten' could be found.
==> /var/log/openhab2/events.log <==
2017-07-14 11:21:11.519 [ItemStateChangedEvent     ] - lueftung_switch changed from 0 to 1
==> /var/log/openhab2/openhab.log <==
2017-07-14 11:21:11.537 [INFO ] [lipse.smarthome.model.script.Network] - Switching Lüftung 1: 1
2017-07-14 11:21:11.555 [WARN ] [ome.core.thing.internal.ThingManager] - Cannot delegate update '1' for item 'lueftung_switch' to handler for channel 'exec:command:lueftungstatus:output', because no thing with the UID 'exec:command:lueftungstatus' could be found.
2017-07-14 11:21:11.575 [WARN ] [ome.core.thing.internal.ThingManager] - Cannot delegate update '1' for item 'lueftung_switch' to handler for channel 'exec:command:lueftungschalten:input', because no thing with the UID 'exec:command:lueftungschalten' could be found.
2017-07-14 11:21:11.583 [WARN ] [ome.core.thing.internal.ThingManager] - Cannot delegate command '1' for item 'lueftung_switch' to handler for channel 'exec:command:lueftungstatus:output', because no thing with the UID 'exec:command:lueftungstatus' could be found.
2017-07-14 11:21:11.586 [WARN ] [ome.core.thing.internal.ThingManager] - Cannot delegate command '1' for item 'lueftung_switch' to handler for channel 'exec:command:lueftungschalten:input', because no thing with the UID 'exec:command:lueftungschalten' could be found.
==> /var/log/openhab2/events.log <==
2017-07-14 11:21:11.589 [ItemCommandEvent          ] - Item 'lueftung_switch' received command 1
==> /var/log/openhab2/openhab.log <==
2017-07-14 11:21:11.595 [WARN ] [ome.core.thing.internal.ThingManager] - Cannot delegate update '1' for item 'lueftung_switch' to handler for channel 'exec:command:lueftungstatus:output', because no thing with the UID 'exec:command:lueftungstatus' could be found.
2017-07-14 11:21:11.597 [WARN ] [ome.core.thing.internal.ThingManager] - Cannot delegate update '1' for item 'lueftung_switch' to handler for channel 'exec:command:lueftungschalten:input', because no thing with the UID 'exec:command:lueftungschalten' could be found.
2017-07-14 11:21:13.061 [WARN ] [ome.core.thing.internal.ThingManager] - Cannot delegate command '2' for item 'lueftung_switch' to handler for channel 'exec:command:lueftungstatus:output', because no thing with the UID 'exec:command:lueftungstatus' could be found.
2017-07-14 11:21:13.068 [WARN ] [ome.core.thing.internal.ThingManager] - Cannot delegate command '2' for item 'lueftung_switch' to handler for channel 'exec:command:lueftungschalten:input', because no thing with the UID 'exec:command:lueftungschalten' could be found.
==> /var/log/openhab2/events.log <==
2017-07-14 11:21:13.072 [ItemCommandEvent          ] - Item 'lueftung_switch' received command 2
==> /var/log/openhab2/openhab.log <==
2017-07-14 11:21:13.081 [WARN ] [ome.core.thing.internal.ThingManager] - Cannot delegate update '2' for item 'lueftung_switch' to handler for channel 'exec:command:lueftungstatus:output', because no thing with the UID 'exec:command:lueftungstatus' could be found.
2017-07-14 11:21:13.084 [WARN ] [ome.core.thing.internal.ThingManager] - Cannot delegate update '2' for item 'lueftung_switch' to handler for channel 'exec:command:lueftungschalten:input', because no thing with the UID 'exec:command:lueftungschalten' could be found.
==> /var/log/openhab2/events.log <==
2017-07-14 11:21:13.095 [ItemStateChangedEvent     ] - lueftung_switch changed from 1 to 2
==> /var/log/openhab2/openhab.log <==
2017-07-14 11:21:13.126 [INFO ] [lipse.smarthome.model.script.Network] - Switching Lüftung 2: 2
2017-07-14 11:21:13.136 [WARN ] [ome.core.thing.internal.ThingManager] - Cannot delegate update '2' for item 'lueftung_switch' to handler for channel 'exec:command:lueftungstatus:output', because no thing with the UID 'exec:command:lueftungstatus' could be found.
2017-07-14 11:21:13.139 [WARN ] [ome.core.thing.internal.ThingManager] - Cannot delegate update '2' for item 'lueftung_switch' to handler for channel 'exec:command:lueftungschalten:input', because no thing with the UID 'exec:command:lueftungschalten' could be found.
2017-07-14 11:21:13.152 [WARN ] [ome.core.thing.internal.ThingManager] - Cannot delegate command '2' for item 'lueftung_switch' to handler for channel 'exec:command:lueftungstatus:output', because no thing with the UID 'exec:command:lueftungstatus' could be found.
2017-07-14 11:21:13.157 [WARN ] [ome.core.thing.internal.ThingManager] - Cannot delegate command '2' for item 'lueftung_switch' to handler for channel 'exec:command:lueftungschalten:input', because no thing with the UID 'exec:command:lueftungschalten' could be found.
==> /var/log/openhab2/events.log <==
2017-07-14 11:21:13.162 [ItemCommandEvent          ] - Item 'lueftung_switch' received command 2
==> /var/log/openhab2/openhab.log <==
2017-07-14 11:21:13.169 [WARN ] [ome.core.thing.internal.ThingManager] - Cannot delegate update '2' for item 'lueftung_switch' to handler for channel 'exec:command:lueftungstatus:output', because no thing with the UID 'exec:command:lueftungstatus' could be found.
2017-07-14 11:21:13.172 [WARN ] [ome.core.thing.internal.ThingManager] - Cannot delegate update '2' for item 'lueftung_switch' to handler for channel 'exec:command:lueftungschalten:input', because no thing with the UID 'exec:command:lueftungschalten' could be found.
2017-07-14 11:21:14.854 [WARN ] [ome.core.thing.internal.ThingManager] - Cannot delegate command '0' for item 'lueftung_modus' to handler for channel 'exec:command:lueftungmodus1:output', because no thing with the UID 'exec:command:lueftungmodus1' could be found.
2017-07-14 11:21:14.858 [WARN ] [ome.core.thing.internal.ThingManager] - Cannot delegate command '0' for item 'lueftung_modus' to handler for channel 'exec:command:lueftungmodus_schalten1:input', because no thing with the UID 'exec:command:lueftungmodus_schalten1' could be found.
==> /var/log/openhab2/events.log <==
2017-07-14 11:21:14.863 [ItemCommandEvent          ] - Item 'lueftung_modus' received command 0
==> /var/log/openhab2/openhab.log <==
2017-07-14 11:21:16.378 [WARN ] [ome.core.thing.internal.ThingManager] - Cannot delegate command '1' for item 'lueftung_modus' to handler for channel 'exec:command:lueftungmodus1:output', because no thing with the UID 'exec:command:lueftungmodus1' could be found.
2017-07-14 11:21:16.388 [WARN ] [ome.core.thing.internal.ThingManager] - Cannot delegate command '1' for item 'lueftung_modus' to handler for channel 'exec:command:lueftungmodus_schalten1:input', because no thing with the UID 'exec:command:lueftungmodus_schalten1' could be found.
==> /var/log/openhab2/events.log <==
2017-07-14 11:21:16.396 [ItemCommandEvent          ] - Item 'lueftung_modus' received command 1

I’m afraid I don’t have an answer for you just yet, I have copied and pasted your setup into my test setup and it works fine.

==> /var/log/openhab2/events.log <==
2017-07-14 10:59:54.336 [ItemCommandEvent          ] - Item 'lueftung_switch' received command 0
2017-07-14 10:59:54.343 [ItemStateChangedEvent     ] - lueftung_switch changed from Script-Called to 0
2017-07-14 10:59:55.363 [ItemStateChangedEvent     ] - lueftung_switch changed from 0 to Script-Called
2017-07-14 11:00:00.366 [ItemCommandEvent          ] - Item 'lueftung_switch' received command 1
2017-07-14 11:00:00.372 [ItemStateChangedEvent     ] - lueftung_switch changed from Script-Called to 1
2017-07-14 11:00:05.368 [ItemStateChangedEvent     ] - lueftung_switch changed from 1 to Script-Called
2017-07-14 11:00:05.878 [ItemCommandEvent          ] - Item 'lueftung_switch' received command 2
2017-07-14 11:00:05.882 [ItemStateChangedEvent     ] - lueftung_switch changed from Script-Called to 2
2017-07-14 11:00:15.378 [ItemStateChangedEvent     ] - lueftung_switch changed from 2 to Script-Called

I thank you very much that you have done so much work.
What version of OH2 do you use?
Can it be that i am missing a binding in my OH2?

I tested it on openHAB 2.1 and openHAB 2.2 snapshot.

Have a looked on paperUI “Addons panel”, you should have:

Exec 2.1.0 Binding
RegEx 2.1.0 Transformation

Also, you might be able to see all your Things in the configuration pane. You won’t be able to edit them from PaperUI if they’re defined in the text files though. Do you seem as “online”?

You don’t need Exec 1.10.0

Thx.

I do not see all my things in PaperUI but i can see the items.
I prefer to configure OH2 on the Linux console and not over PaperUI.
Is that a problem?

I Need the exec 1.10.0 Binding too beside i have a old script, that i call over this binding.

Now i have reinstall:

Exec 2.1.0 Binding
RegEx 2.1.0 Transformation

But nothing is happens. The same error as before.

No problem, when I copied your setup I did it all through text files just as you have, and I have had no issues. It is confusing why none of your things are not loading, even when they are clearly detected and refreshed when changing them.

@kgoderis, have you heard of anything like this happening before?

no i have restart she OH2 service (sudo service openhab2 stop && sudo service openhab2 start)

Now I have a lot of error messages in the logfile.
Why uninstalled OH2 a couple of my bindings without asking me?

The logfile now ist round a bout 2000 Lines

The next Thing is, the second script ist running now fine, i can Switch the status from “Automatisch” to “Manuell” and back and it works!!!

BUT the first script to Switch power between “Strom”, “Akku”, and “Aus”, it do not work.
I have a debug function in this script, i can see that is no parameter is given to the script.
The skript need one parameter “0” or “1” or “2”. This parameters are given by the switch on the sitemap, right?

(Switch item=lueftung_switch mappings=[ "0"="Strom", "1"="Akku", "2"="Aus" ])

This switch calls the item “lueftung_switch”, right?

String lueftung_switch "Status" <fan> { channel="exec:command:lueftungschalten:input", channel="exec:command:lueftungstatus:output", autoupdate="false" }

And this item calls the tings, right?

Thing exec:command:lueftungschalten [ command="/bin/bash /home/openhabian/scripts/lueftung_schalten.sh %2$s", interval=0, timeout=20, autorun=false ]
Thing exec:command:lueftungstatus   [ command="/bin/bash /home/openhabian/scripts/lueftung_schalten.sh", interval=10, timeout=30, autorun=true ]

Why the script do not recive any parameter?

The other one script recives parameter with out any problem, now.

Was this understandable?

the log file.
The file is a txt file but i can not upload txt files there.
Rename the file to log.txt an read it if you want.

log.txt.xml (143.0 KB)

EDIT:

after the next restart of the openhab2 Service the old error are back!!!
Nothing in the config are changed!

whats happen with that?