After sunrise condition is not working occasionally

I have a rule, which runs 1 min after sunrise and turns off the lamp post if it is between sunrise and sunset.

I also have a rule, which runs when a door is opened and turns on entrance lights when it is between sunrise and sunset.

1-2 times per month the lamp post keeps being lit during the day and the entrance lights turn on during the day. I verified all my rules, and everything seems to be corrected.

Hubitat reboot usually solves the issue.

Rule-4.0:

Rule-2.5:

Any thoughts?

Interesting. Is there anything in the logs when this happens?

System Events look nominal:

systemStart System startup with build: 2.2.1.116 2.2.1.116 2020-06-19 03:35:47.941 PM EDT
sunriseTime 2020-06-20T09:26:00.000Z API 2020-06-19 05:26:00.135 AM EDT
sunrise true API 2020-06-19 05:26:00.024 AM EDT
sunsetTime 2020-06-20T00:31:00.000Z API 2020-06-18 08:31:00.148 PM EDT
sunset true API 2020-06-18 08:31:00.021 PM EDT

Rule logs:

2020-06-19 04:17:09.726 pm info Entrance light on when Front door opens is now False
2020-06-19 04:17:09.666 pm info Entrance light on when Front door opens: Front door contact open
2020-06-19 04:16:45.613 pm info Entrance light on when Front door opens is now False
2020-06-19 04:16:45.550 pm info Entrance light on when Front door opens: Front door contact open
>>Restart happened here
2020-06-19 03:31:52.267 pm info Entrance light on when Front door opens is now True
2020-06-19 03:31:52.197 pm info Entrance light on when Front door opens: Front door contact open
2020-06-19 03:00:26.695 pm info Entrance light on when Front door opens is now True
2020-06-19 03:00:26.483 pm info Entrance light on when Front door opens: Front door contact open
2020-06-19 02:59:54.526 pm info Entrance light on when Front door opens is now True
2020-06-19 02:59:54.429 pm info Entrance light on when Front door opens: Front door contact open
2020-06-19 02:59:04.569 pm info Entrance light on when Front door opens is now True
2020-06-19 02:59:04.395 pm info Entrance light on when Front door opens: Front door contact open

The other rule does not log at all (maybe Rule-2.5 vs Rule-4.0).

Did you have a power outage the day the sunrise/sunset rule failed?

OH ... There might have been an issue with 2.5. Seems I vaguely remember something coming up with that. I'd recommend upgrading your rules if you run on 2.5

1 Like

So, I didn't notice any power outages. Just verified my Nest feed and it does not show any gaps in video recordings, so I would say no power outages.
Also, with power outage, I would expect that running rule actions manually would apply proper rules. However even a manual run produces wrong state.
Also, the orange [FALSE] next to condition was green [TRUE] before reboot.

As for Rule-2.5 - I thought about that and that's why I upgraded one of them to 4.0. But this is still happening.

Just out of curiosity, would you be willing to pause your rule and set it up in simple automations instead for a day or so? I'm curious if this will happen in Simple automation rules as well. You can do it in one rule and use your offsets.
The reason I ask is because of the new model that is recommended for rules. If HE staff would look at it, they might recommend changing it over to simple automation because of efficiency reasons. You may see better response from your hub by moving some rules over.

Yeah, I can definitely try that. But it will be not couple of days, rather couple of weeks. This happens 1-2 times per month.

1 Like

Ok, a paused the Rule-2.5 for Entrance Lights and Front door and replaced it with a simple automation rule.

I kept the Rule-4.0 for Lamp post, just to see when this repeats.

Will let you know after couple of weeks/months :slight_smile:

1 Like

That sounds great. Instead of pausing it, disable it. That way it's not processing the rule and it's not broken. Do you know how to do that? It's a hidden Easter egg.
Don't make fun. I have a few rules disabled
:grin:

1 Like

No idea how to do that :slight_smile: I only found how to pause it

upper right of the apps page click the x
image
It will expose the disable check boxes. It's nice because then the rule doesn't get evaluated. I'm told that they still evaluate if only paused.

After almost a month of flawless work, this happens to me again. I haven't restarted my hub yet to allow for some troubleshooting .

Current hub version: 2.2.1.116. There is an update available, but my experience shows that just the fact of hub reboot will help, not the upgrade itself.

Here are some logs:

app:609 2020-07-18 10:30:39.640 am info Turn On Entrance light when Front door Opened Turn On
app:609 2020-07-18 10:25:35.256 am info Turn On Entrance light when Front door Opened Turn On

also explicit run of the rule from the app:

app:514 2020-07-18 10:33:40.000 am info Action:     Off: Porch, Lamp post (skipped)
app:514 2020-07-18 10:33:39.992 am info Action: ELSE (skipping)
app:514 2020-07-18 10:33:39.849 am info Action:     On: Porch, Lamp post
app:514 2020-07-18 10:33:39.838 am info Action: IF (Time between Sunset and Sunrise(T) [TRUE]) THEN

Also the events for hub show:

Name Description Value Event Type Date
sunriseTime 2020-07-19T09:43:00.000Z API 2020-07-18 05:42:00.116 AM EDT
sunrise true API 2020-07-18 05:42:00.018 AM EDT
sunsetTime 2020-07-19T00:25:00.000Z API 2020-07-17 08:25:00.191 PM EDT
sunset true API 2020-07-17 08:25:00.018 PM EDT
sunriseTime 2020-07-18T09:42:00.000Z API 2020-07-17 05:41:00.122 AM EDT
sunrise true API 2020-07-17 05:41:00.018 AM EDT
sunsetTime 2020-07-18T00:25:00.000Z API 2020-07-16 08:26:00.123 PM EDT
sunset true API 2020-07-16 08:26:00.019 PM EDT
sunriseTime 2020-07-17T09:41:00.000Z API 2020-07-16 05:40:00.122 AM EDT
sunrise true API 2020-07-16 05:40:00.018 AM EDT

But even rules machine evaluates the value wrong (it shows TRUE despite local time of 10:49AM):

As I mentioned the hub hasn't been restarted, so I can help with any troubleshooting steps including SSH'ing to the box if that can bring more data.

Apparently next day it worked just fine. I think I will remove all the 2.5 and 3.0 rules I have and see how this changes things.

BTW, Hubitat is not open source by any chance, right? I would like to look into implementation and maybe try to spot the reason for failure...