diff --git a/rules/salon.cottonballs.rules b/rules/salon.cottonballs.rules index 737af7c..8dcf1b3 100644 --- a/rules/salon.cottonballs.rules +++ b/rules/salon.cottonballs.rules @@ -24,11 +24,13 @@ rule "Zapal cottonballsy i blat przed zmierzchem" when Item sSunset_Event_in_hour received update ON then + if (sHolidayVacancy.state == ON) { + return; + } + sOWFS01.sendCommand(ON) sOWFS01_expected.postUpdate(ON) -/* HOLIDAY */ - sD1MINI02MOS.sendCommand(ON) end diff --git a/rules/salon.lampka-stolowa.rules b/rules/salon.lampka-stolowa.rules index 092ca2b..0e7ae7b 100644 --- a/rules/salon.lampka-stolowa.rules +++ b/rules/salon.lampka-stolowa.rules @@ -34,7 +34,9 @@ when Item sSunset_Event_in_hour received update ON /* Item sSunset_Event_in_twohours received update ON */ then -/* HOLIDAY */ + if (sHolidayVacancy.state == ON) { + return; + } /* drobna przerwa bo cottonballs tez sie zapalaja teraz */ Thread::sleep(1000) @@ -46,7 +48,6 @@ then end -/* HOLIDAY */ rule "Zapal lampkę i kanapowe przez zmierzchem gdy pochmurno" when @@ -54,6 +55,10 @@ when then var Number hours = now.getHourOfDay + if (sHolidayVacancy.state == ON) { + return; + } + /* more than 90% cloud cover && not before 14:00 hour && TODO: only april-october */ if (wClouds.state > 90.0 && hours >= 14 && true) { logInfo("stollampka", "Powyżej 90% chmur, zapalam") @@ -70,7 +75,6 @@ end /* TODO: przerobic na espeasy pulse command. pulse 500ms, thread sleep 1s*/ -/* HOLIDAY */ rule "Zapal lampkę i kanapowe przed zmierzchem" when