[SOLVED] OpenHAB2 exec Binding

I have installed exec binding this afternoon reboot and it’s the same thing :confused:

You will understand my doubts now. Show us - screenshot please.

What does your exec Thing look like in PaperUI?

Ok this is the screenshot

Okay, that’s good.

What does your exec Thing look like in PaperUI?

Nope, those are Items. Please see my example screensho a few posts up for an exec Thing.
PaperUI > Configuration > Things
gives you a list.
Click for more - it’ll show you channels
Click the pencil icon - see the setting from your xxx.things file

sorry ok

Okay, that’s good. We’ve come a long way in a week.

For completeness, can we also see the channels for that Thing (previous screen)

Next, can we see events.log in response to UI clicking, since you installed the binding.

Ok

==> /var/log/openhab2/events.log <==
2019-09-29 20:31:46.637 [vent.ItemStateChangedEvent] - Remote_Send_Args changed from 00001 3 1 to 00001 3 0
2019-09-29 20:31:47.665 [ome.event.ItemCommandEvent] - Item ‘Power_Plug_Socket_B’ received command ON
2019-09-29 20:31:47.802 [vent.ItemStateChangedEvent] - Power_Plug_Socket_B changed from OFF to ON
2019-09-29 20:31:47.987 [vent.ItemStateChangedEvent] - Remote_Send_Args changed from 00001 3 0 to 00001 3 1
2019-09-29 21:06:04.540 [ome.event.ItemCommandEvent] - Item ‘Power_Plug_Socket_B’ received command OFF
2019-09-29 21:06:04.713 [vent.ItemStateChangedEvent] - Power_Plug_Socket_B changed from ON to OFF
2019-09-29 21:06:04.985 [vent.ItemStateChangedEvent] - Remote_Send_Args changed from 00001 3 1 to 00001 3 0
2019-09-29 21:06:05.322 [ome.event.ItemCommandEvent] - Item ‘Power_Plug_Socket_B’ received command ON
2019-09-29 21:06:05.482 [vent.ItemStateChangedEvent] - Power_Plug_Socket_B changed from OFF to ON
2019-09-29 21:06:05.825 [vent.ItemStateChangedEvent] - Remote_Send_Args changed from 00001 3 0 to 00001 3 1

==> /var/log/openhab2/openhab.log <==
2019-09-29 13:34:59.337 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model ‘powerplugs.sitemap’
2019-09-29 13:35:05.010 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model ‘exec.things’
2019-09-29 13:35:19.605 [INFO ] [.dashboard.internal.DashboardService] - Started Dashboard at http://192.168.0.160:8080
2019-09-29 13:35:19.673 [INFO ] [.dashboard.internal.DashboardService] - Started Dashboard at https://192.168.0.160:8443
2019-09-29 13:35:26.439 [INFO ] [arthome.ui.paper.internal.PaperUIApp] - Started Paper UI at /paperui
2019-09-29 13:37:45.354 [INFO ] [el.core.internal.ModelRepositoryImpl] - Refreshing model ‘powerplugs.rules’
2019-09-29 19:42:21.063 [INFO ] [el.core.internal.ModelRepositoryImpl] - Refreshing model ‘exec.things’
2019-09-29 19:52:47.485 [INFO ] [el.core.internal.ModelRepositoryImpl] - Refreshing model ‘exec.things’
2019-09-29 19:54:08.700 [INFO ] [el.core.internal.ModelRepositoryImpl] - Refreshing model ‘powerplugs.rules’
2019-09-29 20:03:52.671 [INFO ] [el.core.internal.ModelRepositoryImpl] - Refreshing model ‘powerplugs.rules’

Your exec script is still not attempting to run; we can tell this because you don’t see a message in events.log about your run Item Remote_Send changing to ON.

So we now have a binding, a good looking Thing with channels. we have Items that get commands. Nothing we have seen so far confirms any actual link between your Items and channels.

Please show us the current version of your powerplug.items file

Then try this; edit your Items file, maybe add a space and take it out again, then save it.
Please show us openhab.log and events.log for that.

Ok the item i have added a blank space

/etc/openhab2/items/powerplugs.items

Switch Power_Plug_Socket_B
Switch Remote_Send { channel="exec:command:remote_send:run" }
String Remote_Send_Args { channel="exec:command:remote_send:input" }
String Remote_Send_Out { channel="exec:command:remote_send:output" }


==> /var/log/openhab2/openhab.log <==
2019-09-29 13:35:05.010 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'exec.things'
2019-09-29 13:35:19.605 [INFO ] [.dashboard.internal.DashboardService] - Started Dashboard at http://192.168.0.160:8080
2019-09-29 13:35:19.673 [INFO ] [.dashboard.internal.DashboardService] - Started Dashboard at https://192.168.0.160:8443
2019-09-29 13:35:26.439 [INFO ] [arthome.ui.paper.internal.PaperUIApp] - Started Paper UI at /paperui
2019-09-29 13:37:45.354 [INFO ] [el.core.internal.ModelRepositoryImpl] - Refreshing model 'powerplugs.rules'
2019-09-29 19:42:21.063 [INFO ] [el.core.internal.ModelRepositoryImpl] - Refreshing model 'exec.things'
2019-09-29 19:52:47.485 [INFO ] [el.core.internal.ModelRepositoryImpl] - Refreshing model 'exec.things'
2019-09-29 19:54:08.700 [INFO ] [el.core.internal.ModelRepositoryImpl] - Refreshing model 'powerplugs.rules'
2019-09-29 20:03:52.671 [INFO ] [el.core.internal.ModelRepositoryImpl] - Refreshing model 'powerplugs.rules'
2019-09-29 21:58:41.551 [INFO ] [el.core.internal.ModelRepositoryImpl] - Refreshing model 'powerplugs.items'

==> /var/log/openhab2/events.log <==
2019-09-29 21:59:43.741 [ome.event.ItemCommandEvent] - Item 'Power_Plug_Socket_B' received command OFF
2019-09-29 21:59:43.950 [vent.ItemStateChangedEvent] - Power_Plug_Socket_B changed from ON to OFF
2019-09-29 21:59:44.270 [vent.ItemStateChangedEvent] - Remote_Send_Args changed from 00001 3 1 to 00001 3 0
2019-09-29 21:59:45.225 [ome.event.ItemCommandEvent] - Item 'Power_Plug_Socket_B' received command ON
2019-09-29 21:59:45.372 [vent.ItemStateChangedEvent] - Power_Plug_Socket_B changed from OFF to ON
2019-09-29 21:59:45.640 [vent.ItemStateChangedEvent] - Remote_Send_Args changed from 00001 3 0 to 00001 3 1
2019-09-29 21:59:47.197 [ome.event.ItemCommandEvent] - Item 'Power_Plug_Socket_B' received command OFF
2019-09-29 21:59:47.350 [vent.ItemStateChangedEvent] - Power_Plug_Socket_B changed from ON to OFF
2019-09-29 21:59:47.625 [vent.ItemStateChangedEvent] - Remote_Send_Args changed from 00001 3 1 to 00001 3 0
2019-09-29 21:59:48.164 [ome.event.ItemCommandEvent] - Item 'Power_Plug_Socket_B' received command ON
2019-09-29 21:59:48.302 [vent.ItemStateChangedEvent] - Power_Plug_Socket_B changed from OFF to ON
2019-09-29 21:59:48.491 [vent.ItemStateChangedEvent] - Remote_Send_Args changed from 00001 3 0 to 00001 3 1

Okay, the items file loads without error. But we still have no evidence of links to channels.

In your karaf console, please try
smarthome:links list
and show results

Hi
It works know i have reboot the raspberry pi
Many thanks rossko57 for the time you spent to explain me :slight_smile:

Hi,

Can anyone tell me how can I print line break with exec binding? I run a script and echo a few lines in a for loop. I present the output for example on habpanel. I tried to print \n and
at the end of the lines, but these are not working.

Exec binding doesn’t print anything.
Is your question “how do I embed a line break in a string for habpanel to display?”

how do I embed a line break in a string for habpanel to display?

I don’t know. You might want to start an HABpanel thread. What widget are you using, does it support multiline text?