You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 17, 2021. It is now read-only.
anyone has an example of rule, which I can use to restore my light state when the system restarted? I use gpio and mysensors devices for light relay. all gpio always turn on after system restart and all mysensors relay always turn off after system restart.
The text was updated successfully, but these errors were encountered:
// persistence strategies have a name and a definition and are referred to in the "Items" section
Strategies {
everyHour : "0 0 * * * ?"
everyDay : "0 0 0 * * ?"
// if no strategy is specified for an item entry below, the default list will be used
default = everyChange
}
/*
* Each line in this section defines for which item(s) which strategy(ies) should be applied.
* You can list single items, use "*" for all items or "groupitem*" for all members of a group
* item (excl. the group item itself).
*/
Items {
// persist all items once a day and on every change and restore them from the db at startup
// careful, this might result in huge databases - that's why it is in comment here ;-)
// * : strategy = everyChange, everyDay, restoreOnStartup
// persist all temperature and weather values at every change and every hour
Temperature*, Weather_Chart*,Weather_Room_Chart*,Lux_Sensors_Chart* : strategy = everyChange, everyHour
IN_Living*,IN_Bathroom*,IN_Bed* : strategy = everyUpdate, everyChange, everyDay, restoreOnStartup
}
that is my db40.persist
and this is my rule
rule "Initialize light states"
when
System started
then
Lights?.members.forEach(light|
postUpdate(light, light.state)
)
end
I was able to hack together a fix for this problem:
rule "Initialize states"
when
System started
then
Lights?.members.forEach(member|
postUpdate(member, member.historicState(now.minusSeconds(30)).state)
)
end
Why isn't something similar to this the default starting behavior? Without this rule all my light states are updated to OFF during startup.
anyone has an example of rule, which I can use to restore my light state when the system restarted? I use gpio and mysensors devices for light relay. all gpio always turn on after system restart and all mysensors relay always turn off after system restart.
The text was updated successfully, but these errors were encountered: