Sunrise Sunset form mask issue in simple rules

Hi.

I just upgrade to the most recent version of HE. In simple Rules I cannot enter a "+" symbol into the before / after sunset fields.

Have tried this several different way and each time it just leaves the number itself and nothing else.

The "-" (minus) symbol, however, works just fine.

This rule was working for a while, but has recently stopped running. Not sure if this is related to the Sunrise / Sunset Bug in 2.2.3.145 - #149 by hpgurgel issue.

Anyone seeing anything similar?

You do not have to put the + in for positive numbers.
If you do, as you have out, it just removes it.

1 Like

Okaaay. That's slightly obtuse, given the original hint, but whatever... So why has my rule stopped working?

1 Like

Sorry if it came across that way. :blush:
As to why your rule has stopped working, not sure. It looks good to me. Very strange. I wouldn't have thought it would be to do with DST changes but who knows.
Are the scheduled events looking ok for the times? (I'm never sure sunrise times appear as they get evaluated after midnight I believe).
Not a solution but maybe just try deleting and redoing in case it did somehow get screwed following the DST change.

1 Like

OK. Will do. BTW, I meant the hint was obtuse... Not you :crazy_face:

1 Like

So I recreated the rule yesterday with the identical parameters during the day. It ran at the appropriate time to turn on the light, but didn't turn off.

I'm calling this one out as a regression bug, since it used to work OK with these parameters. I only noticed it as not working earlier this week, but not sure how long it has been.

Hi @bravenel could you have a quick scan of this issue.
@mtate could you post a snapshot if the rule again and any logs you may have. Anything else that might help Bruce with his investigations.

This is how it looks today. Still nothing triggered 45 mins after sunset.

Afraid I don't have any logs for this.

Your rule is set to trigger at 45 minutes before sunset and 45 minutes after sunrise. Nothing should happen at 45 minutes after sunset.

As @pseudonym said above. I'm afraid your rule doesn't match what you are trying to achieve.

I must admit I was only working to your original post when it was about not being able to put in a '+' for a positive value in a field and that it didn't work any more. In that you have on at sunset -45 and off at sunrise +44.
You need to change the 'turn off' field from sunrise to sunset.

Not sure I am understanding this correctly. I want the light to be on from 45 minutes BEFORE sunset, until 45 minutes AFTER sunrise.

Ah OK. In that case your rule is correct then.
It was because you said-----

We thought your rule was wrong. It obviously isn't. :slight_smile:

What would be an interesting test is if you tried it in Rule Machine to see if it works OK using RM.
One way would be.

TRIGGER
Time is Sunset -45
ACTIONS
Turn On light
Wait for sunrise +44
Turn off light

This is what I have for my porch light.

image

Again, not an answer to your issue but at least it would work. :wink:

Just re-read this and agreed it does not make sense. My point is rather that the light never turned off at sunrise....

1 Like

Yes, agreed that ought to work. I'll give it a go tonight and see what happens...

Agreed, and it should have according to your rule. Something is obviously not right here. Not sure what.

Just to make sure the rule is working, can you change the On time to Certain Time a few minutes from now and Off time to Certain Time a few minutes later?

If that works, I'd change On time sunset and Off time to sunrise

If that works, I'd add the before and after to sunset and sunrise.

The would help identify an issue with the rule, sunset/sunrise, or the offset.

One thing to look at in a case like this are the System Events. There you should see sunrise and sunset events, and also sunriseTime and sunsetTime events that happen right after sunrise and sunset. These latter carry the time for tomorrow's event, and are used by before-sunrise or before-sunset triggers.

The other problem that can mess this up is the Location of the hub not being set correctly, with the correct time zone.

1 Like

Using the simple automation, I set on/off explicitly to 16:18 to 16:20. Worked fine. I'll try it tonight with the bare sunset/sunrise combination and let you know.

1 Like

Checked location and Timezone. Both fine.

1 Like

These work in a different way, so won't tell you much. Actually, sunset and after sunset work using the system sunset event (sunrise similar). Before sunrise uses the sunriseTime event to schedule tomorrows trigger. You can test this by using a before number calculated to work out to be in a few minutes from now. You can do this for both before and after. For example, right now in US it's daytime. So I could test after sunrise with the right number of minutes to be in a few minutes, and likewise before sunset. These are not conclusive tests however, because the method used on the first day is different than on subsequent days.

1 Like