Python plugin: Ubiquiti Unifi Presence

Python and python framework

Moderator: leecollings

mcmikev
Posts: 146
Joined: Tuesday 26 May 2015 8:11
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: right here
Contact:

Re: Python plugin: Ubiquiti Unifi Presence

Post by mcmikev »

Hi Wizzard,

I seem to have an issue since an update of the controller (not 100% sure that it is the cause).

I have a beta version running on my UDM Pro (controller version 1.10.11) and domoticz is version 2021.1 (build 13260) Build Hash: 47d5c3ddc

That last few days the plugin is unable to connect and starts retrying. This just fails every time. But when I stop and start the plugin it works again for some time and then again the plugin is unable to connect (404 error) and stopping starting fixes it again.

I run the latest version of the plugin.
As a temp workaround I have set the hardware timeout on 5 minutes now in the hardware page so that the plugin get restarted that way but that is not the way to go.

Do you have any idea what could cause this behavior all of a sudden?

Update: Added some logging to this message

Code: Select all

 2021-05-24 15:50:48.270 Unifi: (Unifi) UpdateDevice: Update 46:'46.0' (Unifi - UDMPRO Memory)
2021-05-24 15:50:48.304 Unifi: (Unifi) UpdateDevice: Update 40:'40.25' (Unifi - UDMPRO PHY Board)
2021-05-24 15:50:48.346 Unifi: (Unifi) UpdateDevice: Update 3:'3.3' (Unifi - Woonkamer CPU)
2021-05-24 15:50:53.291 Unifi: (Unifi) UpdateDevice: Update 20:'20.2' (Unifi - UDMPRO CPU Usage)
2021-05-24 15:50:53.323 Unifi: (Unifi) UpdateDevice: Update 43:'43.0' (Unifi - UDMPRO CPU Usage)
2021-05-24 15:50:58.226 Unifi: (Unifi) UpdateDevice: Update 20:'20.2' (Unifi - UDMPRO CPU Usage)
2021-05-24 15:50:58.260 Unifi: (Unifi) UpdateDevice: Update 43:'43.0' (Unifi - UDMPRO CPU Usage)
2021-05-24 15:51:03.349 Unifi: (Unifi) UpdateDevice: Update 20:'20.2' (Unifi - UDMPRO CPU Usage)
2021-05-24 15:51:03.382 Unifi: (Unifi) UpdateDevice: Update 43:'43.0' (Unifi - UDMPRO CPU Usage)
2021-05-24 15:51:08.232 Unifi: (Unifi) UpdateDevice: Update 20:'20.2' (Unifi - UDMPRO CPU Usage)
2021-05-24 15:51:08.753 Unifi: (Unifi) UpdateDevice: Update 43:'43.0' (Unifi - UDMPRO CPU Usage)
2021-05-24 15:51:13.262 Unifi: (Unifi) UpdateDevice: Update 20:'20.2' (Unifi - UDMPRO CPU Usage)
2021-05-24 15:51:13.295 Unifi: (Unifi) UpdateDevice: Update 43:'43.0' (Unifi - UDMPRO CPU Usage)
2021-05-24 15:51:13.313 Unifi: (Unifi) UpdateDevice: Update 3:'3.2' (Unifi - Gang-1ste CPU)
2021-05-24 15:51:18.236 Unifi: (Unifi) UpdateDevice: Update 20:'20.2' (Unifi - UDMPRO CPU Usage)
2021-05-24 15:51:18.269 Unifi: (Unifi) UpdateDevice: Update 43:'43.0' (Unifi - UDMPRO CPU Usage)
2021-05-24 15:51:23.291 Unifi: (Unifi) UpdateDevice: Update 20:'20.2' (Unifi - UDMPRO CPU Usage)
2021-05-24 15:51:23.313 Unifi: (Unifi) UpdateDevice: Update 43:'43.0' (Unifi - UDMPRO CPU Usage)
2021-05-24 15:51:28.231 Unifi: (Unifi) UpdateDevice: Update 19:'19.3' (Unifi - UDMPRO CPU Usage)
2021-05-24 15:51:28.263 Unifi: (Unifi) UpdateDevice: Update 43:'43.0' (Unifi - UDMPRO CPU Usage)
2021-05-24 15:51:28.278 Unifi: (Unifi) UpdateDevice: Update 45:'45.9' (Unifi - UDMPRO Memory)
2021-05-24 15:51:33.223 Unifi: (Unifi) UpdateDevice: Update 19:'19.3' (Unifi - UDMPRO CPU Usage)
2021-05-24 15:51:33.777 Unifi: (Unifi) UpdateDevice: Update 43:'43.0' (Unifi - UDMPRO CPU Usage)
2021-05-24 15:51:38.233 Unifi: (Unifi) UpdateDevice: Update 19:'19.3' (Unifi - UDMPRO CPU Usage)
2021-05-24 15:51:38.267 Unifi: (Unifi) UpdateDevice: Update 43:'43.0' (Unifi - UDMPRO CPU Usage)
2021-05-24 15:51:43.277 Unifi: (Unifi) UpdateDevice: Update 19:'19.3' (Unifi - UDMPRO CPU Usage)
2021-05-24 15:51:43.296 Unifi: (Unifi) UpdateDevice: Update 43:'43.0' (Unifi - UDMPRO CPU Usage)
2021-05-24 15:51:48.252 Unifi: (Unifi) UpdateDevice: Update 19:'19.3' (Unifi - UDMPRO CPU Usage)
2021-05-24 15:51:48.271 Unifi: (Unifi) UpdateDevice: Update 43:'43.0' (Unifi - UDMPRO CPU Usage)
2021-05-24 15:51:53.212 Unifi: (Unifi) UpdateDevice: Update 3:'3.5' (Unifi - Slaapkamer4 CPU)
2021-05-24 15:51:53.245 Unifi: (Unifi) UpdateDevice: Update 19:'19.3' (Unifi - UDMPRO CPU Usage)
2021-05-24 15:51:53.259 Unifi: (Unifi) UpdateDevice: Update 43:'43.0' (Unifi - UDMPRO CPU Usage)
2021-05-24 15:51:58.223 Unifi: (Unifi) UpdateDevice: Update 19:'19.3' (Unifi - UDMPRO CPU Usage)
2021-05-24 15:51:58.256 Unifi: (Unifi) UpdateDevice: Update 43:'43.0' (Unifi - UDMPRO CPU Usage)
2021-05-24 15:52:03.270 Unifi: (Unifi) UpdateDevice: Update 19:'19.3' (Unifi - UDMPRO CPU Usage)
2021-05-24 15:52:03.299 Unifi: (Unifi) UpdateDevice: Update 43:'43.0' (Unifi - UDMPRO CPU Usage)
2021-05-24 15:52:03.316 Unifi: (Unifi) UpdateDevice: Update 40:'40.5' (Unifi - UDMPRO PHY Board)
2021-05-24 15:52:03.356 Unifi: (Unifi) UpdateDevice: Update 3:'3.9' (Unifi - Woonkamer CPU)
2021-05-24 15:52:08.243 Unifi: (Unifi) UpdateDevice: Update 19:'19.3' (Unifi - UDMPRO CPU Usage)
2021-05-24 15:52:08.274 Unifi: (Unifi) UpdateDevice: Update 43:'43.0' (Unifi - UDMPRO CPU Usage)
2021-05-24 15:52:13.278 Unifi: (Unifi) UpdateDevice: Update 19:'19.3' (Unifi - UDMPRO CPU Usage)
2021-05-24 15:52:13.309 Unifi: (Unifi) UpdateDevice: Update 43:'43.0' (Unifi - UDMPRO CPU Usage)
2021-05-24 15:52:23.248 Unifi: (Unifi) UpdateDevice: Update 19:'19.3' (Unifi - UDMPRO CPU Usage)
2021-05-24 15:52:23.280 Unifi: (Unifi) UpdateDevice: Update 43:'43.0' (Unifi - UDMPRO CPU Usage)
2021-05-24 15:52:23.303 Unifi: (Unifi) UpdateDevice: Update 32:'32.0' (Unifi - SW-16-150W Memory)
2021-05-24 15:52:28.270 Unifi: (Unifi) UpdateDevice: Update 19:'19.3' (Unifi - UDMPRO CPU Usage)
2021-05-24 15:52:28.286 Unifi: (Unifi) UpdateDevice: Update 43:'43.0' (Unifi - UDMPRO CPU Usage)
2021-05-24 15:52:28.305 Unifi: (Unifi) UpdateDevice: Update 3:'3.5' (Unifi - Gang-1ste CPU)
2021-05-24 15:52:33.117 Unifi: (Unifi) request_details: Invalid login, or login has expired
2021-05-24 15:52:33.135 Unifi: (Unifi) login: First attempt failed to login to the Dream Machine Pro with errorcode 404
2021-05-24 15:52:38.162 Unifi: (Unifi) onHeartbeat: Attempting to reconnect Unifi Controller
2021-05-24 15:52:43.100 Unifi: (Unifi) onHeartbeat: Attempting to reconnect Unifi Controller
2021-05-24 15:52:48.085 Unifi: (Unifi) onHeartbeat: Attempting to reconnect Unifi Controller
2021-05-24 15:52:53.075 Unifi: (Unifi) onHeartbeat: Attempting to reconnect Unifi Controller
2021-05-24 15:52:58.053 Unifi: (Unifi) onHeartbeat: Attempting to reconnect Unifi Controller
2021-05-24 15:53:03.092 Unifi: (Unifi) onHeartbeat: Attempting to reconnect Unifi Controller
2021-05-24 15:53:08.091 Unifi: (Unifi) onHeartbeat: Attempting to reconnect Unifi Controller
2021-05-24 15:53:13.068 Unifi: (Unifi) onHeartbeat: Attempting to reconnect Unifi Controller
2021-05-24 15:53:18.092 Unifi: (Unifi) onHeartbeat: Attempting to reconnect Unifi Controller
2021-05-24 15:53:23.056 Unifi: (Unifi) onHeartbeat: Attempting to reconnect Unifi Controller
2021-05-24 15:53:28.062 Unifi: (Unifi) onHeartbeat: Attempting to reconnect Unifi Controller
2021-05-24 15:53:33.056 Unifi: (Unifi) onHeartbeat: Attempting to reconnect Unifi Controller 
mcmikev
Posts: 146
Joined: Tuesday 26 May 2015 8:11
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: right here
Contact:

Re: Python plugin: Ubiquiti Unifi Presence

Post by mcmikev »

Hi Wizzard72,

I went back to my SG5100 netgate device for a while (needed wireguard tunnel) and now I am back to my UDM Pro.

However when I enable to plugin, all my other python plugins stop workin and errors come in the log.
Disable the plugin and all the other plugins remain functional.

Code: Select all

 2021-10-23 12:10:55.816 Error: Gangkast UPS hardware (34) thread seems to have ended unexpectedly
2021-10-23 12:10:55.817 Error: Zigate hardware (48) thread seems to have ended unexpectedly
2021-10-23 12:10:55.817 Error: Slaapkamer4 CV hardware (49) thread seems to have ended unexpectedly
2021-10-23 12:10:55.817 Error: Gang CV hardware (50) thread seems to have ended unexpectedly
2021-10-23 12:10:55.817 Error: Badkamer CV hardware (51) thread seems to have ended unexpectedly
2021-10-23 12:10:55.817 Error: WK CV hardware (52) thread seems to have ended unexpectedly
2021-10-23 12:10:55.817 Error: Jennifer CV hardware (53) thread seems to have ended unexpectedly
2021-10-23 12:10:55.817 Error: Josslyn CV hardware (54) thread seems to have ended unexpectedly
2021-10-23 12:10:55.818 Error: Slaapkamer1 CV hardware (55) thread seems to have ended unexpectedly
2021-10-23 12:10:55.818 Error: Unifi hardware (69) thread seems to have ended unexpectedly 
Tried this multiple times and it is only when I activate this plugin.
Is an update needed of this plugin? I am running the latest version of this plugin but there has been some changes I believe in the plugin framework that maybe is causing this crash?

Hope you can find the bug. What can I do to help figure out the problem?
BorisH
Posts: 5
Joined: Tuesday 16 November 2021 16:37
Target OS: Raspberry Pi / ODroid
Domoticz version: 2021.1
Location: Amsterdam, NL
Contact:

Re: Python plugin: Ubiquiti Unifi Presence

Post by BorisH »

Hi Wizzard 72,

I think your Unifi plugin is very useful for my Domoticz Home Automation!
The installation works smoothly, using your instructions. But when I add the plugin as new hardware, my Domoticz stops running. The webpage freezes and nothing works any more.

The only way to get Domitcz running again, is to rename plugin.py in the Domoticz-Unifi-Presence on my Raspberry Pi and restart the Domoticz service.
I've tried everything to solve the problem but, nothing works.

Did you experience the same issues and did you solve it?

I would be very thankful you could help me!

Thanks in advance!

Kind regards,

Boris
Amsterdam, NL
BorisH
Posts: 5
Joined: Tuesday 16 November 2021 16:37
Target OS: Raspberry Pi / ODroid
Domoticz version: 2021.1
Location: Amsterdam, NL
Contact:

Re: Python plugin: Ubiquiti Unifi Presence

Post by BorisH »

Is there anyone else who has the solution?

The installation of the Ubiquiti Unifi Presence Plugin works smoothly, using the instructions of Wizzard 72 supplied. But when I add the plugin as new hardware, my Domoticz stops running. The webpage freezes and nothing works any more.

In the Domoticz log the error message is:

2021-11-18 17:35:03.129 Error: Unifi: (UnifiPresence) failed to load 'plugin.py', Python Path used was ':/usr/lib/python39.zip:/usr/lib/python3.9:/usr/lib/python3.9/lib-dynload:/usr/local/lib/python3.9/dist-packages:/usr/lib/python3/dist-packages:/usr/lib/python3.9/dist-packages'.
2021-11-18 17:35:03.129 Error: Unifi: (Unifi) Module Import failed, exception: 'ModuleNotFoundError'
2021-11-18 17:35:03.129 Error: Unifi: (Unifi) Module Import failed: ' Name: plugin'
2021-11-18 17:35:03.129 Error: Unifi: (Unifi) Error Line details not available.

If I run the plugin.py script (that's located in the Domoticz-Unifi-Presence directory) in Thonny Python IDE (on Raspberry) this is the error message:

Traceback (most recent call last):
File "/home/pi/domoticz/plugins/Domoticz-Unifi-Presence/plugin.py", line 51, in <module>
import Domoticz
ModuleNotFoundError: No module named 'Domoticz'

Anyone?
User avatar
waltervl
Posts: 5733
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: Python plugin: Ubiquiti Unifi Presence

Post by waltervl »

BorisH wrote: Thursday 18 November 2021 17:43 Is there anyone else who has the solution?

The installation of the Ubiquiti Unifi Presence Plugin works smoothly, using the instructions of Wizzard 72 supplied. But when I add the plugin as new hardware, my Domoticz stops running. The webpage freezes and nothing works any more.
There is an issue with Domoticz on RPi running Bullseye and Python 3.9.2, see topic https://domoticz.com/forum/viewtopic.php?f=6&t=37376
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
BorisH
Posts: 5
Joined: Tuesday 16 November 2021 16:37
Target OS: Raspberry Pi / ODroid
Domoticz version: 2021.1
Location: Amsterdam, NL
Contact:

Re: Python plugin: Ubiquiti Unifi Presence

Post by BorisH »

Thanks Watervl! I downgraded my Pi to Raspbian Buster, and now, I can see in the domoticz log, the plugin is running
But, It's not detecting a connected phone.

I read that the Unifi setup of Wizzard 72 was with a Unifi Gateway. Is that neccesary for the the plugin to work?
BorisH
Posts: 5
Joined: Tuesday 16 November 2021 16:37
Target OS: Raspberry Pi / ODroid
Domoticz version: 2021.1
Location: Amsterdam, NL
Contact:

Re: Python plugin: Ubiquiti Unifi Presence

Post by BorisH »

It works!

I entered the wrong Unifi Sitename
peter68
Posts: 7
Joined: Wednesday 20 September 2017 12:04
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: Nederland
Contact:

Re: Python plugin: Ubiquiti Unifi Presence

Post by peter68 »

Hi,
I like this plugin, however i can't seem to get it working.
Running unifi-controller on cloudkey (gen1) and domoticz on RPI4.
Just installed a fresh installation of domoticz to test some things.
The plugin is installed succesfull, my phone device is created as it should. But it keeps telling me that i'm not at home, or at least not on the network.
I running my unifi site not as the default site on the controller.
I created a seperate user that only have access to this secondary site. With these credentials in can log in into the controller and have directly access to the right site.
This is the logging i get in domoticz:

021-12-14 20:13:30.812 unifi hardware started.
2021-12-14 20:13:30.812 Status: unifi: (unifi) Entering work loop.
2021-12-14 20:13:30.812 Status: unifi: (unifi) Started.
2021-12-14 20:13:31.216 unifi: (unifi) Debug logging mask set to: PYTHON PLUGIN QUEUE IMAGE DEVICE CONNECTION MESSAGE
2021-12-14 20:13:31.216 unifi: (unifi) setVersionCheck - Plugin allowed to start (triggered by: onStart)
2021-12-14 20:13:31.216 unifi: (unifi) onStart: Found devicestable.txt file
2021-12-14 20:13:31.216 unifi: (unifi) Number of icons loaded = 3
2021-12-14 20:13:31.216 unifi: (unifi) onStart: Items = UnifiPresenceAnyone
2021-12-14 20:13:31.216 unifi: (unifi) onStart: Icon 101 Name = UnifiPresence
2021-12-14 20:13:31.216 unifi: (unifi) onStart: Items = UnifiPresenceOverride
2021-12-14 20:13:31.216 unifi: (unifi) onStart: Icon 102 Name = UnifiPresence
2021-12-14 20:13:31.216 unifi: (unifi) onStart: Items = UnifiPresenceDevice
2021-12-14 20:13:31.216 unifi: (unifi) onStart: Icon 103 Name = UnifiPresence
2021-12-14 20:13:31.216 unifi: (unifi) login: called
2021-12-14 20:13:31.214 Status: unifi: (unifi) Initialized version 2.9.1, author 'Wizzard72'
2021-12-14 20:13:32.282 unifi: (unifi) login: Login successful into Unifi Controller
2021-12-14 20:13:32.306 unifi: (unifi) detect Unifi Devices: Invalid login, or login has expired
2021-12-14 20:13:32.306 unifi: (unifi) create_devices: Plugin Name = unifi
2021-12-14 20:13:32.306 unifi: (unifi) create_devices: Found phone to monitor from configuration = Peter=8c:b8:4a:xx:xx:xx
2021-12-14 20:13:32.306 unifi: (unifi) UpdateDevice: Update (sValue): Off --> On (unifi - Peter)
2021-12-14 20:13:32.306 (unifi - Peter) Updating device from 0:'Off' to have values 1:'On'.
2021-12-14 20:13:32.314 unifi: (unifi) UpdateDevice: Update (sValue): On --> Off (unifi - Peter)
2021-12-14 20:13:32.314 (unifi - Peter) Updating device from 1:'On' to have values 0:'Off'.
2021-12-14 20:13:32.322 unifi: (unifi) onStart: Geo Phone with name 'Geo Peter' is detected from config.
2021-12-14 20:13:32.322 unifi: (unifi) onStart: Phone Naam = OverRide | 00:00:00:00:00:00 | 255 | Off | No | No
2021-12-14 20:13:32.322 unifi: (unifi) onStart: Phone Naam = Peter | 8c:b8:4a:xx:xx:xx | 50 | Off | No | No
2021-12-14 20:13:32.322 unifi: (unifi) onStart: Phone Naam = Geo Peter | 11:11:11:11:11:11 | 80 | | No | GEO
2021-12-14 20:13:32.322 unifi: (unifi) Pushing 'PollIntervalDirective' on to queue
2021-12-14 20:13:32.323 (unifi) Processing 'PollIntervalDirective' message
2021-12-14 20:13:32.323 unifi: (unifi) Heartbeat interval set to: 5.
2021-12-14 20:13:35.029 unifi: (unifi) Pushing 'onHeartbeatCallback' on to queue
2021-12-14 20:13:35.079 (unifi) Processing 'onHeartbeatCallback' message
2021-12-14 20:13:35.079 unifi: (unifi) Calling message handler 'onHeartbeat'.
2021-12-14 20:13:35.079 unifi: (unifi) onHeartbeat: called
2021-12-14 20:13:35.079 unifi: (unifi) onHeartbeat: Attempting to reconnect Unifi Controller
2021-12-14 20:13:35.079 unifi: (unifi) login: called
2021-12-14 20:13:36.078 unifi: (unifi) login: Login successful into Unifi Controller
2021-12-14 20:13:36.079 unifi: (unifi) onHeartbeat: Requesting Unifi Controller details
2021-12-14 20:13:36.102 unifi: (unifi) request_details: Invalid login, or login has expired
2021-12-14 20:13:36.102 unifi: (unifi) login: called
2021-12-14 20:13:37.126 unifi: (unifi) login: Login successful into Unifi Controller
2021-12-14 20:13:37.149 unifi: (unifi) request_online_phones: Invalid login, or login has expired
2021-12-14 20:13:37.149 unifi: (unifi) login: called
2021-12-14 20:13:38.128 unifi: (unifi) login: Login successful into Unifi Controller
2021-12-14 20:13:40.033 unifi: (unifi) Pushing 'onHeartbeatCallback' on to queue

In the log from the unifi controller i see that user domoticz is logged in. But the domoticz log says that login is succesfull and directly invalid.

Some ideas, anyone?
regards, Peter.
Ptje
Posts: 73
Joined: Sunday 06 March 2016 23:56
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: Schaijk
Contact:

Re: Python plugin: Ubiquiti Unifi Presence

Post by Ptje »

Sorry, I forgot that this is a English Site. This plugin works very fine. But does it work only with two telefoon mac's ? Or can I make it work with more ?

Met vriendelijke groet,
Peter
Ptje
Posts: 73
Joined: Sunday 06 March 2016 23:56
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: Schaijk
Contact:

Re: Python plugin: Ubiquiti Unifi Presence

Post by Ptje »

Hello,

Nobody knows ? Could nobody tell if de plugin is for 2 phones or more ?

Greetings,
Peter
mcmikev
Posts: 146
Joined: Tuesday 26 May 2015 8:11
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: right here
Contact:

Python plugin: Ubiquiti Unifi Presence

Post by mcmikev »

More is possible. I have 4 devices.

Use name=Mac, name=mac,etc, etc

Mac = macaddress of the device.
Use komma , to add after last one. Not after the last entry. Then no komma ,


Also after adding. Stop and start the plug-in

Also make sure allow new hardware is enabled
Ptje
Posts: 73
Joined: Sunday 06 March 2016 23:56
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: Schaijk
Contact:

Re: Python plugin: Ubiquiti Unifi Presence

Post by Ptje »

Hello,

Thanks for your reply. I did already try that, but then I get a error in Domoticz log.

2022-01-07 21:19:08.855 Error: Aan/afwezigheid check: 'onStart' failed 'IndexError':'list index out of range'.
2022-01-07 21:19:08.855 Error: Aan/afwezigheid check: Exception traceback:
2022-01-07 21:19:08.855 Error: Aan/afwezigheid check: ----> Line 1041 in '/home/pi/domoticz/plugins/Domoticz-Unifi-Presence/plugin.py', function onStart
2022-01-07 21:19:08.855 Error: Aan/afwezigheid check: ----> Line 294 in '/home/pi/domoticz/plugins/Domoticz-Unifi-Presence/plugin.py', function onStart

Thats why I thought it was made for 2 devices. I like the plugin, but I have more devices to check.

Greetings,
Peter
snellejellep
Posts: 241
Joined: Tuesday 16 May 2017 13:05
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: The Neterlands
Contact:

Re: Python plugin: Ubiquiti Unifi Presence

Post by snellejellep »

hi,
i wanted to try this, but i dont think it works.
the devices i defined are created but the only log messages i see are these:
2022-01-10 14:34:28.081 Unifi: onHeartbeat: Attempting to reconnect Unifi Controller
2022-01-10 14:34:28.793 Unifi: login: Login successful into Unifi Controller

the devices are not updated.
raspberry pi | xiaomi vacuum | yeelight | philips hue | zwave | ubiquiti unifi | harmony | sonoff | zigbee2mqtt | https://www.youtube.com/channel/UC2Zidl ... m1OLuNldfQ
Ptje
Posts: 73
Joined: Sunday 06 March 2016 23:56
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: Schaijk
Contact:

Re: Python plugin: Ubiquiti Unifi Presence

Post by Ptje »

Hello,

Has somebody have a idea what you have to fill in when the site name is not default ? When I fill in the name of the site, then it connects and disconnects again.

Greetings,
Peter
BorisH
Posts: 5
Joined: Tuesday 16 November 2021 16:37
Target OS: Raspberry Pi / ODroid
Domoticz version: 2021.1
Location: Amsterdam, NL
Contact:

Re: Python plugin: Ubiquiti Unifi Presence

Post by BorisH »

Look at the URL of the Unifi controller:
https://192.168.2.X:8443/manage/xxxxxxxxx/dashboard

fill in what's behind manage and dashboard. So in this case fill in: xxxxxxxx
Edems88
Posts: 3
Joined: Saturday 28 July 2018 8:45
Target OS: Raspberry Pi / ODroid
Domoticz version: 2021.1
Contact:

Re: Python plugin: Ubiquiti Unifi Presence

Post by Edems88 »

Hi!

Does anyone work with UDR?
What do I need to do to make it work?

Thanks!

Code: Select all

2022-05-18 14:16:40.847 Error: Unifi: detect Unifi Devices: Unifi device (UDR) is not present in the table.
2022-05-18 14:16:40.848 Error: Unifi: setVersionCheck - Plugin NOT allowed to start (triggered by: detectUnifiDevices) 
CronoS
Posts: 135
Joined: Wednesday 15 July 2015 23:40
Target OS: -
Domoticz version:
Contact:

Re: Python plugin: Ubiquiti Unifi Presence

Post by CronoS »

Edems88 wrote: Wednesday 18 May 2022 14:36 Hi!

Does anyone work with UDR?
What do I need to do to make it work?

Thanks!

Code: Select all

2022-05-18 14:16:40.847 Error: Unifi: detect Unifi Devices: Unifi device (UDR) is not present in the table.
2022-05-18 14:16:40.848 Error: Unifi: setVersionCheck - Plugin NOT allowed to start (triggered by: detectUnifiDevices) 
The same problem here; also bought a UDR...
CronoS
Posts: 135
Joined: Wednesday 15 July 2015 23:40
Target OS: -
Domoticz version:
Contact:

Re: Python plugin: Ubiquiti Unifi Presence

Post by CronoS »

I am trying the script to access the Unifi system, but I am not quite sure what the URLs are.
Also I see an certificate issue which causes a logon failure. I can work around this issue using the direct.ui URL (command to get this DNS name: grep ui.direct /var/run/dnsmasq.conf.d/dns.conf on the UDR) .. On this URL you don't get certificate issues, but I am not able to get the statistics yet..The url for the API for are I think https://<UDRIP>/proxy/network/api/s/<sitename>/stat/sta this .. when using a local IP adres it seems to work, but not with ui.direct url name (also tried to set an ip adress in my hosts file; no luck) Don't know exactly what is causing this...
User avatar
heggink
Posts: 978
Joined: Tuesday 08 September 2015 21:44
Target OS: Raspberry Pi / ODroid
Domoticz version: 12451
Location: NL
Contact:

Re: Python plugin: Ubiquiti Unifi Presence

Post by heggink »

I believe the plugin works with a unifi controller like the UCK. I don't think the UDM runs a controller.

Sent from my SM-G980F using Tapatalk

Docker in Truenas scale, close to latest beta
DASHTICZ 🙃
RFXCOM, zwavejs2mqtt, zigbee2mqtt,
P1 meter & solar panel
Google home, Wifi Cams motion detection
Geofence iCloud, Bluetooth & Wifi ping
Harmony hub, Nest, lots more :-)
CronoS
Posts: 135
Joined: Wednesday 15 July 2015 23:40
Target OS: -
Domoticz version:
Contact:

Re: Python plugin: Ubiquiti Unifi Presence

Post by CronoS »

heggink wrote: Friday 20 May 2022 20:09 I believe the plugin works with a unifi controller like the UCK. I don't think the UDM runs a controller.

Sent from my SM-G980F using Tapatalk
The UDM runs a controller; but I think things runs a little differently depending on the API.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest