Closed jstewart99 closed 3 years ago
Interesting. Can you see if there's an "offline_seconds" state in the device? Is this device online or offline at this time?
offline_seconds is the ONLY state shown. Device shows offline, but is connected and should show online
OK, that error is causing the device update to fail, which is why nothing else is showing properly. Let me see what I need to do to fix that...
Can you grab the latest commit and see if that fixes the error? I don't want to push a release if it doesn't.
https://github.com/FlyingDiver/Indigo-miniUniFi/archive/50669a7ea08b30c6d04c5db64f48d347941cfe73.zip
Slightly different error:
Error device "iPhone - AS" state key offline_seconds not defined (ignoring update request) miniUniFi Error Error in plugin execution runConcurrentThread:
Traceback (most recent call last): File "plugin.py", line 102, in runConcurrentThread File "plugin.py", line 377, in updateUniFiClient IndexError: tuple index out of range
miniUniFi Error plugin runConcurrentThread function returned or failed (will attempt again in 10 seconds)
THAT referenced device is offline and I did not recreate it from the original (.3 was the last version I'd used, FWIW). I have two other devices that aren't explicitly throwing an error in the log, that are online (also were not recreated). I'd prefer not to have to recreate devices (makes me have to redo my control pages, shame on me for using beta versions in my CP's haha) but I can obviously do so it needed.
Try that again: https://github.com/FlyingDiver/Indigo-miniUniFi/archive/main.zip
Why would you need to recreate the device? Just update the plugin and see if the error goes away.
The 'IndexError: tuple index out of range' error should be fixed. The other error should be benign, but I'd want to see the logs anyway.
Sorry since the version number was the same it wasn't a double-click to install update, so I disabled the plugin, went to /Library/Application Support, replaced the plugin, and then enabled the plugin. Just want to make sure that was the correct procedure...
Log now shows only: Error device "iPhone - AS" state key offline_seconds not defined (ignoring update request)
It's even easier to just replace the existing files then restart the plugin. But disabling, replacing, enabling also works.
If you edit that device (iPhone - AS) and hit save without actually changing anything, does the error go away?
Yes I think that fixed the problem. Device shows offline and ONLY displays offlineseconds = 0. When I edit/save an online device, the state names got cleaned up a bit ("c" removed) and I now see offline_seconds for those, along with all the other states.
For some reason that device doesn't have a "last_seen" state, so I can't calculate the offline_seconds. Not sure what value I could put there in that case.
It's probably messed up because it's offline and it couldn't update because of the bug/glitch you just fixed, and then when I edit/saved it there was no previous data to read, (no "last_seen")? So I assume this is just a unique issue caused by updating the plugin that will go away once this device comes back online.
Probably. Pre-release software - I reserve the right to break things. ;)
Upgraded to 0.11, got this error below. Deleted device and recreated it, error still occurs. Did not yet try deleting ALL old devices though.
miniUniFi Error Error in plugin execution runConcurrentThread:
Traceback (most recent call last): File "plugin.py", line 102, in runConcurrentThread File "plugin.py", line 374, in updateUniFiClient UnboundLocalError: local variable 'offline_seconds' referenced before assignment
miniUniFi Error plugin runConcurrentThread function returned or failed (will attempt again in 10 seconds)