Time range to limit triggers

I have two timers triggering (classic injection nodes).

  1. at 8:00
  2. at sunrise
    the idea is to trigger our shades depending on what is latest. So I put time range behind each trigger [node-red-contrib-time-range-switch].


  1. I put the range of sunrise until 8:01 --> kills trigger at 8 if sun isn't up yet
    and behind
  2. I put 8:00 until 9:30. --> kills triggers sunrise, if it isn't 8:00 yet

The idea was to catch those triggers that are yet to early. This gave me the nasty surprise of extending the time events into the next day. So if for 1) sunrise is after 8:01 it automatically (and not intended by me) extends the range to 8:01 the next day. The result is that the range is considered valid and the shades go up at 8:00.

Is this a bug in the time range node? From my understanding if the time range would be neg. every event happening should be out of range.

banging my head on this for quite some time, hope somebody can help.

It is actually quite a tricky question. Basically you want to know when it is after 08:00 AND after sunrise. One way would be to use node-red-contrib-boolean-logic-ultimate and feed it the time and sunstate values. Even that has problems when you restart node red. Getting the initial values in may not be easy. If you can tolerate indeterminate behaviour the first time through if you restart before 08:00 or before sunrise then it should be easy though.

yes, that is the idea and I am a little hesitant to accept unclear states. That’s why I didn’t follow up on another idea I had.
The idea was to count the events to 2. Once those events add up to 2 I know both events have taken place and both must be true. It is 8:00 and after sun rise, or it is after 8:00 and the sun just rose.
I would not face that uncertain events if I get response immediately if one is triggered (8:00 or sunrise) and lies within the individual allowed time span.
Is there maybe another node that allows sun events and time, eventhough the gap might be negative and any event in that “negative” gap would be outside the time window?

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.