mnederlof / com.ubnt.unifi

Ubiquiti Unifi Controller integration for Homey
11 stars 10 forks source link

[Feature Request] - Support UDM Pro controler #50

Open eilko opened 4 years ago

eilko commented 4 years ago

The new Unifi UDM Pro has its own controler. I have created a new user on the UDM pro and gave it access to the network controler. But it seems that something has changed. The url of the clients list is a bit different from https://IP/network/site/default/clients/1/50 the normal controler.

The app in homey gives the following debug info:

12-2-2020 17:40:26 : [debug] Connection success! 12-2-2020 17:40:26 : [debug] Updating status to Disconnected 12-2-2020 17:40:26 : [debug] TypeError: Cannot read property 'forEach' of undefined 12-2-2020 17:40:25 : [debug] Error while fetching usergroup list 12-2-2020 17:40:25 : [debug] Updating status to Disconnected 12-2-2020 17:40:25 : [debug] TypeError: Cannot read property 'forEach' of undefined 12-2-2020 17:40:25 : [debug] Error while fetching ap list 12-2-2020 17:40:25 : [debug] Accesspoints received 12-2-2020 17:40:25 : [debug] Updating status to Disconnected 12-2-2020 17:40:25 : [debug] TypeError: Cannot read property 'forEach' of undefined 12-2-2020 17:40:25 : [debug] Error while fetching client list: 12-2-2020 17:40:25 : [debug] Fetching user group list 12-2-2020 17:40:24 : [debug] Updating status to Connected

Let me know what more info you need to debug this issue to support this type of Unifi controler.

mnederlof commented 4 years ago

You could try to figure out what url's are called by the browser. Try to use steps from this page: https://community.ui.com/questions/How-can-I-know-all-uris-and-commands-of-the-UniFi-API/163765cb-a744-489a-993b-52df015a4a4f

eilko commented 4 years ago

Could you do something with the following api client? https://github.com/Art-of-WiFi/UniFi-API-client It already support UnifiOS (UDM/UDM PRO).

If I understand the code correctly only the authorisation url has changed. See https://github.com/Art-of-WiFi/UniFi-API-client/blob/master/src/Client.php

grotting commented 4 years ago

Has there been any progress with this issue? I installed my udm pro yesterday and now my favorite homey app is broken.

eilko commented 4 years ago

Will this help?

https://github.com/Art-of-WiFi/UniFi-API-client/commit/961d692125cb9a0889c6a536e0bd60b19047be6b

steffjenl commented 4 years ago

Hello,

I have created an app for the Unifi Protect App. The newest version has also support for UDM PRO.

You can see the source at https://github.com/steffjenl/com.ubnt.unifiprotect

There is also an docker container to use older packages only this works only for protect app: https://hub.docker.com/r/silvenga/unifi-udm-api-proxy

eijlers commented 4 years ago

There is also a UniFi Protect app supporting the dream machine. Search for UniFi in the Homey App Store.

steffjenl commented 4 years ago

There is also a UniFi Protect app supporting the dream machine. Search for UniFi in the Homey App Store.

That’s me! Source code is the same in the store!

Allram commented 4 years ago

Hope you can find the time to take a look at this, just tell me what information you need and i will try to bring it :)

grotting commented 4 years ago

Disappointing that you can't be bothered to fix this problem, despite that @steffjenl provided the info how to do it three months ago.

bergh-io commented 4 years ago

I would also love if you could implement this. I have a UDM, not pro, but i guess it works the same.

klim123123 commented 4 years ago

Please fix.

Veldkornet commented 3 years ago

FYI, the CloudKey Gen2’s are now also moving over to UniFiOS, and hence are now also hitting this problem.

MrBlue90 commented 3 years ago

Hitting the same issue with my recently purchased UDMP. Anything where we can assist to solve this issue? Thanks for looking into this!

joalmiza commented 3 years ago

Hi! Yes, please let us know if we can do anything to help out to make some progress in the development of this feature.

josefzahner commented 3 years ago

Due to the lack of support I'm not gonna buy the UDM Pro, as I would loose my presence detection... so I'm still using the UniFi Controller within Docker on my NAS. Hopefully @mnederlof finds the time to change the implementation based on the findings within this ticket. Cheers Josef

willumpie82 commented 3 years ago

Please note that the 2.x update for the cloudkey ck2(plus) introduces unifi OS to this device as well and will break the support for this version of the app.

@josefzahner, I switched to a different precence detection app that uses the Ip address of a device, set it to fixed in the unifi controller and modify your flows to accomodate for the different app. and enjoy the same-ish functionality

MrBlue90 commented 3 years ago

With all due respect for @mnederlof, but after not updating the app for nearly a year with major issues and not replying here on Github, I don't believe there will be a new update in the future. Hoping that @mnederlof will be able to at least confirm that statement so we can move on with it.

In the meantime.. @steffjenl Considering you've created the other Unifi apps and clearly knows what's missing of needs to be modified in this app; is there any chance you could fork this repo and publish an update? I believe many users, including myself, would really appreciate that.

Thanks!

mnederlof commented 3 years ago

You are correct, you should not expect any update any time soon.

Also, I cannot troubleshoot the udm pro as I do not have that installed. I have no problems with transferring or removing the app from homey, if someone wants to pick up development for this app.

MrBlue90 commented 3 years ago

Thanks @mnederlof for letting us know! And really appreciate the work you did in the past, but in that case I believe it's important to find a successor for the app development. Unfortunately I don't have the right skills to do so, so hope @steffjenl or someone else is willing to take it from here.

steffjenl commented 3 years ago

@mnederlof can you contact me at stephan@monkeysoft.nl? so i can pick up the development off this project? Thank you for your time!

mnederlof commented 3 years ago

This app has been transferred to @steffjenl, so he will do any updates in the future.

steffjenl commented 3 years ago

Thank you @mnederlof, i will release soon an new version with support for UniFi OS.

steffjenl commented 3 years ago

https://homey.app/nl-nl/app/com.ubnt.unifi/Ubiquiti-UniFi-Network/test/

First test version with UniFiOS support

Veldkornet commented 3 years ago

Should we continue here then or make a new issue in the new repo?

I'm getting the below with the new test version.

25/01/2021, 17:29:51 : [debug] Updating status to Disconnected
25/01/2021, 17:29:51 : [debug] TypeError: Cannot read property 'forEach' of undefined
25/01/2021, 17:29:51 : [debug] Error while fetching client list:
25/01/2021, 17:29:51 : [debug] Updating status to Connected
25/01/2021, 17:29:51 : [debug] Connection success!
25/01/2021, 17:29:51 : [debug] Updating status to Disconnected
25/01/2021, 17:29:51 : [debug] TypeError: Cannot read property 'forEach' of undefined
25/01/2021, 17:29:51 : [debug] Error while fetching client list:
25/01/2021, 17:29:51 : [debug] Updating status to Disconnected
25/01/2021, 17:29:51 : [debug] TypeError: Cannot read property 'forEach' of undefined
25/01/2021, 17:29:51 : [debug] Error while fetching usergroup list
25/01/2021, 17:29:51 : [debug] Updating status to Disconnected
25/01/2021, 17:29:50 : [debug] TypeError: Cannot read property 'forEach' of undefined
25/01/2021, 17:29:50 : [debug] Error while fetching ap list
25/01/2021, 17:29:50 : [debug] Accesspoints received
25/01/2021, 17:29:50 : [debug] Fetching user group list
25/01/2021, 17:29:50 : [debug] Updating status to Connected
25/01/2021, 17:29:50 : [debug] Connection success!
25/01/2021, 17:29:50 : [debug] Updating status to Disconnected
25/01/2021, 17:29:50 : [debug] TypeError: Cannot read property 'forEach' of undefined
25/01/2021, 17:29:50 : [debug] Error while fetching client list:
25/01/2021, 17:29:50 : [debug] Updating status to Disconnected
25/01/2021, 17:29:50 : [debug] TypeError: Cannot read property 'forEach' of undefined
25/01/2021, 17:29:50 : [debug] Error while fetching usergroup list
25/01/2021, 17:29:50 : [debug] Updating status to Disconnected
25/01/2021, 17:29:50 : [debug] TypeError: Cannot read property 'forEach' of undefined
25/01/2021, 17:29:49 : [debug] Error while fetching client list:
25/01/2021, 17:29:49 : [debug] Updating status to Disconnected
25/01/2021, 17:29:49 : [debug] TypeError: Cannot read property 'forEach' of undefined
25/01/2021, 17:29:49 : [debug] Error while fetching ap list
25/01/2021, 17:29:49 : [debug] Accesspoints received
25/01/2021, 17:29:49 : [debug] Updating status to Disconnected
25/01/2021, 17:29:49 : [debug] TypeError: Cannot read property 'forEach' of undefined
25/01/2021, 17:29:49 : [debug] Error while fetching client list:
25/01/2021, 17:29:49 : [debug] Updating status to Connected
25/01/2021, 17:29:49 : [debug] Connection success!
25/01/2021, 17:29:49 : [debug] Fetching user group list
25/01/2021, 17:29:49 : [debug] Updating status to Connected
25/01/2021, 17:29:49 : [debug] Connection success!
25/01/2021, 17:29:48 : [debug] Updating status to Connected
25/01/2021, 17:29:48 : [debug] Connection success!
25/01/2021, 17:29:48 : [debug] Updating unifi connection params.
25/01/2021, 17:29:48 : [debug] Updating status to Connecting
25/01/2021, 17:29:48 : [debug] Connecting to unifi controller 192.168.144.10
25/01/2021, 17:29:48 : [debug] Updating status to Disconnected
25/01/2021, 17:29:48 : [debug] TypeError: Cannot read property 'forEach' of undefined
25/01/2021, 17:29:48 : [debug] Error while fetching usergroup list
25/01/2021, 17:29:48 : [debug] Updating status to Disconnected
25/01/2021, 17:29:48 : [debug] TypeError: Cannot read property 'forEach' of undefined
25/01/2021, 17:29:48 : [debug] Error while fetching client list:
25/01/2021, 17:29:48 : [debug] Updating unifi connection params.
25/01/2021, 17:29:47 : [debug] Updating status to Connecting
25/01/2021, 17:29:47 : [debug] Connecting to unifi controller 192.168.144.10
25/01/2021, 17:29:47 : [debug] Updating status to Disconnected
25/01/2021, 17:29:47 : [debug] TypeError: Cannot read property 'forEach' of undefined
25/01/2021, 17:29:47 : [debug] Error while fetching ap list
25/01/2021, 17:29:47 : [debug] Accesspoints received
25/01/2021, 17:29:47 : [debug] Fetching user group list
25/01/2021, 17:29:47 : [debug] Updating status to Connected
25/01/2021, 17:29:47 : [debug] Connection success!
25/01/2021, 17:29:47 : [debug] Updating status to Disconnected
25/01/2021, 17:29:47 : [debug] TypeError: Cannot read property 'forEach' of undefined
25/01/2021, 17:29:47 : [debug] Error while fetching client list:
25/01/2021, 17:29:46 : [debug] Updating status to Connected
25/01/2021, 17:29:46 : [debug] Connection success!
25/01/2021, 17:29:46 : [debug] Updating status to Disconnected
25/01/2021, 17:29:46 : [debug] TypeError: Cannot read property 'forEach' of undefined
25/01/2021, 17:29:46 : [debug] Error while fetching usergroup list
25/01/2021, 17:29:46 : [debug] Updating status to Disconnected
25/01/2021, 17:29:46 : [debug] TypeError: Cannot read property 'forEach' of undefined
25/01/2021, 17:29:46 : [debug] Error while fetching client list:
25/01/2021, 17:29:46 : [debug] Updating status to Disconnected
25/01/2021, 17:29:46 : [debug] TypeError: Cannot read property 'forEach' of undefined
25/01/2021, 17:29:46 : [debug] Error while fetching ap list
25/01/2021, 17:29:46 : [debug] Accesspoints received
25/01/2021, 17:29:46 : [debug] Fetching user group list
25/01/2021, 17:29:45 : [debug] Updating status to Connected
25/01/2021, 17:29:45 : [debug] Connection success!
25/01/2021, 17:29:45 : [debug] Updating status to Disconnected
25/01/2021, 17:29:45 : [debug] TypeError: Cannot read property 'forEach' of undefined
25/01/2021, 17:29:45 : [debug] Error while fetching client list:
25/01/2021, 17:29:45 : [debug] Updating status to Connected
25/01/2021, 17:29:45 : [debug] Connection success!
25/01/2021, 17:29:45 : [debug] Updating status to Disconnected
25/01/2021, 17:29:45 : [debug] TypeError: Cannot read property 'forEach' of undefined
25/01/2021, 17:29:45 : [debug] Error while fetching usergroup list
25/01/2021, 17:29:45 : [debug] Updating status to Disconnected
25/01/2021, 17:29:45 : [debug] TypeError: Cannot read property 'forEach' of undefined
25/01/2021, 17:29:44 : [debug] Error while fetching client list:
25/01/2021, 17:29:44 : [debug] Updating status to Disconnected
25/01/2021, 17:29:44 : [debug] TypeError: Cannot read property 'forEach' of undefined
25/01/2021, 17:29:44 : [debug] Error while fetching ap list
25/01/2021, 17:29:44 : [debug] Accesspoints received
25/01/2021, 17:29:44 : [debug] Fetching user group list
25/01/2021, 17:29:44 : [debug] Updating status to Connected
25/01/2021, 17:29:44 : [debug] Connection success!
25/01/2021, 17:29:43 : [debug] Updating status to Disconnected
25/01/2021, 17:29:43 : [debug] TypeError: Cannot read property 'forEach' of undefined
25/01/2021, 17:29:43 : [debug] Error while fetching client list:
25/01/2021, 17:29:43 : [debug] Updating status to Connected
Messages will come in automatically...
steffjenl commented 3 years ago

@Veldkornet please make an new issue on my project (fork). Please change the setting that you use UnifiOS and enter port 443.

image