49 lines
983 B
Plaintext
49 lines
983 B
Plaintext
|
|
rule "Przełączaj duala"
|
|
when
|
|
Item sSONOFF08_ext changed from OFF to ON
|
|
then
|
|
/* przełączaj: pierwsze, drugie, obydwa, żadne */
|
|
|
|
logInfo("Dual", "Got state {}", sSONOFF08_ext.state)
|
|
|
|
if (sSONOFF08a.state == OFF && sSONOFF08b.state == OFF) {
|
|
sSONOFF08a.sendCommand(ON)
|
|
|
|
} else if (sSONOFF08a.state == ON && sSONOFF08b.state == OFF) {
|
|
sSONOFF08b.sendCommand(ON)
|
|
sSONOFF08a.sendCommand(OFF)
|
|
|
|
} else if (sSONOFF08a.state == OFF && sSONOFF08b.state == ON) {
|
|
sSONOFF08a.sendCommand(ON)
|
|
|
|
} else {
|
|
sSONOFF08a.sendCommand(OFF)
|
|
sSONOFF08b.sendCommand(OFF)
|
|
}
|
|
end
|
|
|
|
|
|
rule "Zapal lampki w sypialni o zachodzie"
|
|
when
|
|
Item sSunset_Event received update ON
|
|
then
|
|
sSONOFF08a.sendCommand(ON)
|
|
sSONOFF08b.sendCommand(ON)
|
|
end
|
|
|
|
rule "Zgaś gwiazdki w sypialni wieczorem"
|
|
when
|
|
Time cron "0 00 22 * * ?"
|
|
then
|
|
sSONOFF08b.sendCommand(OFF)
|
|
end
|
|
|
|
rule "Zgaś cottonballs w sypialni wieczorem"
|
|
when
|
|
Time cron "0 18 22 * * ?"
|
|
then
|
|
sSONOFF08a.sendCommand(OFF)
|
|
end
|
|
|