Files
openhab/rules/d1mini03.prototyp.rules
root 6076ef8c07 d1mini prototyp: zielonym przyciskiem przelaczaj lampke nad stolem
Do tej pory przelaczalo cottobalsy. Funkcja jest bardzij potrzebna
 do lampki nad stolem, bo tam jest build ESPEasy, ktory czasem sie resetuje
 i lampka gasnie.
.
2018-09-26 18:53:47 +02:00

50 lines
1.2 KiB
Plaintext

rule "d1m03 przełączaj zielone"
when
Item sD1MINI03_button_green received update
then
if (sSONOFF02.state == ON) {
sSONOFF02.sendCommand(OFF)
} else {
sSONOFF02.sendCommand(ON)
}
end
rule "d1m03 przełączaj żółte"
when
Item sD1MINI03_button_yellow received update
then
if (Mpd_quodlibet_StartStop.state == ON) {
Mpd_quodlibet_StartStop.sendCommand(OFF)
} else {
Mpd_quodlibet_StartStop.sendCommand(ON)
}
end
rule "d1m03 przełączaj czerwone"
when
Item sD1MINI03_button_red received update
then
/* if (sD1MINI04_refresh.state == ON) {
sD1MINI04_refresh.sendCommand(OFF)
} else {*/
sD1MINI04_refresh.sendCommand(ON)
/* }*/
end
rule "d1mini03 synchronizuj kolorki"
when
Item sSONOFF02 received update or
Item Mpd_quodlibet_StartStop received update or
Item sD1MINI04_refresh received update
then
sD1MINI03_light_green.sendCommand(sSONOFF02.state.toString())
sD1MINI03_light_yellow.sendCommand(Mpd_quodlibet_StartStop.state.toString())
sD1MINI03_light_red.sendCommand(sD1MINI04_refresh.state.toString())
end