Yet another Sunset to Sunrise issue report

Hub Model C7
Hub Software Version 2.2.2.129

New Hubitat user here so please take it easy...

Long story short I have a z-wave motion sensor which works no problem and a hue light that also works, I can see the motion sensor goes active on the GUI and the light I can operate via GUI or Alexa life is good.

What I would like is an automation that if the motion sensor detects motion after sunset -30 and before sunrise it will turn on the light, seems simple enough.

I setup a rule in the rule machine 4.0 and selected from sunset -30 to sunrise but that shows TRUE 24/7 so even when its daylight it would see motion and turn the light on which was not the desired behavior.

I played around and said ok how about between sunset and 5AM specific time, that looked like it would work but alas it didn't either.

So right now I have it set to between sunset and 11:59PM which seems to be the only way to make it work,

I read these posts but I cant seem to find what I am doing wrong and hope its something simple and easy

I also have the time set properly and can see the sunrise/sunset info

Any suggestions would be appreciated

Why? Typically Motion Lighting or Simple Automations app would be more appropriate. Especially for new users, or people not well versed with Rule Machine. I would try those first before messing around in Rule Machine any further.

Thanks, yes I could accomplish this as a simple automation but I am trying to understand and become more well versed in the rule machine as I have other complex automations that I would like to run through the rule machine, so I am starting off simple so that I can understand and build upon.

It is strange that it does pick up your Sunset but isn't ending at sunrise. I would try adding your zip code and see if it corrects the issue. I just did a quick test for you and it is working fine for me. My sunrise was just under an hour ago.

Actually this is a better example for you to show for sure it is working correctly. Post screen shots of your actual setup like below so we can see it built and what the log reports.

@chipworkz I do have my Zip code entered.

image

Hmm strange I setup a simple automation for testing deleted the rule machine ones and it turns the light on during daytime so there must be something wrong outside of my logic in the rule machine.

The system clock is proper

image

Logs where it turned it on during the day

Simple rule

Not sure what I am doing wrong

Yes that is strange since your hub knows what time Sunset and Sunrise is and both methods are not working. Have you tried rebooting the hub from the settings page? I would try that and if it is still happening, setup a simple test like my last example and have the else-if cover the current time of your test to duplicate what I posted. Then run that test and capture the log example for that rule. I think that would be a good start to have official support look at it and address it.

Go through the whole complete list of Time Zones (Settings tab, Location and Modes) and see if there is an alternate or secondary listing for your area. They aren't alphabetical, so you will have to go through the whole thing. In Michigan, where I am, for some reason there are 3 possible time zones listed.

I think there might be a bug when particular time zones are used. I have anecdotally seen your problem fixed when simply changing to a different zone.

Worth a try anyway.

At risk of seeming a heretic, can I mention that photocells are less than $10 retail, so if you want dusk-to-dawn, you can do that in hardware?

Ditto for motion sensing. I have some solar-powered motion sensor lights from Costco that do their thing without any programming at all.

I think the soft boot fixed it. I do see multiple available time zones but all I've done so far is reboot and the simple automation seems to be working.

I hate changing multiple things at once and not knowing what the cause was.

I'll let this run for a couple more days and switch to the rule machine and see if that's happy as well and report back.

2 Likes

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