Using exec binding to trigger x10 w/CM-17a Firecracker and bottlerocket

  • Platform information:
    • Hardware: Raspberry Pi 3 Model B / 1GB RAM / 32 GB SD Card
    • OS: Raspbian 9 (stretch)
    • Java Runtime Environment: openjdk version “1.8.0_152” / OpenJDK Runtime Environment (Zulu Embedded 8.25.0.76-linux-aarch32hf) (build 1.8.0_152-b76) / OpenJDK Client VM (Zulu Embedded 8.25.0.76-linux-aarch32hf) (build 25.152-b76, mixed mode, Evaluation)
  • openHAB 2.5.10-1

I’m trying to set up triggering of x10 modules using a CM-17A firecracker and the bottlerocket command line utility. I have installed the exec binding and I have set up a thing for executing the br command with whatever command arguments get passed to it:

Things:

Thing exec:command:br [ command="/usr/local/bin/br %2$s" ]

I have verified with sudo that the user that openhab runs as is able to trigger x10 devices from the command line using the br command. I have also whitelisted the br command in misc/exec.whitelist with the following line:

/usr/local/bin/br %2$s

I have set up two pushbutton switches and follwed the examples in the exec binding documentation to set up a Switch and String for use with the br exec Thing. The intention is that when the X10_A3_On button is clicked, that should trigger a command “/usr/local/bin/br A3 on”; and when the X10_A3_Off button is clicked, that should trigger a command “/usr/local/bin/br A3 off”.

Items:

Switch x10_A3_On "A3 ON" {autoupdate="false"}
Switch x10_A3_Off "A3 OFF" {autoupdate="false"}

Switch br_Run {channel="exec:command:br:run", autoupdate="false"}
String br_Args "[%s]" {channel="exec:command:br:input"}

Rules:

rule "x10_A3_On"
when
        Item x10_A3_On received command
then
        br_Args.sendCommand("A3 on")
        logInfo("br", "Command arguments set to 'A3 on'"
end

rule "x10_A3_Off"
when
        Item x10_A3_Off received command
then
        br_Args.sendCommand("A3 off")
        logInfo("br", "Command arguments set to 'A3 off'"
end

rule "begin br execution"
when
        Item br_Args received command
then
        if (br_Run.state != ON) {
           br_Run.sendCommand(ON)
        }
end

rule "br_Args received"
when
        Item br_Args received command
then
        br_Run.sendCommand(ON)
end

I have created a test panel in habpanel containing the two pushbuttons. Clicking either button in the panel results in the corresponding event being logged in the event log, but the command doesn’t appear to be getting executed and the corresponding x10 module isn’t getting turned on/off.

2020-12-06 16:24:30.794 [ome.event.ItemCommandEvent] - Item 'x10_A3_On' received command ON
2020-12-06 16:24:31.990 [ome.event.ItemCommandEvent] - Item 'x10_A3_On' received command ON
2020-12-06 16:24:33.278 [ome.event.ItemCommandEvent] - Item 'x10_A3_On' received command ON
2020-12-06 16:24:34.269 [ome.event.ItemCommandEvent] - Item 'x10_A3_Off' received command ON

If this were working properly, I think I would expect to see events being triggered for the br_Run and br_Args items.

DERP. Noob coder mistake. The unclosed logInfo parentheses was causing the rules containing them to be ignored. Didn’t discover the parser/validation messages until restarting OpenHAB and happened to be watching openhab.log