uniFi plugin setup help!

Posted on
Tue Jan 07, 2020 11:14 am
bbbullock offline
Posts: 25
Joined: Sep 11, 2008

uniFi plugin setup help!

I am relatively new to the uniFi network environment and am now trying to install the uniFi-WiFi-AP plugin in indigo. My objective in connecting Indigo w/ my uniFi environment is for presence detection.

Something must be wrong in my plugin config, because I cannot get beyond a set of errors. Below is the log file that I'm currently seeing in Indigo. What might I be doing wrong?

------Log-----------

Starting plugin "uniFiAP 7.26.169" (pid 1443)
uniFiAP initializing ...
uniFiAP path To files: =================
uniFiAP indigo /Library/Application Support/Perceptive Automation/
uniFiAP installFolder /Library/Application Support/Perceptive Automation/Indigo 7.4/
uniFiAP plugin.py /Library/Application Support/Perceptive Automation/Indigo 7.4/Plugins/uniFiAP.indigoPlugin/Contents/Server Plugin/
uniFiAP Plugin params /Library/Application Support/Perceptive Automation/Indigo 7.4/Preferences/Plugins/com.karlwachs.uniFiAP/
uniFiAP Warning logger enabled for WARNING ==> TEST ONLY
uniFiAP Error logger enabled for ERROR ==> TEST ONLY
uniFiAP Critical Error logger enabled for CRITICAL ==> TEST ONLY
uniFiAP check /Library/Application Support/Perceptive Automation/Indigo 7.4/Logs/com.karlwachs.uniFiAP/plugin.log <<<< for detailed logging
uniFiAP Plugin short Name UniFi
uniFiAP my PID 1443
uniFiAP set params for indigo V 7.4
Started plugin "uniFiAP 7.26.169"
uniFiAP testing if variable enableTimeTracking_UniFi is == on/off/print-option to enable/end/print time tracking of all functions and methods (option:'',calls,cumtime,pcalls,time)
uniFiAP myLogSet setting parameters -- logFileActive= ; logFile= /Library/Application Support/Perceptive Automation/Indigo 7.4/Preferences/Plugins/com.karlwachs.uniFiAP/plugin.log; debugLevel= []
uniFiAP start runConcurrentThread, initializing loop settings and threads ..
uniFiAP Error UNIFI executeCMDOnController error: (wrong UID/passwd, ip number?) ...>>{"meta":{"rc":"error","msg":"api.err.Invalid"},"data":[]}<<
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed

0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 104 100 57 100 47 70 58 --:--:-- --:--:-- --:--:-- 128
100 104 100 57 100 47 70 58 --:--:-- --:--:-- --:--:-- 128
Connection
uniFiAP Error UNIFI executeCMDOnController error: (wrong UID/passwd, ip number?) ...>>{"meta":{"rc":"error","msg":"api.err.Invalid"},"data":[]}<<
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed

0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 104 100 57 100 47 71 59 --:--:-- --:--:-- --:--:-- 130
100 104 100 57 100 47 71 59 --:--:-- --:--:-- --:--:-- 130
Connection
uniFiAP initialized ... looping
uniFiAP Error getMessages: (1) error connecting to ip#: 192.168.1.15 wrong ip/ password or system down or ssh timed out or ..?
uniFiAP Error getMessages: (1) error connecting to ip#: 192.168.1.16 wrong ip/ password or system down or ssh timed out or ..?
uniFiAP Error getMessages: (1) error connecting to ip#: 192.168.1.15 wrong ip/ password or system down or ssh timed out or ..?
uniFiAP Error getMessages: (1) error connecting to ip#: 192.168.1.16 wrong ip/ password or system down or ssh timed out or ..?
uniFiAP Error getMessages: (1) error connecting to ip#: 192.168.1.76 wrong ip/ password or system down or ssh timed out or ..?
uniFiAP Error getMessages: (1) error connecting to ip#: 192.168.1.76 wrong ip/ password or system down or ssh timed out or ..?

Jan 7, 2020 at 11:04:39 AM
uniFiAP Error getMessages: (1) error connecting to ip#: 192.168.1.15 wrong ip/ password or system down or ssh timed out or ..?
uniFiAP Error getMessages: (1) error connecting to ip#: 192.168.1.16 wrong ip/ password or system down or ssh timed out or ..?
uniFiAP Error getMessages: (1) error connecting to ip#: 192.168.1.15 wrong ip/ password or system down or ssh timed out or ..?
uniFiAP Error getMessages: (1) error connecting to ip#: 192.168.1.76 wrong ip/ password or system down or ssh timed out or ..?
uniFiAP Error getMessages: (1) error connecting to ip#: 192.168.1.16 wrong ip/ password or system down or ssh timed out or ..?
uniFiAP Error UNIFI executeCMDOnController error: (wrong UID/passwd, ip number?) ...>>{"meta":{"rc":"error","msg":"api.err.Invalid"},"data":[]}<<
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed

0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 104 100 57 100 47 67 55 --:--:-- --:--:-- --:--:-- 122
100 104 100 57 100 47 67 55 --:--:-- --:--:-- --:--:-- 122
Connection
uniFiAP Error getMessages: (1) error connecting to ip#: 192.168.1.76 wrong ip/ password or system down or ssh timed out or ..?

Jan 7, 2020 at 11:05:05 AM
uniFiAP Error getMessages: (1) error connecting to ip#: 192.168.1.15 wrong ip/ password or system down or ssh timed out or ..?
uniFiAP Error getMessages: (1) error connecting to ip#: 192.168.1.16 wrong ip/ password or system down or ssh timed out or ..?
uniFiAP Error getMessages: (1) error connecting to ip#: 192.168.1.15 wrong ip/ password or system down or ssh timed out or ..?
uniFiAP Error getMessages: (1) error connecting to ip#: 192.168.1.76 wrong ip/ password or system down or ssh timed out or ..?
uniFiAP Error getMessages: (1) error connecting to ip#: 192.168.1.16 wrong ip/ password or system down or ssh timed out or ..?
uniFiAP Error getMessages: (1) error connecting to ip#: 192.168.1.76 wrong ip/ password or system down or ssh timed out or ..?

Jan 7, 2020 at 11:05:31 AM
uniFiAP Error getMessages: (1) error connecting to ip#: 192.168.1.15 wrong ip/ password or system down or ssh timed out or ..?
uniFiAP Error getMessages: (1) error connecting to ip#: 192.168.1.16 wrong ip/ password or system down or ssh timed out or ..?
uniFiAP Error getMessages: (1) error connecting to ip#: 192.168.1.15 wrong ip/ password or system down or ssh timed out or ..?
uniFiAP Error getMessages: (1) error connecting to ip#: 192.168.1.16 wrong ip/ password or system down or ssh timed out or ..?
uniFiAP Error getMessages: (1) error connecting to ip#: 192.168.1.76 wrong ip/ password or system down or ssh timed out or ..?
uniFiAP Error getMessages: (1) error connecting to ip#: 192.168.1.76 wrong ip/ password or system down or ssh timed out or ..?

Jan 7, 2020 at 11:05:56 AM
uniFiAP Error getMessages: (1) error connecting to ip#: 192.168.1.15 wrong ip/ password or system down or ssh timed out or ..?
uniFiAP Error getMessages: (1) error connecting to ip#: 192.168.1.16 wrong ip/ password or system down or ssh timed out or ..?
uniFiAP Error getMessages: (1) error connecting to ip#: 192.168.1.16 wrong ip/ password or system down or ssh timed out or ..?
uniFiAP Error getMessages: (1) error connecting to ip#: 192.168.1.15 wrong ip/ password or system down or ssh timed out or ..?
uniFiAP Error getMessages: (1) error connecting to ip#: 192.168.1.76 wrong ip/ password or system down or ssh timed out or ..?
uniFiAP Error getMessages: (1) error connecting to ip#: 192.168.1.76 wrong ip/ password or system down or ssh timed out or ..?

Jan 7, 2020 at 11:06:22 AM
uniFiAP Error getMessages: (1) error connecting to ip#: 192.168.1.15 wrong ip/ password or system down or ssh timed out or ..?
uniFiAP Error getMessages: (1) error connecting to ip#: 192.168.1.16 wrong ip/ password or system down or ssh timed out or ..?
uniFiAP Error getMessages: (1) error connecting to ip#: 192.168.1.16 wrong ip/ password or system down or ssh timed out or ..?
uniFiAP Error getMessages: (1) error connecting to ip#: 192.168.1.76 wrong ip/ password or system down or ssh timed out or ..?
uniFiAP Error getMessages: (1) error connecting to ip#: 192.168.1.15 wrong ip/ password or system down or ssh timed out or ..?
uniFiAP Error getMessages: (1) error connecting to ip#: 192.168.1.76 wrong ip/ password or system down or ssh timed out or ..?

Posted on
Tue Jan 07, 2020 11:34 am
kw123 offline
User avatar
Posts: 6903
Joined: May 12, 2013
Location: Dallas, TX

uniFi plugin setup help!

Dumb question:
Are the userid... ip numbers correct?

And check the plugin.log file

Karl


Sent from my iPhone using Tapatalk

Posted on
Tue Jan 07, 2020 2:23 pm
Different Computers offline
User avatar
Posts: 1970
Joined: Jan 02, 2016
Location: East Coast

Re: uniFi plugin setup help!

The "duh" moment for me when I had similar errors is that the plugin needs to point at the *device running the controller software* not the actual Unifi hardware's IP address.

Also the controller software must be running on the device.

SmartThings refugee, so happy to be on Indigo. 10.13.6 on an i5 MBP w/Harmony Hub, Hue, DomoPad, Dynamic URL, Device Extensions, HomeKit Bridge, MatplotLib, Plex, uniFAP, Wunderground, Nanoleaf, LED Simple Effects, Airfoil Pro, Grafana.

Posted on
Tue Jan 07, 2020 3:12 pm
kw123 offline
User avatar
Posts: 6903
Joined: May 12, 2013
Location: Dallas, TX

Re: uniFi plugin setup help!

Well, actually all
Of them.
It connects to the controller and the switches and access points and gateway


Sent from my iPhone using Tapatalk

Posted on
Tue Jan 07, 2020 3:45 pm
bbbullock offline
Posts: 25
Joined: Sep 11, 2008

Re: uniFi plugin setup help!

Ok...so I got many (most?) of the errors eliminated. There was an issue with login credentials for the UniFi Controller...now corrected.

I'm still though getting this error in the Indigo Event Log:

Jan 7, 2020 at 3:36:25 PM
uniFiAP Error UNIFI executeCMDOnController error: (wrong UID/passwd, ip number?) ...>>{"meta":{"rc":"error","msg":"api.err.Invalid"},"data":[]}<<
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed

0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 47 0 0 100 47 0 225 --:--:-- --:--:-- --:--:-- 224
100 104 100 57 100 47 64 52 --:--:-- --:--:-- --:--:-- 116

I'm not clear on what UID/Passwd, ip number it might be referring to? Does "Controller" = "Cloud Key"? Or does Controller refer to the USG? I've tried the credentials for both, but no success.

Posted on
Tue Jan 07, 2020 4:06 pm
kw123 offline
User avatar
Posts: 6903
Joined: May 12, 2013
Location: Dallas, TX

uniFi plugin setup help!

The controller connection seems to have some issues. You only need that for reports and auto discovery. You can switch if off. All client info is coming from the switches and ap

The controller is the box where you login with chrome to see the UniFi info

Either software install on mac or the UniFi stick

Sent from my iPhone using Tapatalk

Posted on
Tue Jan 07, 2020 6:04 pm
kw123 offline
User avatar
Posts: 6903
Joined: May 12, 2013
Location: Dallas, TX

Re: uniFi plugin setup help!

just for completeness: here my config
Screen Shot 2020-01-07 at 17.49.57.png
Screen Shot 2020-01-07 at 17.49.57.png (192.85 KiB) Viewed 377 times

Screen Shot 2020-01-07 at 17.50.16.png
Screen Shot 2020-01-07 at 17.50.16.png (154.31 KiB) Viewed 377 times


the controller is the software that collects the info from all unifi devices. it can run on various systems. I had it on
MAC
raspberry
unifi cloud key v 1
unifi cloud key v 2
they all work fine

the userid / password are the same as you use to login to the web page with chrome, to set eg WiFI config etc.
normally: 192.168.x.x:8443

The plugin uses http access to the controller software to query the DB for
1. new devices
2. reports
== details for each Unifi device and details for clients
== reports for controller access, logs/ warnings, web traffic ...

the controller part is not required for 90% of the plugin functionality, all normal client functions (presences, wifi info ..., dhcp) is gathered directly from the unify devices
- gateway
- switches
- APs

Karl

Posted on
Thu Apr 02, 2020 11:08 am
Different Computers offline
User avatar
Posts: 1970
Joined: Jan 02, 2016
Location: East Coast

Re: uniFi plugin setup help!

Hello and let me introduce myself as someone who is much dumber than I thought I was.

Been using this plugin for years now, and when I recently moved from a USG plus local Mac based controller and Unifi AP to a UDM + the same AP, I didn't notice how much I needed to change.

So maybe I'm way behind on getting things working, because for months the partial info I was getting from my AP, which has always been configured correctly, made it seem like the whole system was working.

So now I have some really basic questions about the "Configure uniFAP" window:

in == Controller info are we talking about the UDM's built in cloud key here? so I use the UDM's IP address? And the user name/pwd is the same as if I was logging in to the controller web interface, correct?

For "controller Type: I've chosen UDM but what does "use switch #12 and AP#4" mean?

for the unifi API Web Page value, do I use /api/s or the other option "for UDM-xx"?

for unifi Api Login Path do I use the one for UDM-xx? I have a UDM, not UDM-pro.

SmartThings refugee, so happy to be on Indigo. 10.13.6 on an i5 MBP w/Harmony Hub, Hue, DomoPad, Dynamic URL, Device Extensions, HomeKit Bridge, MatplotLib, Plex, uniFAP, Wunderground, Nanoleaf, LED Simple Effects, Airfoil Pro, Grafana.

Posted on
Thu Apr 02, 2020 11:17 am
kw123 offline
User avatar
Posts: 6903
Joined: May 12, 2013
Location: Dallas, TX

Re: uniFi plugin setup help!

we got the pro to work, the regular UDM not yet... lack of testing time. we should have enough of that now

the UDM(proP) is also a switch+... , so the controller + GW + switch+AP have the same IP number. I am using switch >>#12 and AP#4 << as the setting for UDM controller+AP+SW+GW to not run the same thing several times AND the program checks if the ssh session to the IP# is already running before starting , if so cancel it.
That naturally does not work if they all have the same IP#

If the users and passwords are different for
1. ssh username@box
2. http://ip#
you need different ones in config, if the same use the same for both

if you like we can do an online session and I can get the UDM to work - hopefully.

Karl

Posted on
Thu Apr 02, 2020 11:31 am
Different Computers offline
User avatar
Posts: 1970
Joined: Jan 02, 2016
Location: East Coast

Re: uniFi plugin setup help!

Thanks Karl!


I'm not following here.
kw123 wrote:
If the users and passwords are different for
1. ssh username@box
2. http://ip#
you need different ones in config, if the same use the same for bothl


Does "box" mean the UDM or some computer that should be running controller software?

Is 2 the address of the UDM cloud key web address?

Here's my understanding of my network, so maybe that would help.

SSH into the UDM is root + THEuniquePASSWORD

web login to the Controller software is THEUNIFIUSERNAME + the very same THEuniquePASSWORD as above

So far, no combination of root/THEUNIFIUSERNAME and THEuniquePASSWORD is getting the plugin to not error out.

SSH into my AP is ANOTHERUSERNAME and PASSWORD2 and that is working just fine.

SmartThings refugee, so happy to be on Indigo. 10.13.6 on an i5 MBP w/Harmony Hub, Hue, DomoPad, Dynamic URL, Device Extensions, HomeKit Bridge, MatplotLib, Plex, uniFAP, Wunderground, Nanoleaf, LED Simple Effects, Airfoil Pro, Grafana.

Posted on
Thu Apr 02, 2020 11:44 am
kw123 offline
User avatar
Posts: 6903
Joined: May 12, 2013
Location: Dallas, TX

Re: uniFi plugin setup help!

sorry for my sloppy language..

userid forcontroller is for >> http:ip#:port/page<<
userid for system devices is for >> ssh userid@ip#<<

box = ip# same for UDM,AP,SW,GW for you

so lets gets started.
set debug on for "connection"

then in plugin.log you should see how the plugin connects to the devices.

looks like your "curl" does not work

you need to find 2 lines with :
#1. ... --insecure -c /tmp/unifiCookie ..
#2. .. --insecure -b /tmp/unifiCookie ...

The first one creates a token on your MAC to be used in #2 ( -c and -d )

then open a terminal
run #1
then #2

check output

Karl

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 0 guests