ich versuche gerade meine 433 MHz Steckdosen über Openhab in Betrieb zu nehmen. Was habe ich bisher gemacht:
Ich habe WiringPi und Raspberry-remote installiert. Dann habe ich für den User Openhabian für den Pfad , wo raspberry-remote installiert ist die Passwortabfrage zu deaktivieren. Komischerweise krieg ich bei erstmaliger Ausführung nach Neustart diese Abfrage immer noch. Ich habe irgendwie den Eindruck, dass es mit den Berechtigungen zu tun hat. Vielleicht kann mir jemand helfen. Vielen Dank!
Über sudo visudo folgender Eintrag:
Code: Alles auswählen
openhabian ALL=NOPASSWD: /opt/raspberry-remote/
Code: Alles auswählen
sudo ./send 11111 2 1
Meine Konfiguration in Openhab sieht folgendermaßen aus:
powerplugs.item
Code: Alles auswählen
Switch Power_Plug_Socket_B <poweroutlet>
Switch Remote_Send { channel="exec:command:remote-send:run" }
String Remote_Send_Args { channel="exec:command:remote-send:input"}
String Remote_Send_Out { channel="exec:command:remote-send:output" }
Code: Alles auswählen
rule "Poweroutlet B"
when
Item Power_Plug_Socket_B received command
then
if(receivedCommand == ON){
Remote_Send_Args.sendCommand("11111 1 1")
}else{
Remote_Send_Args.sendCommand("11111 1 0")
}
// wait for the command to complete
while(Remote_Send.state != OFF){
Thread::sleep(500)
}
logInfo("Power_Plug", "Resuts are: \n" + Remote_Send_Out.state )
end
exec.things:
Code: Alles auswählen
Thing exec:command:remote-send [
command="/opt/raspberry-remote/send %2$s",
interval=0,
autorun=true]
Code: Alles auswählen
Switch item=Power_Plug_Socket_B label="Schirmlampe"
Code: Alles auswählen
16:25:42.002 [INFO ] [smarthome.event.ItemStateChangedEvent] - Power_Plug_Socket_B changed from OFF to ON
16:25:42.719 [INFO ] [smarthome.event.ItemCommandEvent ] - Item 'Power_Plug_Socket_B' received command OFF
16:25:42.739 [INFO ] [smarthome.event.ItemStateChangedEvent] - Power_Plug_Socket_B changed from ON to OFF
16:25:43.352 [INFO ] [smarthome.event.ItemCommandEvent ] - Item 'Power_Plug_Socket_B' received command ON
16:25:43.372 [INFO ] [smarthome.event.ItemStateChangedEvent] - Power_Plug_Socket_B changed from OFF to ON
16:25:43.903 [INFO ] [smarthome.event.ItemCommandEvent ] - Item 'Power_Plug_Socket_B' received command OFF
16:25:43.923 [INFO ] [smarthome.event.ItemStateChangedEvent] - Power_Plug_Socket_B changed from ON to OFF