Getting a button to execute script

My first attempt at OpenHab2 and I want something which should be simple, I think. But I can’t get it to work.
I have a bluetooth switch that I want to turn on/off. I have it setup in my sitemap. Two items in my items file and two Things. When I execute the Things, the light turns on/off, but when I click the on/off buttons in the sitemap, nothing happens. What am I doing wrong?

Here is the sitemap:
sitemap Thurmans label=“The Thurmans” {
Frame label=“Date” {
Text item=Date
Frame label=“Patio” {
Switch item=Patio_Light icon=“dimmablelight” mappings=[TurnOffPatioLight=“Off”, TurnOnPatioLight=“On”]

Here is my items file:
Switch TurnOnPatioLight {channel=“exec:command:582ae769:run”}
Switch TurnOffPatioLight {channel=“exec:command:d8df8398:run”}

Here is my things file:

Thing TurnOffPatioLight {command="exec:command:d8df8398"}
Thing TurnOnPatioLight {command="exec:command:582ae769"}

The Thing doesn’t look right.

If you were to run this script from the command line, do you really type “exec:command:d8df8398”?

A proper Exec 2.x Thing would look like:

Thing exec:command:apc [command="/usr/local/bin/apcaccess  status", interval=15, timeout=5, autorun=false]

No, that wouldn’t work from the commandline, but it does work in PaperUI and on iOS. Doesn’t the command ‘exec:command:582ae769:run’ just map to the corresponding binding? I have a binding (two actually, on and off), which actually execute either the on or off script. If it makes more sense to just put the scripts in the Things, I’m fine with that. I’ll try it this evening, but I’d still like to figure out why I can’t have the buttons in the sitemap work. Might this be the issue?

“exec:command:582ae769:run” is a Thing’s Channel ID.

Your Things file makes no sense. If should be something like:

Thing exec:command:582ae769 [command="path to script and arguments"]

And then your Items reference the channel id

Switch TurnOnPatioLight {channel="exec:command:582ae769:run"}

It’s not that it makes more sense. That is how it works. It will not work any other way.

Almost certainly.

Ok, I made the change and now my Things use the paths to the scripts. It guess it was actually the items that were actually calling the scripts. But my original question remains: How do I get the buttons in my sitemap to work?

I would start by reviewing the [the sitemap docs for switch ( and mappings and perhaps review the beginner’s tutorial because the syntax you were trying to use for Things and the sitemap don’t make much sense.

The Mappings on the sitemap controls what the Patio_Light Item gets set to. You appear to be trying to use Mappings to trigger other items.

You need to look into using a proxy item and a rule to send a command to the correct on or off item or the like.