miniUniFi Plugin Q&A

Posted on
Fri Oct 30, 2020 11:07 am
FlyingDiver offline
User avatar
Posts: 5411
Joined: Jun 07, 2014
Location: Southwest Florida, USA

miniUniFi Plugin Q&A

Use this thread for Q&A on the plugin. But reports and Feature requests should be submitted via GitHub:https://github.com/FlyingDiver/Indigo-miniUniFi/issues

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Sat Oct 31, 2020 10:45 am
WagnerOne offline
Posts: 124
Joined: Jun 12, 2009
Location: Chicago, IL

Re: miniUniFi Plugin Q&A

Hi Joe,

Thanks for this. Is it possible to use 2FA with the plugin? I think that is maybe why the plug-in can't talk to my controller, which is a UDM w/ 2FA enabled.

Posted on
Sat Oct 31, 2020 11:10 am
FlyingDiver offline
User avatar
Posts: 5411
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: miniUniFi Plugin Q&A

There's no support for 2FA in the plugin now. I didn't even know that was an option with the UDM (I don't have one).

I can't find any reference to 2FA in any of the client implementations I based the plugin on. Also, I'm seeing comments about the UDM requiring a new 2FA token daily, which would be very inconvenient for a plugin. So don't plan on using the plugin if you have 2FA enabled.

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Sat Oct 31, 2020 11:42 am
FlyingDiver offline
User avatar
Posts: 5411
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: miniUniFi Plugin Q&A

Just for grins, I'd like to see the error you get back when you try to log in without the 2FA code. Can you turn on debug logging and put the output in a GitHub issue (see above)?

Is it an authenticator based 2FA (automatically updates the code very 30 seconds) or does the server send a code via SMS or email?

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Sun Nov 01, 2020 8:42 pm
WagnerOne offline
Posts: 124
Joined: Jun 12, 2009
Location: Chicago, IL

Re: miniUniFi Plugin Q&A

Thanks.

I opened a Github issue.

It's using authenticator, 30 second style 2FA.

Mike

Posted on
Sat Jan 23, 2021 10:27 pm
kw123 offline
User avatar
Posts: 7731
Joined: May 12, 2013
Location: Dallas, TX

Re: miniUniFi Plugin Q&A

Looking at your code:
Code: Select all
lines 262+++
            try:
                version = response.json()['meta']['server_version']
            except:
                pass
            else:
                newProps = device.pluginProps
                newProps['version'] = version
                device.replacePluginPropsOnServer(newProps)

"version" is not defined in case there is an exception
and "version" is not present when connecting to unifi cloud key controller V6.
https://192.168.1.2:443/proxy/network/status
returns:
<Response [200]> - {"meta":{"rc":"ok","uuid":"xxxxxxx-xxxxx-xxxxxxxx"},"data":[]}
no "version" in the dict.

Karl

ps really nicely written code.

Posted on
Sat Jan 23, 2021 10:29 pm
FlyingDiver offline
User avatar
Posts: 5411
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: miniUniFi Plugin Q&A

If there's an exception, the else clause is not executed at all.

And you meant there's no "server_version" key in the dict, right?

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Sun Jan 24, 2021 12:16 am
kw123 offline
User avatar
Posts: 7731
Joined: May 12, 2013
Location: Dallas, TX

Re: miniUniFi Plugin Q&A

no i misread the "else" as a part of an if, but it is part of the try:/except/else.. your code is correct

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 1 guest