Page 1 of 1

miniUniFi Plugin Q&A

PostPosted: Fri Oct 30, 2020 11:07 am
by FlyingDiver
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

Re: miniUniFi Plugin Q&A

PostPosted: Sat Oct 31, 2020 10:45 am
by WagnerOne
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.

Re: miniUniFi Plugin Q&A

PostPosted: Sat Oct 31, 2020 11:10 am
by FlyingDiver
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.

Re: miniUniFi Plugin Q&A

PostPosted: Sat Oct 31, 2020 11:42 am
by FlyingDiver
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?

Re: miniUniFi Plugin Q&A

PostPosted: Sun Nov 01, 2020 8:42 pm
by WagnerOne
Thanks.

I opened a Github issue.

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

Mike

Re: miniUniFi Plugin Q&A

PostPosted: Sat Jan 23, 2021 10:27 pm
by kw123
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.

Re: miniUniFi Plugin Q&A

PostPosted: Sat Jan 23, 2021 10:29 pm
by FlyingDiver
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?

Re: miniUniFi Plugin Q&A

PostPosted: Sun Jan 24, 2021 12:16 am
by kw123
no i misread the "else" as a part of an if, but it is part of the try:/except/else.. your code is correct