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