Thanks for the reply and suggestions. I have been waiting on the PDU for over a year and saw someone post it was in stock, so I hopped over and bought one on the quick. I'll load the driver back up and start doing some more thorough testing and report back.
When I disable (toggle) the "show network alarm data", the alarm data does not get removed. I'm also getting tons of errors in the logs. I'll dm you those. Maybe it's because I'm running some EA software firmware?
Currently running:
OS - 1.12.30
Network - 7.2.94
Protect 2.2.2
UDMP - 1.12.30
USP-PDU / USW-Pro-48 / USW-Flex / USW-Lite - 6.3.13
U6-Lite / U6-LR - 6.2.39
I might just have to wait to get things back in "official" to get these integrations to work properly.
Answered in message, EA should not be the issue (except in cases where I do not recognize a device yet) as all your devices should be recognized.
Updated Version(s):
- UnifiNetworkAPI.groovy = 0.4.29
- UnifiNetworkChild-USW48PoE.groovy = 0.1.5
Change(s):
- Scheduled Login rate has been altered to every 10 minutes (used to be 1 hour) because it appears the Cookie timeout has changed (so cookies expire quicker). You MUST Save Preferences in order to update the schedule.
- Some error checking for nulls was added in a previous (unpublished) version.
- USW48PoE child saw changes to clarify the port commands when performed manually from the device.
Question for those using this with the Smart PDU Pro. What extra functionality does this integration with Hubitat provide? Are you able to see power usage by outlet ? I am thinking of getting the PDU Pro and want to see what I can do with it when paired with this.
This seems to cover all my devices with the exception of the Aggregation Switch Pro. Great stuff here.
While I do not have mine yet (it is ordered), the PDU Pro can have each outlet controlled as well as each pair of USB ports. There is no functionality to monitor power usage built into the driver, but I am not aware if the PDU Pro can do that (it is not listed on their site and the data sample I was given for one a while back did not show power usage at that time).
As for the Aggregation Switch Pro I can add support for that if you can provide some log information in private message(s). DO NOT POST THEM IN THE THREAD (do not want any extraneous information exposed). On the parent device, enable Trace logging. Then perform a "Refresh Unifi Devices" command. Copy the log info and send it to me in a private message. If you can also tell me key features it offers (I assume enabling/disabling the ports, so anything beyond that) then I can try to work with you to get those added into the child driver to begin with.
Once I have that initial sample I can get at least a bare-bones child driver made and support added into the parent driver. Then it becomes a matter of what additional features (if any) are added and particular data it might provide. Those can require additional logs or even some back-and-forth examining information from the Unifi console provided using Google Chrome. But those are next steps.
Follow-up now that I have my PDU Pro:
- I am having to do some rework due to the ordering of outlets (since the USB ports count as outlets) and how they respond, especially "outlet_overrides".
- These have power reporting! You mentioned it as a question but I did not know if you meant they have them or not, and it turns out they do. There is power usage (and voltage) data for each AC outlet as well as the entire unit's power consumption. I will definitely be adding that all in.
- They are fairly slow to respond to on/off commands. There is a noticeable delay even when using the Unifi interface itself.
- I need to do some testing of the USB ports. They SAY they are turning on and off but there is no relay noise (like with the AC outlets) and my phone does not charge with any of them regardless of whether they are on or not (again, confirmed with the Unifi interface).
So... there will definitely be some updates in the near future for the parent driver and PDU Pro child driver.
@snell thanks for the update. Awhile back, I was researching the types of PDUs out there - for homelab use. And it seems the fancy / pricey features were:
-
metered outlet functionality (local current monitoring per outlet)
-
switched Outlets functionality - Local or remote control of individual outlets --> ability to turn on, turn off, reboot or lock out power to individual outlets.
-
per outlet metrics - amperage, voltage, KW, IP Address ..... Imagine sending all that data to some grafana dashboard
Will be great to see if we can replicate the above functionality via hubitat.
ps: I will send the data for the aggregation pro when ready. thxxxx
Love this tool, however, has there been any progress on the 2FA support? UI is definitely moving that way, as everyone is. UI Verify is a good tool. I have approached them to allow computer to computer authentication but nothing positive on that front yet.
I would like to use it or have your tool work with local only. they appear to block even that. Hopefully there is solution but I am not knowledgeable enough to figure it out myself.
Any thoughts on this would be welcome.
LJ
- Metered outlets will definitely be available, I already have this working on my copy of the driver. Power (Watts), Current (Amps), and Voltage. However it is on a polled basis so if things change it does not push the data (like a ZigBee or Z-Wave device would). I am going to add a refresh capability to the PDU Pro child driver just because of this.
- Outlets (and USB) can be controlled individually on/off/toggle (although there is a bit of an issue about this at present I am fighting, see below). It can also "power cycle" an outlet (turn it off, then turn it back on automatically after a little delay, meant for rebooting devices). There is ALSO a capability (I have no decided how to implement the driver side yet) to automatically power cycle outlet(s) if the WAN goes down (to try to reboot the modem).
- See #1 above.
So work in progress is:
- Make a refresh for the PDU-Pro - simple
- Get outlet control working properly... right now there is a problem because of the way the API handles for the PDU-Pro. It treats them much like ports on a switch (surprise) and uses an override function. But the override needs to reaffirm EVERY outlet that has/may change. So what happens now is you set outlet 1 to off... then set outlet 2 to off... outlet 1 will switch back to on because it did not get the override to stay off. I thought I had it solved (based on similar work for my switches) but it apparently did not work. - Not simple.
- Figure out what is going on with the USB ports on/off and whether my PDU-Pro is broken for them or not. They NEVER provide power that I can tell. - ???
- Power Cycle outlets based on WAN capability... Maybe a preference for one or more outlets... - Medium.
@ljp-hubitat:
I may be able to add in a command to submit the PIN someone gets from one of the multiple methods Ubiquiti allows. It looks like they allow 1 to 30 day timeouts... I will look at it (just enabled it now).
My Blink driver needed to deal with something similar but the PIN they receive basically authorizes the computer/device so it is pretty much once (ever) and done.
EDIT: I enabled it... and it did not change anything (yet) for my local access to my UDMP. Driver is still able to query and I can get to the web interface with no change to login method. I DO have to use the PIN (or approve the access) when I go to ui.com to do anything, so the MFA is definitely enabled and working.
When you say you enabled it, do you mean you enabled MFA on your security setting on UI.COM or enabled something in your code? When I enabled MFA again after using your Drivers for a few weeks, I started getting notifications on UI Verify on my phone every 10 Minutes that there was a connection attempt. Are you using UI Verify? Also, your drivers stopped connecting. They were throwing errors of Connection refused on all of your devices and children.
Now Ubiquiti is going to UID, but that doesn't even seem to have the ability to have a machine login that doesn't require MFA.
LJ
I enabled MFA on ui.com and I am using the UI Verify app (on Android). I changed nothing in my driver. Not getting any notifications about it in the app and my UDMP device (parent and children) are working properly (login every 10 minutes is expected as that is when it accounts for the cookie timeout).
I am connecting to my UDMP with a local username. I have my main account with the verified email address that is "Verified" but it also has a local username listed. That is what I configured my parent device to use for connecting to the controller.
That must be the difference. I need to create a local only User name and password. I will try that and get back to you.
EDIT: does it require admin rights or viewer rights?
LJ
To be able to control everything it needs admin rights.
The user is not local only, it is still tied to my ui.com account. But having the local username apparently allows it to be referenced either way and, if your local account solves the MFA issue, it means that MFA is not used with local accounts (which will be good to know going forward).
I use MFA with my own integration and I use a local account. No problems.
It appears that does the trick. I set up a local admin account, re-set up MFA, tested my owner login (MFA was requested), changed the login in your driver, watched it login, and it is gathering data. So, yes, It appears the local logins bypass MFA when used within the same network.
Now the question in my mind is if I go to UID, will that change the behavior of MFA on local accounts? I am still trying to justify the use case for UID. Not sure that it is not overkilling in my environment so far.
Anyway, that is a question for another day. Thanks so much for your work on this driver and your support of its users.
LJ
USP-PDU-Pro users... I have to apologize. I said I would get an update out there that has additional features and corrections to existing functions but I just have not had the opportunity to work on it. With the sudden change to the Blink servers for that API I have been focused on trying to restore ANY functionality (unsuccessfully) for those drivers.
Hopefully I will get back to completing the update for the PDU-Pro (it benefits myself also) soon, if only as a break from the Blink stuff.
Just thought I should let you folks why there is a delay.
Note(s):
- All changes are related to the USP-PDU-Pro and expanding/correcting support for that device. These changes took place in the child and parent driver.
Updated Version(s):
- UnifiNetworkAPI.groovy = 0.4.30
- UnifiNetworkChild-USPPDUP.groovy = 0.1.4
Change(s):
- Overhaul of how the USP-PDU-Pro USB Ports and Outlets are handled. Turns out that if you have ever set ANY outlet on/off you need to make sure you continue to send that override with every single change to any OTHER outlet, or else it will just reset the other outlet(s) back to the factory default state of "on".
- Ability to control USP-PDU-Pro USB ports individually.
- Power/Voltage/Current reporting for USP-PDU-Pro per AC outlet. It also creates a combined total for the current to provide as part of the overall device, and uses the last-reported outlet voltage for the overall device. The device itself has it's own power value reported so that is provided as well.
- Changes to Tile method in the USPPDUP child driver that will likely be reused on other drivers as I touch on them.
I FINALLY snagged one of these. Can't wait to get it integrated!
Nice! As always, let me know if you spot anything or think anything could be improved.