How to determine current state after power loss
Posted: Thursday 18 February 2021 22:08
Domoticz preserves the current states of switches and devices.
But only the last known state.
When you have a power failure and the power comes back on, the devices will be set to their last know state.
But, during this power failure some timers/events will not have been fired. (eg specific time or sun down..)
Does someone have a script, or how can I write my own, so the devices will be in the state they should be at the time the power gets back on.
example: (sun down time = 18:00)
Let's say the powerfailure accurs at 16:48 and the power get's back on at 18:35
In this example the events 011,012,013 and 0,14 will not be fired.
Resulting in :
- the Somfy blinds are open instead of the ventilation position.
- the kitchen lights are off (should be on)
- the dinner table lights are off (this is correct, but they have not been on in the meantime)
EVENT/TIME ACTION
001 : 07:00 Hallway lights on
002: 07:15 Kitchen Lights on
003: 07:15 KaKu switch koffee On
004: 08:00 Somfy Blinds open
005: 08:00 Hallway lights off
006: 10:00 Kitchen lights off
007: 10:15 KaKu switch koffee Off
008: Sun Down -1:15 Door lights on (=Sundown - 1:15 = 16:45)
009: Sun Down -1:15 Garden lights on (=Sundown - 1:15 = 16:45)
010: Sun Down -1:15 table lights on (=Sundown - 1:15 = 16:45)
011: Sun Down -0:30 Somfy Blinds Ventilation position (=Sundown - 0:30 = 17:30)
012: 16:30 Kitchen lights on
013: 17:00 Dinner table lights on
014: 18:30 Dinner table lights off
015: 18:00 KaKu switch TV console On
016: 20:00 Somfy blinds close
017: 23:15 Kitchen lights off
018: 23:20 Door lights off
019: 23:20 Garden lights off
020: 23:25 table lights off
021: 23:30 KaKu switch TV console Off
022: 00:00 ALL OFF
But only the last known state.
When you have a power failure and the power comes back on, the devices will be set to their last know state.
But, during this power failure some timers/events will not have been fired. (eg specific time or sun down..)
Does someone have a script, or how can I write my own, so the devices will be in the state they should be at the time the power gets back on.
example: (sun down time = 18:00)
Let's say the powerfailure accurs at 16:48 and the power get's back on at 18:35
In this example the events 011,012,013 and 0,14 will not be fired.
Resulting in :
- the Somfy blinds are open instead of the ventilation position.
- the kitchen lights are off (should be on)
- the dinner table lights are off (this is correct, but they have not been on in the meantime)
EVENT/TIME ACTION
001 : 07:00 Hallway lights on
002: 07:15 Kitchen Lights on
003: 07:15 KaKu switch koffee On
004: 08:00 Somfy Blinds open
005: 08:00 Hallway lights off
006: 10:00 Kitchen lights off
007: 10:15 KaKu switch koffee Off
008: Sun Down -1:15 Door lights on (=Sundown - 1:15 = 16:45)
009: Sun Down -1:15 Garden lights on (=Sundown - 1:15 = 16:45)
010: Sun Down -1:15 table lights on (=Sundown - 1:15 = 16:45)
011: Sun Down -0:30 Somfy Blinds Ventilation position (=Sundown - 0:30 = 17:30)
012: 16:30 Kitchen lights on
013: 17:00 Dinner table lights on
014: 18:30 Dinner table lights off
015: 18:00 KaKu switch TV console On
016: 20:00 Somfy blinds close
017: 23:15 Kitchen lights off
018: 23:20 Door lights off
019: 23:20 Garden lights off
020: 23:25 table lights off
021: 23:30 KaKu switch TV console Off
022: 00:00 ALL OFF