Does anybody have a suggestion on how to start a flow based on a time stored in a Variable, without the use of “SunEvents” app or any other apps besides the built in functions? I also do not want to have a flow running “every 5 minutes” or so, to check if variabel match the system time.
My case is, my outside lighting is going on/off based on median-lux or using the built in “Sunset/Sunrise function”, but i wish to turn off the lights some hours in the middle of the night. My thought was to add a time to the Sunset time, and the Sunrise time that Homey stores, if the times overlap each other, then i will not turn of the lights.
I am using “SunEvents” for only two trigger-cards today, and that is the “Moon set” and “Nautical Dawn”, but i wish to reduce the Memory consumption and uninstall the app, but the built in “Time” card, does not support a variabel.
I might got a App that can suite my needs, but not aware of it:
Without any of them, it might be difficult. There are potential solutions depending on when will the variable be set and how often it might be changed.
So you need at least the App Countdown, which is not built in but already installed in your system, or something similar.
Unfortunately Countdown knows only seconds, and I do not know what is the maximum there.
The idea is that you run When…Every 1 days Then…Start countdown timer VariableTimeMySeconds
And another line in your advanced flow or an extra flow: When…Timer reaches zero(0) VariableTime Then… Switch your light on/off, etc VariableTime is just my choice for the name of the Timer, and MySeconds is the variable keeping the chosen time in seconds.
If Countdown is limited in the seconds used, you might need something like Chronograph or start with every 1 hour and check the the hour before starting the seconds.
And if you want the time calculated or set during the day, you might need BetterLogicLibraray or something which is capable of calculating with time strings.
I am capable of getting the correct time i want, and compare the two different (sunrise with offset and sunset with offset) times to determine if the “night off” function should operate or not. But the Time-trigger is my big case, the CountDown suggestion is not a bad idea.
When = “Time is string-variable” , is the option i am missing, and woundered if it was a workaround out there somewhere.
From this technical detailed (and perhaps not yet correct) flowchart, it is too difficult for me to understand your goal. So I give the floor to @Rrrr an @DirkH
I had the idea that in summer nights you want to have lights on during the short night. But in wintertime only at the beginning of the evening and early in the morning. And switch them of in the middle of the night.
I am not really sure, what you want as I do not understand nautical dawn and why it is related to the moon, as the moon can rise or set at any time during day or night.
But do not combine events, if you have to decide afterwards, which event was started. Just keep the two events separated and duplicate the card that it has to be between Saturday and Monday. Then you can avoid asking again, if it is moon set or nautical dawn.
No worries, but you did not use sensor readings in your flow anywhere.
I assumed your lux sensors were not sensitive enough to measure twilight.
But in that case (a little beyond the scope of your question) you can create amazing flows that can also be tweaked for when it’s dark in daytime and motion/presence.
I’ll assume you have some of that covered.
Solution B
Twilight approximation
Generic
WHEN lux becomes smaller than 50
Then turn lights on
WHEN lux becomes greater than 55
Then turn lights off
Part 1 Night twilight
WHEN lux changed
AND lux < 5
AND it’s after 22:00
AND lights are on
THEN turn off
WHEN it’s 23:00
AND lights are on
THEN turn off
Part 2 Morning twilight
WHEN lux changed
AND lux > 0 AND < 55
AND it’s after 04:00
AND lights are off
THEN turn on
According to your region you will have to tweak.
Note:
“WHEN lux becomes greater/smaller than”
will fire less often.
The below uses more CPU but you may need to work with it in a limited time period:
WHEN lux changed
AND lux < xx
AND time between x and y
It is actually not combined. The “logic card’s” separates the functions.
That is because i have only shared my issue, and that is not to turn on or off the lights based on LUX/Luminance, Sunrise/Sunset and so on. The flow works good, as it is, it is used to turn off and on the lights in the middle of the night. But i want to replace the “SunEvent” cards with a App i already have or the Native/built in functions Homey offers, to free up memory on the HP.
To clarify with SunEvents Cards:
WHEN - Sunset = Light ON
WHEN - Dawn = Light OFF
WHEN - Moon Set = Light ON
WHEN - Sunrise = Light OFF
The Times for Dawn and MoonSet, do i wish to replace with a calculated offset on the “Sunset” and “Sunset” that Homey stores. I do still want to use time as a trigger, but the Native/Built in functions does not support a “Variable/Tag” and i am in search for a “workaround”, so i can delete the “SunEvents” app. If Homey supported “Variable/Tag” in the “Time is xxxx” card, the issue would be solved. But because it is a community, and not the Homey development, i am in search of a workaround
A variable time to advance and a fixed time to delay.
Or you run a flow every 5 minutes AND calculate if the time is a variable X minutes before or after sunset/sunrise.
PS: it is very confusing to use moon events to switch on or off a lamp, because a moon event is not a sun event. But eventually you will find out yourself.