Added recognition for the Cloud Gateway Ultra (thanks to @user588 for the model). It should use the same child driver as the Cloud Gateway Max (the UnifiNetworkChild-UCGMax.groovy) as they appear to have the same port hardware and features (from what these drivers can do).
Altered the way Events are processed to remove the "Forced" functionality. This means that I will no longer force an event to state that it is "isChanged". It is now totally reliant on the Hubitat's underlying determination. I also changed the trace logging in this area to remove the Forced portion but be more specific if there is a unit or description associated.
Awesome I was literally coming here to post something about this as I am getting a bunch of "forced" events for the same value.
One request for your consideration is an option to suppress the Uptime* and LastSeen event updates. Personally all I care about is if a mobile device is present or not, no further details. With presence check turned on these come quite frequently and I personally don't have use for them so trying to reduce the event load on my hub. You could consider making a new preference that allows users to enable/disable the tracking of these updates.
@snell updated to the latest 0.4.79 version and something is still messed up with the Connected To Mac update. Events are being "forced" every minute even though my phone is connected to the same AP/MAC.
The Forced piece is gone, from the parent and anything it sends to the children... so there might be something on the Hubitat side that it does not recognize that type as changing or not? Not sure.
Even if I do not "force" it by specifically setting the "isChanged" flag, the sendEvent function that Hubitat will still automatically decide whether to make that true or false on their own...
@snell figured it out, in the version history v0.4.51 you mention:
"Connected To MAC" to "ConnectedToMAC", "Connected To Name" to "ConnectedToName", and "Signal Strength" to "SignalStrength" to fix visual error on device page(s)
But I found several references to "Connected To MAC" within the code which I assume need to be updated. For example on line 1790 TempMap is declared using "ConnectedToMAC" but then on 1810, 1814 , 1840, and 2266 "Connected To MAC" is being used with TempMap instead.
But specifically changing lines 1876 and 1932 from
PostEventToChild( "Presence ${ ClientMAC }", "Connected To MAC", ConnectedMAC )
Having trouble getting my G4 Doorbell (POE) to show events or log anything when the doorbell is rang. I have a Dream Machine SE What am I doing wrong?
I've installed the Unifi Protect API & UnifiProtectChild Doorbell drivers. I then configured it and confirmed it can connect (using a non MFA local admin account):
It creates the doorbell child on its own, and all seems well, but whenever I press physical button on the doorbell, I get nothing in my logs or events. What am I doing wrong? I assume I'm a moron, but I can't figure out why I'm a moron.
Corrected multiple Connected To MAC/Connected To Name/Signal Strength instances that somehow still existed with their spaces... Now the only ones left are in the revision history.
Added a Preference on the parent that will allow you to disable Uptime event reporting (including the sub-divided ones like Uptime Hours, Uptime Minutes, etc...) for all devices EXCEPT ClientCheck. It is enabled by default (and if you do not set it, they will still be reported so people do not need to Save Preferences unless they want to disable it for this). I debated about doing this per-child but I do not want to have to edit EVERY child driver for this, so it went in the parent. But CheckClient only happens every hour, so there should not be any impact to leaving the Uptimes within it.
Updated and added some descriptions to some of the Preferences.
@snell Thank you very much for the last update! You have added several enhancements to this driver, any way I can buy you a beverage of your choice?
Just updated and all good except I do still have LastSeen every minute but all good if you don't want to restrict it with the new EnableUptimeEvents preference. Another idea is to make the LastSeen a state variable instead on the child device. I have seen and worked several community drivers where that was moved from an attribute to a State variable.
Included LastSeen events as being related to the UptimeEvents, as it makes sense that they would be closely identified with each other. They should no longer be updated if the EnableUptimeEvents is disabled.
Also fixed a bug in the placement of some of the events I saw, that has apparently been long-standing. If you performed a manual presence it may have created a Presence child for that... which it should not do for just immediate manual attempts. It SHOULD update an existing Presence child that is listed on the MAC Presence preference.
It seems UDM 4.2.8 and network 9.1.118 fixed the issue for me. One of the bugfixes in Network 9.1.118 was " * Fixed an issue where clients connected to aggregated ports could trigger false connect/disconnect system logs." I suspect that could have been the cause as I have a 2 ISPs.
I just installed this driver. I see all the mac addresses in the device. im trying to detect when an AP goes offline. i have an outside AP connected to solar. sometimes it goes out and i would like to know when that happens. I tried using the trigger of presence changed but it never changes. ive rebooted the AP manually to try and trigger the rule but nothing changes. the %value% always is 0.
I know i can communicate with the AP because i can disable/enable the light on it from hubitat.
can anyone give me an example of what i should be doing to detect an AP offline?
im trying custom attribute now but that doesn't seem to work either. im wondering if the AP is rebooting before the next polling of the data happens. how often does it check the device?
The overall refresh just polls for general stats from the overall site. You might be better off setting the AP to be part of a Presence or ClientCheck for more regular polling of whether it is active or not, or setting up a Rule to refresh the specific AP regularly.
Thanks @snell for this Driver for Unifi. Ever since switching from AT&T DSL to T-Mobile 5g there has been times where I need to power cycle the modem due to them constantly tweaking the 5G in my neighborhood and the 5G gateway wont lock onto multi cell internet. Leaving me with ether no connectivity or performance where uploads are in kbps vs mbps.
I am use a Chestertech 5G modem vs the T-Mobile one since I can fine tune tower access and also have it run over POE from the switch vs the wall wart which allows me to place the gateway in the locations with best 5G coverage that don't have power.
Anyway now that I have a source of POE control in the Hubitat I can power cycle the port when 5G gets twitchy which usually happens overnight between 1 and 5 am or Sunday's once or twice a month.
One question what is the minimal access setting for the account I created in my UDM for the control of POE on ports? Right now I gave the account super admin but I want to peel it back to just what is needed.
Thanks just one more thing, Now Unifi supports Multi Wan I think up to 8 wan ports. Don't know if your variables account for say Wan1, Wan2, Wan3, etc status. I am testing with a 3 ISP config, T-Mobile (Primary-WAN1), AT&T Home Backup (Backup 1-WAN2), and Starlink (Backup 2-WAN3).
The failover inside the UDM is great and you can even load balance if needed. My last gasp is the power on the Starlink and re-active the "roam" service as the end of the world internet access. Amazing how many idea's come to mind once you have some level auto access for automation.
Right now I only have attributes for 2 WAN ports (WAN1 & WAN2) for both Average Latency and Availability. Part of the problem is not having dynamic attributes or such. So if I want to add all 8 now supported, I would need to add 12 additional attributes to cover the 6 ports * 2 data points.
I was curious if any models can support that and it turns out some can, but the numbers vary. The Enterprise Fortress Gateway (which I figured would have the most) maxes out at 5. The Dream Machine Pro (and SE or Max) each support up to 8. Some other gateways are 4, some are only 1... Either way it makes it more complicated for me.
As I touch on these child devices (the data point is only available for child devices) I may update them to support more, up to what the spec says they can handle.