Hi community,
I’d like to control my receiver with my raspberry pi, what already works fine. I use the lirc tool like described in this tutorial: https://tutorials-raspberrypi.de/raspberry-pi-fernbedienung-infrarot-steuerung-lirc/ (there are lots of similar v=tutorials in the internet).
Up to now, I can control different buttons, e.g. with this command in the shell I turn off the receiver:
irsend SEND_ONCE harman-kardon KEY_POWER2
Now, I’d like to toggle the device with openhab 2. Unfortunately, I don’t know how. I tried something like this:
.items
Switch IR_Remote_Send { channel="exec:command:remote-irsend:run" }
String IR_Remote_Send_Args { channel="exec:command:remote-send:input"}
String IR_Remote_Send_Out { channel="exec:command:remote-send:output" }
.things
Thing exec:command:ir-send [
command="irsend SEND_ONCE %2$s",
interval=0,
autorun=true]
.rules
rule "Poweroutlet B1"
when
Item Reciever received command
then
if(receivedCommand == ON){
IR_Remote_Send_Args.sendCommand("harman-kardon KEY_POWER")
}else{
IR_Remote_Send_Args.sendCommand("harman-kardon KEY_POWER2")
}
end
I oriented to the scrips of my wireless power sockets (433MHz).
The problem has to do with the Exec Binding, but I don’t know exactly where it is.
I am looking forward to find a solution with you !
Dominik