Jetzt möchte ich aber drei unterschiedlich Schalten. Das ganze Hängt an einem Pi.
Ich schalte via Python (Script).
Manuel via Shell kann ich alle drei Kanäle einzel Ein und Ausschalten - immerhin:-)
Code: Alles auswählen
python /etc/openhab2/scripts/relais.py 24 OFF
Code: Alles auswählen
python /etc/openhab2/scripts/relais.py 24 OF
Im Basic UI geht es nicht mehr wie gewünscht - Der Erste Switch schaltet 23 und 25 Ein/Aus, der zwei nichts und der Dritte nur 25 - hört sich Merkwürdig an, ist aber so:-/
Das Script lasse ich mal weg, da es eigentlich funktioniert.
Das Thing sieht so aus:
Code: Alles auswählen
Thing exec:command:relais1-control [ command="/etc/openhab2/scripts/relais.py 23 %2$s", interval=0, autorun=true ]
Thing exec:command:relais2-control [ command="/etc/openhab2/scripts/relais.py 24 %2$s", interval=0, autorun=true ]
Thing exec:command:relais3-control [ command="/etc/openhab2/scripts/relais.py 25 %2$s", interval=0, autorun=true ]
Code: Alles auswählen
String relais1Switch "Relais 1" <poweroutlet> (grp_relais) [ "Switchable" ] { channel="exec:command:relais1-control:input", autoupdate="true" }
String relais2Switch "Relais 2" <poweroutlet> (grp_relais) [ "Switchable" ] { channel="exec:command:relais2-control:input", autoupdate="true" }
String relais3Switch "Relais 3" <poweroutlet> (grp_relais) [ "Switchable" ] { channel="exec:command:relais3-control:input", autoupdate="true" }
Code: Alles auswählen
Frame label="Dachgeschoss" icon="attic" {
Group item=AT_Estrich {
Switch item=relais1Switch icon="light" label="Weihnachtsbeleuchtung" //mappings=[ "ON"="Ein", "OFF"="Aus" ]
Switch item=relais2Switch icon="light" label="Bewegungsmelder Licht Sitzplatz" //mappings=[ "ON"="Ein", "OFF"="Aus" ]
Switch item=relais3Switch icon="switch" label="Reserve 1" //mappings=[ "ON"="Ein", "OFF"="Aus" ]
}
}