sypialnia: regułki dla sonoff dual
Przełaczanie stanów obydwu kanałów jednym przyciskiem (cykl) I wieczorne świecenie lampkami do 22.
This commit is contained in:
39
rules/sypialnia.dual.rules
Normal file
39
rules/sypialnia.dual.rules
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
|
||||||
|
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 wieczorem"
|
||||||
|
when
|
||||||
|
Time cron "0 30 21 * * ?"
|
||||||
|
then
|
||||||
|
sSONOFF08a.sendCommand(ON)
|
||||||
|
end
|
||||||
|
|
||||||
|
rule "Zgaś lampki w sypialni wieczorem"
|
||||||
|
when
|
||||||
|
Time cron "0 00 22 * * ?"
|
||||||
|
then
|
||||||
|
sSONOFF08a.sendCommand(OFF)
|
||||||
|
end
|
||||||
Reference in New Issue
Block a user