Can't find site id in plugin 7.34.311

Posted on
Thu Apr 01, 2021 8:54 am
kw123 offline
User avatar
Posts: 8333
Joined: May 12, 2013
Location: Dallas, TX

Re: Can't find site id in plugin 7.34.311

it is a unifi system assigned value. I actually don't know how to change that one . it is not the "site name" in setting/ site it is more like an id when you have several unifi sites in one controller

Posted on
Thu Apr 01, 2021 10:28 am
juntta offline
Posts: 143
Joined: Oct 13, 2014
Location: Finland

Re: Can't find site id in plugin 7.34.311

kw123 wrote:
it is a unifi system assigned value. I actually don't know how to change that one . it is not the "site name" in setting/ site it is more like an id when you have several unifi sites in one controller
Ok, so I guess it got assigned when I migrated UniFi from rPi -> cloudkey. I only got one real site.

Posted on
Thu Apr 01, 2021 3:31 pm
kw123 offline
User avatar
Posts: 8333
Joined: May 12, 2013
Location: Dallas, TX

Re: Can't find site id in plugin 7.34.311

please try : https://github.com/kw123/unifi/releases/tag/v7.39.356

should have the block/unblock error fixed and also (not test) allow a different name than default

Karl

Posted on
Fri Apr 02, 2021 12:14 am
juntta offline
Posts: 143
Joined: Oct 13, 2014
Location: Finland

Re: Can't find site id in plugin 7.34.311

kw123 wrote:
please try : https://github.com/kw123/unifi/releases/tag/v7.39.356

should have the block/unblock error fixed and also (not test) allow a different name than default

Karl


Thanks, saved the configuration and this error came up:
Code: Select all
   uniFiAP                         setunifiCloudKeySiteNamer setting site id name to >>default<<, list of Names found:[u'default', u'od****fu']<
   uniFiAP Error                   error:>> url:https://****************:443/proxy/network/api/s/default/stat/device/*************, resp:{"meta":{"rc":"error","mac":"*************","msg":"api.err.UnknownDevice"},"data":[]}
   uniFiAP Error                   error:>> url:https://****************:443/proxy/network/api/s/default/stat/device/*************, resp:{"meta":{"rc":"error","mac":"*************","msg":"api.err.UnknownDevice"},"data":[]}
   uniFiAP                          start   runConcurrentThread, initializing loop settings and threads ..

and site name still reverts to 'default'


Block/unblock produced this log:

Code: Select all
2. Apr 2021 at 9.03.05
   uniFiAP                         Block cmd: return  True

so it seems to work on Indigo/plugin end but Unifi network app still sees device online and Apple tv was online. Anything I can check from settings and/or device state's etc?

Posted on
Fri Apr 02, 2021 6:38 am
kw123 offline
User avatar
Posts: 8333
Joined: May 12, 2013
Location: Dallas, TX

Re: Can't find site id in plugin 7.34.311

Do you see the error message more than once ? Can you check in config
And switch on debug http connect and response. Then check plugin.log file
When the block function works it successfully logged in


Sent from my iPhone using Tapatalk

Posted on
Fri Apr 02, 2021 7:11 am
juntta offline
Posts: 143
Joined: Oct 13, 2014
Location: Finland

Re: Can't find site id in plugin 7.34.311

kw123 wrote:
Do you see the error message more than once ? Can you check in config
And switch on debug http connect and response. Then check plugin.log file
When the block function works it successfully logged in


Hmm, hopefully I did find what you asked for.

That error message repeats two times after I save the configuration, I guess once for each AP that I have.

from indigo server log:
Code: Select all
  uniFiAP                         initializing  ...
   uniFiAP                         path To files:          =================
   uniFiAP                         indigo                  /Library/Application Support/Perceptive Automation/
   uniFiAP                         installFolder           /Library/Application Support/Perceptive Automation/Indigo 7.5/
   uniFiAP                         plugin.py               /Library/Application Support/Perceptive Automation/Indigo 7.5/Plugins/uniFiAP.indigoPlugin/Contents/Server Plugin/
   uniFiAP                         Plugin params           /Library/Application Support/Perceptive Automation/Indigo 7.5/Preferences/Plugins/com.karlwachs.uniFiAP/
   uniFiAP                         logger  enabled for     INFO           ==> TEST ONLY
   uniFiAP Warning                 logger  enabled for     WARNING        ==> TEST ONLY
   uniFiAP Error                   logger  enabled for     ERROR          ==> TEST ONLY
   uniFiAP Error                   logger  enabled for     CRITICAL       ==> TEST ONLY
   uniFiAP                         check                   /Library/Application Support/Perceptive Automation/Indigo 7.5/Logs/com.karlwachs.uniFiAP/plugin.log  <<<<    for detailed logging
   uniFiAP                         Plugin short Name       UniFi
   uniFiAP                         my PID                  38267
   uniFiAP                         set params for indigo V 7.5
   Started plugin "uniFiAP 7.39.356"
   uniFiAP                         testing if variable enableTimeTracking_UniFi is == on/off/print-option to enable/end/print time tracking of all functions and methods (option:'',calls,cumtime,pcalls,time)
   uniFiAP                         myLogSet setting parameters -- logFileActive= indigo; logFile= /Library/Application Support/Perceptive Automation/Indigo 7.5/Logs/com.karlwachs.uniFiAP/plugin.log;  debugLevel= [u'ConnectionCMD', u'ConnectionRET']
   uniFiAP                         MAP2Vendor initializing
   uniFiAP                         MAP2Vendor initializing  finished, read from mac2Vendor.json file
   uniFiAP                         MAP2Vendor initializing  finished, read from mac2Vendor.json file
   uniFiAP Error                   error:>> url:https://************.33:443/proxy/network/api/s/default/stat/device/************, resp:{"meta":{"rc":"error","mac":"************","msg":"api.err.UnknownDevice"},"data":[]}
   uniFiAP Error                   error:>> url:https://************.33:443/proxy/network/api/s/default/stat/device/************, resp:{"meta":{"rc":"error","mac":"************","msg":"api.err.UnknownDevice"},"data":[]}
   uniFiAP                          start   runConcurrentThread, initializing loop settings and threads ..
   uniFiAP                         initialized ... looping



Block/Unblock: This time I blocked Apple TV first from the Network App and I tried to unblock with plugin. Results below

"(UN)BLOCK a client" popup window shows new field at the top:
Code: Select all
MSG from plugin: ["un-Block cmd:False"]


From log:
Code: Select all
02 15:50:00 Connection: requests:https://************.33:443/proxy/network/api/s/default/cmd/stamgr;
header:{'Content-Type': 'application/json', 'Accept': 'application/json', 'X-CSRF-Token': '7c046915-53be-4b91-9f2d-8469a64eb302'};
dataSEND:{'mac': u'****************', 'cmd': 'unblock-sta'};
cookies:{'TOKEN': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjc3JmVG9rZW4iOiI3YzA0NjkxNS01M2JlLTRiOTEtOWYyZC04NDY5YTY0ZWIzMDIiLCJ1c2VySWQiOiIyMjY3OTI2Yi1mZGZiLTRlOGQtYTYwOS1lMzc1NTk1YTI3MWUiLCJwYXNzd29yZFJldmlzaW9uIjoxNjE2NjkxNTM5LCJpYXQiOjE2MTczNjc3OTgsImV4cCI6MTYxNzM3MTM5OH0.-Cyzp05Jbc49OUc9RtJGRReIFVM71nqmu7bRM2RRFyM'};
cmdType:post
02 15:50:00 executeCMDOnController retCode:200, time used:0.075887; cont length:143 os:unifi_os; cmdType:post, url:https://****************.33:443/proxy/network/api/s/default/cmd/stamgr
>>>{"meta":{"rc":"ok"},"data":[{"_id":"6064c36aade0570dd6c16192","site_id":"5b********************e2","mac":"********************","blocked":false}]}<<<
02 15:50:00 un-Block cmd: return  False
02 15:50:00 Connection: requests:https://192.168.14.33:443/proxy/protect/api/events;
header:{'Content-Type': 'application/json', 'Accept': 'application/json', 'X-CSRF-Token': '7c046915-53be-4b91-9f2d-8469a64eb302'};
dataSEND:{u'start': '1617367798853', u'end': '1617367800873'};
cookies:{'TOKEN': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjc3JmVG9rZW4iOiI3YzA0NjkxNS01M2JlLTRiOTEtOWYyZC04NDY5YTY0ZWIzMDIiLCJ1c2VySWQiOiIyMjY3OTI2Yi1mZGZiLTRlOGQtYTYwOS1lMzc1NTk1YTI3MWUiLCJwYXNzd29yZFJldmlzaW9uIjoxNjE2NjkxNTM5LCJpYXQiOjE2MTczNjc4MDAsImV4cCI6MTYxNzM3MTQwMH0.dbb8cmPycmSVWqYeb82lNXTbvKvZtQ1-_Nz3CTLeKYc'};
cmdType:get
02 15:50:00 executeCMDOnController retCode:200, time used:0.072174; cont length:2 os:unifi_os; cmdType:get, url:https://****************.33:443/proxy/protect/api/events
>>>[]<<<

Posted on
Fri Apr 02, 2021 7:59 am
kw123 offline
User avatar
Posts: 8333
Joined: May 12, 2013
Location: Dallas, TX

Re: Can't find site id in plugin 7.34.311

this seems to work with site = "default":
02 15:50:00 Connection: requests:https://************.33:443/proxy/network/api/s/default/cmd/stamgr;
header:{'Content-Type': 'application/json', 'Accept': 'application/json', 'X-CSRF-Token': '7c046915-53be-4b91-9f2d-8469a64eb302'};
dataSEND:{'mac': u'****************', 'cmd': 'unblock-sta'};
cookies:{'TOKEN': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjc3JmVG9rZW4iOiI3YzA0NjkxNS01M2JlLTRiOTEtOWYyZC04NDY5YTY0ZWIzMDIiLCJ1c2VySWQiOiIyMjY3OTI2Yi1mZGZiLTRlOGQtYTYwOS1lMzc1NTk1YTI3MWUiLCJwYXNzd29yZFJldmlzaW9uIjoxNjE2NjkxNTM5LCJpYXQiOjE2MTczNjc3OTgsImV4cCI6MTYxNzM3MTM5OH0.-Cyzp05Jbc49OUc9RtJGRReIFVM71nqmu7bRM2RRFyM'};
cmdType:post
02 15:50:00 executeCMDOnController retCode:200, time used:0.075887; cont length:143 os:unifi_os; cmdType:post, url:https://****************.33:443/proxy/network/api/s/default/cmd/stamgr
>>>{"meta":{"rc":"ok"},"data":[{"_id":"6064c36aade0570dd6c16192","site_id":"5b********************e2","mac":"********************","blocked":false}]}<<<
02 15:50:00 un-Block cmd: return False


can you keep the debug on set the site name to your setting and restart the plugin
that will create a long output, best you email that to me karlwachs at me com

Karl

Posted on
Fri Apr 02, 2021 8:27 am
juntta offline
Posts: 143
Joined: Oct 13, 2014
Location: Finland

Re: Can't find site id in plugin 7.34.311

Ok, I’ll do that later on. Should I mask anything else besides passwords, IPs etc from the file?

Posted on
Fri Apr 02, 2021 8:47 am
kw123 offline
User avatar
Posts: 8333
Joined: May 12, 2013
Location: Dallas, TX

Can't find site id in plugin 7.34.311

Passwords and user is are ok to block
The Ip numbers are local not public.
And sending private email should be ok.
You could compress the file so that there is nothing visible in the email.


Sent from my iPhone using Tapatalk

Posted on
Sat Apr 17, 2021 12:01 pm
macpro offline
User avatar
Posts: 765
Joined: Dec 29, 2005
Location: Third byte on the right

Re: Can't find site id in plugin 7.34.311

kw123 wrote:
Ok then you are I guess the first I know of where the site is not default.

And here's the 2nd one. My site also doesn't use the name "default".

Who is online

Users browsing this forum: No registered users and 2 guests

cron