No automations after Unifi install

I am not sure if anyone else has ran into this problem or could at least direct me towards a reason why it is happening. Originally I was using a Google Onhub/WiFi mesh solution for my home and the wireless was great (speed was cut back due to wireless backhaul). Hubitat worked awesome and I was able to automate my lights via the built-in Simple Lighting program. About 5 days ago, I upgraded my house to an Ubiquiti Unifi wireless system (USG 3, Switch, 2 nanoHD access points) and placed the Hubitat on one of the smart switch ports. According to the simple lighting application, the automated process looks like it would work and is queued...but when the time comes (app is set to turn on/off at a specific time - 7:30), nothing happens. It almost seems like the port is blocked or it cannot communicate. However, if I log into the device through the IP Address or the Cloud dashboard, I can make updates and turn lights on/off manually without a problem.

It seems weird that everything works manually, but not automated. I tried deleting the automated rule I made and then the Simple Lighting app (then created a new one), but it still didn't work. I haven't tried the Rule Machine yet. Has anyone else noticed this with Unifi WiFi or their Switches or have a fix?

Sorry to hear you're having trouble with HE automation. I've had a UniFi setup with a security gateway, 8 port switch and an AC Pro access point for quite a while. I don't use the Simple Lighting app, but I do use lighting rules (time and event based) extensively with Rule Machine. I've had no issues with them.

I can say my UniFi setup is pretty vanilla using mostly straightforward settings. Did you customize it in any way?

My only guess is somehow the USG is blocking NTP requests and your hub time is off. Check in settings, hub info and you can always set it manually using the browser time.

It's possible that the Google Onhub was handling the NTP requests and now the USG is not.

Thank you both for such a quick reply, I appreciate it very much. I really like the hubitat and the second generation device works great. I used to be a SmartThings user and quit shortly after Samsung took over - I love the idea of local rules, no Samsung and the ability for new program development.

Right now, my setup is very plain and I haven't made any adjustments to settings beyond the radios. I am trying to figure out the hubitat issue and lack of wireless signal going to my outdoor cameras first. I was also assuming the switch or usg was blocking something, but I wasn't sure exactly what to look for and if it could be adjusted. I was pretty sure I looked at the hubitat time and set it to the browser's time, but I will have to check that when I get home. I will attempt to set the time manually or try the rule machine app as you both suggested to see if either one makes a difference - then I will report back.

Thanks again for your suggestions.

All of my networking gear and security cameras are Ubiquiti and I'm not having an issue like you're having.

If you're able to control the lights from the HE interface it's not a networking issue. Ubiquiti by default doesn't block anything outgoing so if you haven't specifically told it to block something then that's not it.

This is what I was thinking, but I am new to the ubiquiti line and thought maybe I was missing something. However, I guess the other issue I have is that if I can access the hubitat/lights, then both the cable and port (on the switch) should be fine. I have reset the switch to factory settings a few times already when creating/moving my controller. Maybe that is the issue - I moved the ubiquiti controller to a DigitalOcean to keep on all the time (costs the same as running a desktop 24/7). But again, if I can see the lights turn on/off when manually clicking the dashboard button, would DO block the automated message?

I have a USG3, 60W switch, AC-Pro, and a Pro. But I'm running from a CloudKey. I don't have my IoT objects in a different VLAN. I do run PiHole. No issues with Hubitat.

Edit: I did reserve an IP for the Hub

Not helpful I know, but I'm also using Ubiquiti, an Edgerouter 3 lite, 3 hot spots and a cloud key, and I did absolutely nothing for Hubitat except to reserve the hub IP as a static IP assignment.

No issues whatsoever.

Scott

I think you can safely stop thinking it's the network gear. You've proven to yourself that you can reach the hubitat and it can control the lights. It's just the automation itself that isn't working.

What I would suggest is watch the logs on the hubitat when the automation is supposed to happen. Those will give you a clue, especially if you had debug on.

And of course, check your date/time on the hub.

1 Like

I ran a few tests last night - the network and DO are both working correctly. Using the simple lighting application, I set the lights to come on within a minute and then turn off a minute later...everything worked great. The time on the HE looked correct, but I clicked the use browser's time button anyway just in case.

Next, I used indoor lights and the original outdoor lights, both worked perfectly. Since everything worked, I changed the settings for the simple lighting app back to what I wanted...turn the outdoor lights on at 730pm and perform the anti or turn off at 730 am. Last night at 730pm, the lights came on correctly. However, at 8am today, the lights were still on and never turned off.

It looks like the main function works, but not the anti function. The reason I am doing specific times is to get around the sunrise/sunset option not working at one point in time.

Thanks to all who replied, I appreciate the help and comments.

What do your logs show happening, or not happening, at 730am?

Honestly, I actually had a jump in time according to the system events log, going from ssdpTerm events at 5:56am/hsmSetArm at 6:00am all the way to a harmony hub event at 4:01pm. Sadly, the reason why I thought things were broken, is that the lights did not come on again tonight - in which everything worked fine before. After the 4:01pm event, the next event log was at 8:23pm saying sunset was true.

According to the lighting app:

Event Subscriptions
No Event Subscriptions are set.

Application State
|appName|Rise/Set|
|cancel|false|
|disabled|false|

Scheduled Jobs
Handler Next Run Time Prev Run Time Status Schedule
|doAction|2019-04-25 7:30:00 PM EDT|2019-04-23 7:30:00 PM EDT|PENDING|0 30 19 * * ?|
|doAntiAction|2019-04-25 7:30:00 AM EDT||PENDING|0 30 7 * * ?|

What does your USG show for NTP when you ssh in and type "ntpq -p" ? You can also try setting the USG NTP to another server and test.

Thank you for the command that helped...I am still learning the Ubiquiti line. To answer your question, here are the results:

 remote           refid      st t when poll reach   delay   offset  jitter

==========================================================================v
+107.181.191.189 40.139.41.69 2 u 647 1024 377 89.176 2.532 1.033
+pool-173-71-69- .PPS. 1 u 635 1024 377 33.228 -1.210 1.762
*stratum-1.sjc02 .CDMA. 1 u 38 1024 377 82.992 0.171 1.950
-ntp2.inx.net.za 196.21.187.2 2 u 85 1024 377 264.569 13.391 1.320

However, according to the NTP section of the controller settings, the location is 0.ubnt.pool.ntp.org times 4 really. I updated it to 0.pool.ntp.org for now, may see if there is a better one.

So I converted the rule or lighting recipe over to the Rule Machine and set the lights to come on between 730pm and 730am, all other times it is off. The rule/lights still won't go off for a few days even though the action is pending/scheduled. Interestingly, the hubitat login says the time is false, but when I open the lighting rule, it immediately changes to true. When clicking the done button, lights come on. I feel like the port or the hubitat app is hibernating until activated, then updates. What would cause the delay until I "touch" the rule?

That wouldn't have anything to do with the port on the hubitat at all. That's Rule Machine basically refusing to run a rule, it sounds like.

Paste your rule here, screen shots, and one of us can help you figure it out. If not I'm sure @bravenel can jump in and help out, since he created Rule Machine. :slight_smile:

Thanks for the reply. I was actually thinking the port on the unifi switch itself hibernating, but I doubt that is the reason either.

Attached are a few screenshots of the rule itself and the settings page. As you will notice, I do have an update to the device, so I will perform that in case it helps.

The only updates I made to the unifi system as of right now: enabled IGMPv3 snooping throughout settings/devices, DPI on, uPnP is off, turning spanning tree to STP on switch (priority 4096), and the rest are access point changes.

Thanks,
Kyle

Ports on the UniFi won't hibernate, it's not a function they have.

So while the rule is "true" none of those 4 lights are on at all?

The only thing I'm not 100% sure on is the "Notify Pushover" actions. I've never used them so I'm not sure what to expect with them.

One thing I see is "Rise/Set" in the screen cap of your "apps" shows "false" but in the rule itself it shows "true". Did you take the screen caps at different times?

Maybe @bravenel will be cool enough to take a look at what you've done and have some advice.

I didn't think they hibernated, but it seems odd. When first entering the apps section of the device, it says the Rise/Set rule is False and all of the lights are off by default. After clicking on the rule title/link, it navigates to the rule criteria page, where the status changes to true. If I click the done button at this point, the rule activates and the lights turn on/status is true on the main apps page. This is kind of why I mentioned the hibernating...not that I thought Unifi did this by default, but it seems like the hubitat is not getting refreshed until I touch the rule. At that time, does it realize it is supposed to be activated.

The notify pushover action is simply a test for when I am not home or able to see the lights. This simply notifies my cell phone when the lights turn on or off...basically, if the rule activates. Sadly, the pushover rule works fine on the laundry app or once the Rise/Set rule activates.

The only other thing I noticed was that according to the USG logs it is on UTC time...but that seems correct according to time conversion. I feel dumb, like I am missing something simple :wink:

The timezone your network gear uses won't matter. The hubitat up reaches out and gets its own time. Like I said previously you can stop trying to figure out what your network gear is doing to cause this, that's not the cause.

I've seen other posts on rules that only run when you click "done" on them. I can't remember the answer/solution but I'm sure it's in those threads.

You could also update the firmware on your hub and try to recreate the rule now that Rule Machine 3.0 will be installed with the update.