Wizzard72 / Domoticz-Unifi-Presence

GNU General Public License v3.0
5 stars 7 forks source link

Plugin does not update / see Unifi devices #27

Closed XSebastiaan closed 2 years ago

XSebastiaan commented 2 years ago

Hi all,

As i am trying to get the plugin to work. But i encounter this issue.

The Unifi plugin says in the log that it connects successful. However the switches dont change status. I also saw at other issues in the logs at startup that it shows all the connected Unifi devices, AP / Switches.

That's another thing that doesn't happen.

I think that the login works fine but perhaps i forgot something in the Unifi controller?

The setup i have is: Raspberry pi 4 (Unifi Controller) UAC AP PRO 8 port switch POE Switch mini

This is the log at startup. 2022-01-02 17:49:32.039 Status: Unifi: (Unifi) Started. 2022-01-02 17:49:32.039 Status: Unifi: (Unifi) Entering work loop. 2022-01-02 17:49:32.685 Status: Unifi: (Unifi) Initialized version 3.0.4, author 'Wizzard72' 2022-01-02 17:49:33.606 Unifi: (Unifi) login: Login successful into Unifi Controller 2022-01-02 17:49:33.614 Unifi: (Unifi) detect Unifi Devices: Invalid login, or login has expired 2022-01-02 17:49:33.615 Unifi: (Unifi) UpdateDevice: Update (sValue): --> Off (Unifi - AnyOne) 2022-01-02 17:49:33.620 Unifi: (Unifi) create_devices: Plugin Name = Unifi 2022-01-02 17:49:33.621 Unifi: (Unifi) UpdateDevice: Update (sValue): --> 0 (Unifi - OverRide) 2022-01-02 17:49:33.627 Unifi: (Unifi) UpdateDevice: Update (sValue): --> 0 (Unifi - Off Delay) 2022-01-02 17:49:33.636 Unifi: (Unifi) UpdateDevice: Update (sValue): --> On (Unifi - iPhone-2S) 2022-01-02 17:49:33.649 Unifi: (Unifi) UpdateDevice: Update (sValue): On --> Off (Unifi - iPhone-2S) 2022-01-02 17:49:33.663 Unifi: (Unifi) UpdateDevice: Update (sValue): --> On (Unifi - Phone2) 2022-01-02 17:49:33.677 Unifi: (Unifi) UpdateDevice: Update (sValue): On --> Off (Unifi - Phone2) 2022-01-02 17:49:33.690 Unifi: (Unifi) onStart: Geo Phone with name 'Geo iPhone-2S' is detected from config. 2022-01-02 17:49:33.690 Unifi: (Unifi) onStart: Geo Phone with name 'Geo Phone2' is detected from config. 2022-01-02 17:49:33.690 Unifi: (Unifi) onStart: Phone Naam = OverRide | 00:00:00:00:00:00 | 255 | Off | No | No 2022-01-02 17:49:33.690 Unifi: (Unifi) onStart: Phone Naam = iPhone-2S | 64:6d:2f:01:37:c8 | 50 | Off | No | No 2022-01-02 17:49:33.690 Unifi: (Unifi) onStart: Phone Naam = Geo iPhone-2S | 11:11:11:11:11:11 | 80 | | No | GEO 2022-01-02 17:49:33.691 Unifi: (Unifi) onStart: Phone Naam = Phone2 | ce:6e:5f:a1:24:bd | 51 | Off | No | No 2022-01-02 17:49:33.691 Unifi: (Unifi) onStart: Phone Naam = Geo Phone2 | 11:11:11:11:11:11 | 81 | | No | GEO 2022-01-02 17:49:37.089 Unifi: (Unifi) onHeartbeat: Attempting to reconnect Unifi Controller 2022-01-02 17:49:38.016 Unifi: (Unifi) login: Login successful into Unifi Controller

unifi

I hope that you have a suggestion for me on what i could try.

The controller runs at: atag_6.0.43_14348 Domoticz runs at: Version: 2021.1 Build Hash: 8547c5b7e Compile Date: 2021-04-17 17:29:11

Wizzard72 commented 2 years ago

The site name is probably in lowercase. In the Unifi Controller logs you can see if the user connects.

XSebastiaan commented 2 years ago

35BE409B-329D-4520-A27B-05003E7FC4EC The log shows that it does login. So the connection itself looks working.

Wizzard72 commented 2 years ago

Try this: Login op de Unifi Controller. Then paste the following URL in the same browser tab: https://127.0.0.1:8443/api/s/default/stat/device. If the result returns a lot of data (or json) then it's good. Dit you change the Site Name in the Plugin page to default (without capital D)?

XSebastiaan commented 2 years ago

Try this: Login op de Unifi Controller. Then paste the following URL in the same browser tab: https://127.0.0.1:8443/api/s/default/stat/device. If the result returns a lot of data (or json) then it's good. Dit you change the Site Name in the Plugin page to default (without capital D)?

Legend!!! The Unifi controller said it was "Default" So tried it with "default" and it just started working. (SO Happy)

2022-01-02 22:25:18.166 Unifi: (Unifi) UpdateDevice: Update (sValue): 56.8 --> 56.7 (Unifi - Switch Meterkast CPU) 2022-01-02 22:25:18.171 Unifi: (Unifi) UpdateDevice: Update (sValue): 72.0 --> 99.0 (Unifi - AC-Pro CPU) 2022-01-02 22:25:18.176 Unifi: (Unifi) UpdateDevice: Update (sValue): 54.0 --> 53.7 (Unifi - AC-Pro Memory) 2022-01-02 22:25:18.196 Unifi: (Unifi) ProcessDevices: Seems we lost phone 'iPhone-2S' 2022-01-02 22:25:23.177 Unifi: (Unifi) ProcessDevices: Waiting for phone 'iPhone-2S' to return (5/0 seconds) 2022-01-02 22:25:23.177 Unifi: (Unifi) ProcessDevices: Phone 'iPhone-2S' disconnected from the Unifi Controller 2022-01-02 22:25:23.177 Unifi: (Unifi) UpdateDevice: Update (sValue): On --> Off (Unifi - iPhone-2S) 2022-01-02 22:25:23.188 Unifi: (Unifi) ProcessDevices: Total Phones connected = 1 2022-01-02 22:25:25.091 Life: (Life) Checking Life360 Circle... 2022-01-02 22:26:13.176 Unifi: (Unifi) UpdateDevice: Update (sValue): 53.7 --> 54.5 (Unifi - AC-Pro Memory) 2022-01-02 22:26:35.056 Life: (Life) Checking Life360 Circle... 2022-01-02 22:26:50.563 zigbee2mqtt: (zigbee2mqtt) Received available devices list from bridge 2022-01-02 22:26:53.158 Unifi: (Unifi) UpdateDevice: Update (sValue): 99.0 --> 83.8 (Unifi - AC-Pro CPU) 2022-01-02 22:26:53.166 Unifi: (Unifi) UpdateDevice: Update (sValue): 54.5 --> 54.1 (Unifi - AC-Pro Memory) 2022-01-02 22:26:53.198 Unifi: (Unifi) ProcessDevices: Phone 'iPhone-2S' connected to the Unifi Controller 2022-01-02 22:26:53.198 Unifi: (Unifi) UpdateDevice: Update (sValue): Off --> On (Unifi - iPhone-2S) 2022-01-02 22:26:53.207 Unifi: (Unifi) ProcessDevices: Total Phones connected = 2