-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rule to set relay ON between sunset and sunrise after power loss on Time#Initialized. #2669
Comments
If you set PowerOnState to default Sonoff will restore the last state after power loss automatically, no necessary to add something |
PowerOnState won't work as expected.
Or viseversa
The problem that we have several power loss/restore combinations and PowerOnState can't cover all of them. Daytime/Daytime |
What you need is a retrigger on startup for all last non-trigger. Well, as enhancements like that are more or less special expections and would be better handled by a third system. I don't think that all these exceptional user requirements can be handled by such small device in future (for your case the system needs to "remember" which trigger are already triggered), my suggestion for your need is a workaround: use a home system like Fhem which can handle retrigger of non-triggered events. |
Hi, Now, in rules there are the commands What about adding new values that report :
So, with those, we could make a rule like: For example: If we want a light to be on from 20:00 to 8:00 and to be off from 8:00 to 20:00 Rule:
What do you think? |
@arendst what do you think? |
@ascillato Don't you think these time related values are already served by the the timer options already available? This seems to duplicate the timer functionality. |
Hi The timers will be excecuted as a trigger, while So, for the issue explained by dmitrybabeshko, if the sonoff is not powered while the timer should trigger, then, when it is powered up, it will not trigger the output or rule that was intended. With a rule with I think that adding this conditions to the actual timers will make them more complex with more options and with more memory/flash use. That's why, I think that having some extra internal time variables exposed to rules will be more flexible and less code hungry. Another use, besides turning lights at night and do not miss it if the energy was down during the trigger time, can be change the behavior of the sonoff in different hours, also without missing the trigger time. |
6.0.0a * Add time in minutes to rule Time#Initialized, Time#set and Time#Minute (arendst#2669) * Add rule variables %time% for minutes since midnight, %uptime%, %sunrise% and %sunset% giving time in minutes (arendst#2669)
Hello,
I use Sonoff basic as automatic standalone day/night switch for street lightning using approach with Sunset/Sunrise for timers.
The problem that after power loss I need to set correct relay state. For example if power loss happened at night I need to understand whether it restored at night or at day to switch relay ON or OFF.
Is it possible to create Rule which will trigger between sunset and sunrise to switch relay On?
Thank you in advance!
The text was updated successfully, but these errors were encountered: