Simple switch problem

Help, please.

Things:
Thing exec:command:devrm [command="/opt/broadlink/send.py /opt/broadlink/code/switch_%2$s.txt", interval=0, timeout=2, autorun=true]

Items:
Switch hall_switch “Hall” [ “Lighting” ] { channel=“exec:command:devrm:input”, autoupdate=“true” }

Sitemap:
Switch item=hall_switch label=“Button” icon=“switch” mappings=[ “ON”=“ON”, “OFF”=“OFF” ]

Rules:
rule "Switch ON"
when
Item hall_switch changed from OFF to ON
then
sendCommand(hall_switch, ON)
end

rule "Switch OFF"
when
Item hall_switch changed from ON to OFF
then
sendCommand(hall_switch, OFF)
end

It doesn’t work. What I am doing wrong? Thanks.

As far as I can tell from the documentation for the Exec binding (here), the input channel is of type String, so you need to change your item definition.

Your sitemap may be OK as it is, since I think (but have not tested) that the mappings will “generate” String values for your String item.

You can get rid of the rules, since they are basically not doing anything.

Thanks, it’s helped.