You will notice that I’m not an expert with this simple script. What I’m looking for is to be notified if the garage door is open for 30 minutes when it is dark outside (i.e. between sunset and sunrise). It executes if the garage door is opened after sunset, but not if the garage door is opened before sunset (even if it is open all night). It seems to be lacking a trigger in this situation, but I’m not sure how to make that work.
You need to condition the notification, not the sensor staying open. You have a trigger (indicated by the lightening bolt. Presuming that working correctly . . .
One way to do that is if you have a mode for between sunset and sunrise, condition the notification to only send when in that mode.
Another way, although a purist would find this sloppy, is to nest an IF. There is probably a cleaner way so someone else will weigh in hopefully.
Do you think your script would work in the following situation?
The garage door is opened during the afternoon. It stays open into the night.
Wouldn’t your trigger fire during daylight hours (so no notification sent) then when night comes, no further triggers would fire, so no notification would ever be sent?
My goal is to have a notification sent regardless of when the door was opened, as long as the door is open for 30 minutes of “dark time” (i.e. between sunset and sunrise).