Why doesn't porch light turn off at 11:30 PM?

I have a basic rule that turns on my porch light at sunset. Then as you see it's supposed to turn off the porch light at 11:30 PM. But it doesn't turn it off. Any idea what I'm doing wrong?


That configuration looks correct for what you described, so you'll need to look at additional clues to troubleshoot. Logs would be the most helpful (enable them if you didn't for this app), but the Events tab (which will also show commands and is what you'd really be interested in) on the device detail page may be helpful in their absence.

See this for more tips and more about both of the above:

Also, any chance you hit "Done" while you were waiting for the time? That will effectively "reset" everything and would explain this problem if it was during that time.

1 Like

Thanks, I'll look into it. Another thing I tried was to create a rule that just shut off the porch light at that time, and it worked.

I was going to suggest creating another Basic Rule to shut off the light. I've not used Basic Rules much and try to use WebCore exclusively.

Yeah, it's 100% reliable. No need to introduce this sort of misdirection. There is some other reason this rule isn't working. My outdoor lights use this exact method, and have worked 100% for several years.

5 Likes

This may be a stupid answer, but have you actually let this rule run undisturbed through an entire sunset to 11:30 PM period? Have you experienced this behaviour more than once?

If you created the rule after sunset, and then turned on the light manually, it would not go off at 11:30 PM.

If you modified the rule anytime after sunset (after the light turned on), that would reset the rule, and it would not turn off the light at 11:30 PM

2 Likes

That makes sense, I may have done some trouble shooting after sunset. Also, I had several rule apps installed and all disabled except for Basic Rules. I removed all of them except for Basic Rules and rebooted the Hubitat. I didn't realize there were so many rule apps! Now someone in this thread said they used WebCore. I'll have to check that out as well!

-Thanks

I had many rules with the same or similar name "Turn on Porch Light at Sunset" in other rule apps, besides the one I'm using Basic Rules. Just in case I removed all of these other rule apps and rules, and rebooted the Hubitat. I'm ready for a test tonight at sunset.

-Thanks

1 Like

You can look at the App Status page (i icon) to see some interesting things. It will have an Event Subscription to your hub (location) for sunset; this event fires the rule. After sunset, on that page at the bottom will be a Scheduled Job to run at 11:30 PM, like this:

Needless to say, 'resumeX' is the method of Basic Rule where it picks up running the actions after the Wait.

Thanks I just took a look at the App Status page, good info there. I have another issue with this rule. I setup a test so the porch light came on at sunset and then turn off the porch light at 9:15 PM and it worked as expected. However, I looked into the living room and the living room lamp was also shut off! This is odd because the living room lamp has nothing to do with this rule. I'm guessing maybe there is an issue with the ARP table of my router. I'll try rebooting the Linksys router and see if that helps.

What is your reasoning behind that theory?

What type of devices are these lamps, Zigbee, Zwave, Wi-Fi?

Zigbee and Zwave devices can be controlled without the Hubitat being connected to a router (other than keeping the clock updated) so ARP table issues seem unlikely.

Did you witness the living room lamp going off at the same time (9:15) or only noticed it some time after 9:15? Did the logs show both lamps going off at the same time?

1 Like

instead of waiting for hours, how about adjusting the timings so you only have to wait a minute or 3. Then you can try a lot of tests without waiting a week to get through them all. Once you zero in, set the times back to where you want them.

1 Like

No, these are Kasa switches which use Wifi. So they are in the Linksys router's ARP table. And yes, the living room lamp went off at 9:15 PM like the porch light.

Yes, I did that and it worked no problem. BUT, the sunset event only occurs at once per day so a true test can only be run beginning at that time. Someone else told me that testing AFTER sunset is an invalid test because of the lack of that trigger.

That's true, and I don't consider a rule 'solid' until it has run at least once naturally from start-to-finish in the final state and performed as expected. (Of course, it's on the 83,546th run that the one logic corner case you didn't consider rears up and bites you. :wink: )

That said, there's a process you can use when you are testing/editing/messing_with/whatever rules that have and are in the middle of the wait cycle. I use Rule Machine almost exclusively, but the same logic applies to the other native apps: (And I got this from someone else long ago, so credit to whomever the poster was that sent me down the correct path.)

  • Open the rule in a new tab/window.
  • Edit the rule as you need to.
  • Press the 'Update Rule' button if you modified the trigger. (And even if you don't. I hit it every time just so I don't forget to do it when I actually do modify the trigger.)
  • Press the 'Run Actions' button. This will fire the rule, and catch the actions up to current time.
  • DON'T press 'Done.' Simply close the tab/window the rule is in.

This is what Bert was describing above, but I thought I would write out the entire process.

3 Likes

I removed all my Kasa switches from Wi-Fi to Hubitat. That cleared up issues I was having with the apps I used.

What do you mean you "moved them from Wi-Fi to Hubitat"?

1 Like

I clicked the "Run Actions" button at 11:00 AM and the log results are below. I don't think this is a valid test because both triggers (sunset and 11:30 PM) and not in effect.

Your only "trigger," if we want to use that term for Basic Rule, is sunset. That's what starts your first actual rule action. In your case, that's turning on them lights. The 11:30 PM thing is an scheduled job temporarily (while it needs to be) created as part of your actions, and that's why I mentioned above that it's important not to hit "Done" while you're waiting for this; that starts things over. No sunset (or no manual running of the actions as you did now), no 11:30 PM scheduled job. You also have wouldn't see anything at 11:30 PM if you created this rule sometime between sunset and 11:30 PM; it's not a "trigger" in that sense.

Doing what you did now should work the same as far as testing that goes, though it's likely well before sunset for you anyway, so you'd get the rule "triggered" again and the 11:30 PM scheduled job (re)created even if you hadn't done this. If not: check logs now that you have them enabled and see what clues they provide. Everything looks good, though, so as long as you note the above, here's to hoping you'll be fine!

2 Likes

When I was having trouble Jeff helped me out here's the link Understanding Kasa integration