salon: bardziej dramatyczne gaszenie wieczorem

I kilka fiksów z międzyczasu.
This commit is contained in:
2021-05-18 12:49:02 +02:00
parent f9f1d4bc45
commit ab0dd077f0

View File

@@ -8,6 +8,7 @@ then
/* balkon */ /* balkon */
sSHELLY01.sendCommand(ON) sSHELLY01.sendCommand(ON)
end end
@@ -23,11 +24,11 @@ then
end end
/* TODO: w okresie kwiecien-pazdziernik na dwie godziny przed? */
rule "Zapal sufitowe przed zachodem" rule "Zapal sufitowe przed zachodem"
when when
/* Item sSunset_Event_in_hour received update ON */ Item sSunset_Event_in_hour received update ON
Item sSunset_Event_in_twohours received update ON /* Item sSunset_Event_in_twohours received update ON */
then then
/* HOLIDAY */ /* HOLIDAY */
@@ -44,14 +45,15 @@ rule "Zapal lampkę i kanapowe przez zmierzchem gdy pochmurno"
when when
Item sSunset_Event_in_twohours received update ON Item sSunset_Event_in_twohours received update ON
then then
/* more than 90% cloud cover */ /* more than 90% cloud cover && TODO: only april-octotber */
if (wClouds.state > 90.0) { if (wClouds.state > 90.0 && true) {
logInfo("stollampka", "Powyżej 90% chmur, zapalam") logInfo("stollampka", "Powyżej 90% chmur, zapalam")
/* sSONOFF02.sendCommand(ON) */ /* sSONOFF02.sendCommand(ON) */
sSONOFF02_expected.postUpdate(ON) sSONOFF02_expected.postUpdate(ON)
sSONOFF09a.sendCommand(ON) sSONOFF09a.sendCommand(ON)
sSONOFF09b.sendCommand(ON)
} }
end end
@@ -66,6 +68,9 @@ when
/* Item sSunset_Event_in_halfhour received update ON*/ /* Item sSunset_Event_in_halfhour received update ON*/
Item sSunset_Event_in_hour received update ON Item sSunset_Event_in_hour received update ON
then then
if (sHolidayVacancy.state == ON) {
return;
}
dSONOFF01LED.sendCommand(0) dSONOFF01LED.sendCommand(0)
dSONOFF02LED.sendCommand(0) dSONOFF02LED.sendCommand(0)
@@ -91,7 +96,7 @@ then
/* sSONOFF02.sendCommand(ON) */ /* sSONOFF02.sendCommand(ON) */
sSONOFF02_expected.postUpdate(ON) sSONOFF02_expected.postUpdate(ON)
/* kanapa */
sSONOFF09a.sendCommand(ON) sSONOFF09a.sendCommand(ON)
end end
@@ -119,22 +124,24 @@ then
if (sHolidayVacancy.state == ON) { if (sHolidayVacancy.state == ON) {
sSONOFF05.sendCommand(OFF) sSONOFF05.sendCommand(OFF)
} }
Thread::sleep(2000)
sD1MINI02MOS.sendCommand(OFF)
/* kanapowe */ /* kanapowe */
sSONOFF01.sendCommand(OFF) sSONOFF09b.sendCommand(OFF)
Thread::sleep(2000)
sSONOFF09a.sendCommand(OFF)
Thread::sleep(2000)
/* balkon */ /* blat */
sSHELLY01.sendCommand(OFF) sD1MINI02MOS.sendCommand(OFF)
end end
/* na wypadek rebootów sonoffa */ /* na wypadek rebootów sonoffa */
rule "Synchronizuj balkon & lampka po restarcie" rule "Synchronizuj balkon & lampka po restarcie"
when when
Item rSHELLY01 changed to ON or Item rSHELLY01 received update ON or
Item rSONOFF02 changed to ON Item rSONOFF02 received update ON
then then
logInfo("S02,SH01", "Reappeared, applying state balkon {}, lampka {}", sSHELLY01.state, sSONOFF02.state) logInfo("S02,SH01", "Reappeared, applying state balkon {}, lampka {}", sSHELLY01.state, sSONOFF02.state)
sSONOFF02.sendCommand(sSONOFF02.state.toString) sSONOFF02.sendCommand(sSONOFF02.state.toString)