feat: synchronizacja stanów przy restartach kontrolerów
This commit is contained in:
@@ -57,15 +57,6 @@ then
|
|||||||
sSONOFF06.sendCommand(OFF)
|
sSONOFF06.sendCommand(OFF)
|
||||||
end
|
end
|
||||||
|
|
||||||
/* na wypadek rebootów sonoffa */
|
|
||||||
rule "Synchronizuj przedpokój po restarcie"
|
|
||||||
when
|
|
||||||
Item rSONOFF06 received update ON
|
|
||||||
then
|
|
||||||
logInfo("S06przedpokój", "Reappeared, applying state przedpokój {}", sSONOFF06.state)
|
|
||||||
sSONOFF06.sendCommand(sSONOFF06.state.toString)
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
/* jak się urwie od internetu przyciskowi, zsynchronizuj stan światła na OFF */
|
/* jak się urwie od internetu przyciskowi, zsynchronizuj stan światła na OFF */
|
||||||
/*rule "Przedpokój: synchronizuj stan jak włącznik się rozłączy z siecią"
|
/*rule "Przedpokój: synchronizuj stan jak włącznik się rozłączy z siecią"
|
||||||
|
|||||||
@@ -159,18 +159,6 @@ then
|
|||||||
sD1MINI02MOS.sendCommand(OFF)
|
sD1MINI02MOS.sendCommand(OFF)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
/* na wypadek rebootów sonoffa */
|
|
||||||
rule "Synchronizuj balkon & lampka po restarcie"
|
|
||||||
when
|
|
||||||
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)
|
|
||||||
sSHELLY01.sendCommand(sSHELLY01.state.toString)
|
|
||||||
end
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
1 Seconds
|
1 Seconds
|
||||||
2 Minutes
|
2 Minutes
|
||||||
|
|||||||
84
rules/sync.rules
Normal file
84
rules/sync.rules
Normal file
@@ -0,0 +1,84 @@
|
|||||||
|
|
||||||
|
/* na wypadek rebootów sonoffa */
|
||||||
|
|
||||||
|
rule "Synchronizuj wiatrak wc po restarcie"
|
||||||
|
when
|
||||||
|
Item rSONOFF01 received update ON
|
||||||
|
then
|
||||||
|
logInfo("S01wiatrakWC", "Reappeared, applying state wiatrak WC {}", sSONOFF01.state)
|
||||||
|
sSONOFF01.sendCommand(sSONOFF01.state.toString)
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
rule "Synchronizuj lampka stół po restarcie"
|
||||||
|
when
|
||||||
|
Item rSONOFF02 received update ON
|
||||||
|
then
|
||||||
|
logInfo("S02stół", "Reappeared, applying state stół {}", sSONOFF02.state)
|
||||||
|
sSONOFF02.sendCommand(sSONOFF02.state.toString)
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
/* sonoff03 - wiatrak łazienka */
|
||||||
|
|
||||||
|
|
||||||
|
rule "Synchronizuj koci kocyk po restarcie"
|
||||||
|
when
|
||||||
|
Item rSONOFF04 received update ON
|
||||||
|
then
|
||||||
|
logInfo("S04kocyk", "Reappeared, applying state kocyk {}", sSONOFF04.state)
|
||||||
|
sSONOFF04.sendCommand(sSONOFF04.state.toString)
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
/* sonoff05 - lapki sufitowe */
|
||||||
|
|
||||||
|
|
||||||
|
rule "Synchronizuj przedpokój po restarcie"
|
||||||
|
when
|
||||||
|
Item rSONOFF06 received update ON
|
||||||
|
then
|
||||||
|
logInfo("S06przedpokój", "Reappeared, applying state przedpokój {}", sSONOFF06.state)
|
||||||
|
sSONOFF06.sendCommand(sSONOFF06.state.toString)
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
rule "Synchronizuj sypialnia po restarcie"
|
||||||
|
when
|
||||||
|
Item rSONOFF08 received update ON
|
||||||
|
then
|
||||||
|
logInfo("S08sypialnia", "Reappeared, applying state sypialnia {} {}", sSONOFF08a.state, sSONOFF08b.state)
|
||||||
|
sSONOFF08a.sendCommand(sSONOFF08a.state.toString)
|
||||||
|
sSONOFF08b.sendCommand(sSONOFF08b.state.toString)
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
rule "Synchronizuj kanapa po restarcie"
|
||||||
|
when
|
||||||
|
Item rSONOFF09 received update ON
|
||||||
|
then
|
||||||
|
logInfo("S09kanapa", "Reappeared, applying state kanapa {} {}", sSONOFF09a.state, sSONOFF09b.state)
|
||||||
|
sSONOFF09a.sendCommand(sSONOFF09a.state.toString)
|
||||||
|
sSONOFF09b.sendCommand(sSONOFF09b.state.toString)
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
rule "Synchronizuj blat po restarcie"
|
||||||
|
when
|
||||||
|
Item rD1MINI01 received update ON
|
||||||
|
then
|
||||||
|
logInfo("D1blat", "Reappeared, applying state blat {}", sD1MINI01.state)
|
||||||
|
sD!MINI01.sendCommand(sD1MINI01.state.toString)
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
rule "Synchronizuj balkon po restarcie"
|
||||||
|
when
|
||||||
|
Item rSHELLY01 received update ON
|
||||||
|
then
|
||||||
|
logInfo("SH01", "Reappeared, applying state balkon {}", sSHELLY01.state)
|
||||||
|
sSHELLY01.sendCommand(sSHELLY01.state.toString)
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Reference in New Issue
Block a user