Hi,
I’m trying to link a switch to a exec-binding-command (string input only):
.things:
Thing exec:command:switch1 [command=“sudo /opt/433Utils/send 11111 1
[[ %2$s = 'ON' ]] && echo '1' || echo '0'
”, interval=1, autorun=true]
Thing exec:command:switch2 [command=“sudo /opt/433Utils/send 11111 1 %2$s”, interval=1, autorun=true]
.items:
Switch Switch1OnOff “Switch1OnOff” { channel=“exec:command:switch1:input” }
String Switch2OnOff “Switch2OnOff” { channel=“exec:command:switch2:input” }
Switch1OnOff
is created successfully but nothing happens if it is activated (also no errors in the logfile).
I changed Switch2OnOff
to String
, now everything is working if I set it to “0” or “1”.
But how to I get this running with a Switch
?
For testing purpose I already simplified the command of exec:command:switch1 to just touch /tmp/%2$s
, but it looks like the command is never executed.
I also searched the forum and saw a lot of posts suggesting a .sitemap
file, but as far as i know they are not supported by PaperUI.
My last idea would be to create a String
item and a Switch
item for each hardware switch and connect both with a rule. But that would be a bit ugly, as I have to create a lot of dummy items.
Can you suggest me any way to link a Switch
to a String
input?