Blocked/unblocked status

Posted on
Thu Sep 20, 2018 3:29 pm
mat offline
Posts: 769
Joined: Nov 25, 2010
Location: Cambridgeshire - UK

Blocked/unblocked status

Karl,

Thanks for the plugin - it seems to be working splendidly!

I'm just playing around with it for the first time tonight. Loving the idea of being able to quickly block and unblock the kids. Is there any chance of adding the block/unblocked to the status list please? Suggest blocked = true/false?

No problem, if its a problem, and keep up the great plugin work!

Cheers


Mat

Late 2018 mini 10.14

Posted on
Thu Sep 20, 2018 8:52 pm
kw123 offline
User avatar
Posts: 8366
Joined: May 12, 2013
Location: Dallas, TX

Re: Blocked/unblocked status

Will check





Sent from my iPhone using Tapatalk

Posted on
Thu Sep 20, 2018 10:42 pm
kw123 offline
User avatar
Posts: 8366
Joined: May 12, 2013
Location: Dallas, TX

Re: Blocked/unblocked status

can be done..
command ex :
Code: Select all
/usr/bin/curl --insecure -c /tmp/cookie   --data '{"username": "xxx", "password": "xxx"}' https://192.168.1.9:8443/api/login
then
Code: Select all
/usr/bin/curl --insecure -b /tmp/cookie  -X PUT https://192.168.1.9:8443/api/s/default/stat/user/2c:76:8a:c8:5b:c9
for eg device w mac#2c:76:8a:c8:5b:c9

challenge: this is data from the controller not fro any of the unifi devices that are queried regularly. if we want to do this for all devices this might create some load

this will also give some info .. but a large dump .. also on blocked/unblocked devices:
Code: Select all
/usr/bin/curl --insecure -b /tmp/cookie  -X PUT https://192.168.1.9:8443/api/s/default/list/user/


what would be the update frequency that makes sense? This is not pushed from the controller, but must be pulled. we could query the db once/ minute or so..

still thinking about it


Karl

Posted on
Thu Sep 20, 2018 11:14 pm
mat offline
Posts: 769
Joined: Nov 25, 2010
Location: Cambridgeshire - UK

Re: Blocked/unblocked status

Hi karl

That’s great will have a play tonight. Thank you.

I would say once every minute and probably for 10 devices. Once every 30 seconds would be even better.

The use case is to take the kids internet control into a wife friendly control page.

Thanks

Late 2018 mini 10.14

Posted on
Fri Sep 21, 2018 8:11 am
kw123 offline
User avatar
Posts: 8366
Joined: May 12, 2013
Location: Dallas, TX

Re: Blocked/unblocked status

have a version ready with dev.state["blocked"] with a boolean value true/false.

runs once a minute and seems to be performing.

will let it run for a while and then post


Karl

Posted on
Fri Sep 21, 2018 8:27 am
mat offline
Posts: 769
Joined: Nov 25, 2010
Location: Cambridgeshire - UK

Re: Blocked/unblocked status

Karl,

You are a superstar! Thank you.

Late 2018 mini 10.14

Posted on
Fri Sep 21, 2018 8:48 am
kw123 offline
User avatar
Posts: 8366
Joined: May 12, 2013
Location: Dallas, TX

Re: Blocked/unblocked status

Tell my w!!


Sent from my iPhone using Tapatalk

Posted on
Fri Sep 21, 2018 9:04 am
mat offline
Posts: 769
Joined: Nov 25, 2010
Location: Cambridgeshire - UK

Re: Blocked/unblocked status

I know that feeling, I installed unifi on Wednesday and have had three very late nights tinkering - mine just doesn't understand the benefits hahaha

Late 2018 mini 10.14

Posted on
Fri Sep 21, 2018 9:31 am
kw123 offline
User avatar
Posts: 8366
Joined: May 12, 2013
Location: Dallas, TX

Re: Blocked/unblocked status

posted v7.20.124 with the (un) blocked feature.

you can select update frequency in config 20...120 secs or off

Karl


also added : first seen and use fixedIP dev states... updated once/ hour

Posted on
Fri Sep 21, 2018 12:26 pm
mat offline
Posts: 769
Joined: Nov 25, 2010
Location: Cambridgeshire - UK

Re: Blocked/unblocked status

Karl,

Will test tonight, thanks so much. You might have made the other 1/2 very happy!


Thank you.

Mat

Late 2018 mini 10.14

Posted on
Fri Sep 21, 2018 5:11 pm
mat offline
Posts: 769
Joined: Nov 25, 2010
Location: Cambridgeshire - UK

Re: Blocked/unblocked status

Hi Karl,

Just installed, and I can see the blocked status, but doesn't appear to be updating the status for "blocked". Both blocked and unblocked devices are showing false.

I can set the blocked and unblocked from indigo and thats working fine.

I have switched, key and AP's, but no USG for your info


Thanks


Mat

Late 2018 mini 10.14

Posted on
Fri Sep 21, 2018 7:21 pm
kw123 offline
User avatar
Posts: 8366
Joined: May 12, 2013
Location: Dallas, TX

Re: Blocked/unblocked status

first it takes a minute or so to propagate from setting blocked to seeing blocked.

second could you run at the report ""print & get ../Print all user info. it should look like this:
Code: Select all
00:55:08 unifi-Report             -
00:55:08 unifi-Report             -== ALL USER report ==
##  mac               hostname             name                 first_seen           last_seen            vendor    fixedIP         us_f-ip wired blckd guest  durationMin       rx_KBytes     rx_Packets       rx_KBytes     tx_Packets
1   b8:e8:56:42:69:fe laptop-II                                 2018-02-25 21:17:45  2018-09-21 00:23:41  Apple     192.168.1.58    True    True        False       49,772       4,611,292     22,085,589      41,257,347     32,718,984
2   f0:9f:c2:d8:df:2f                                           2018-08-11 16:27:33  2018-09-21 00:12:48  Ubiquiti                          True        False           21               0              0               0              0
3   f0:f6:1c:d5:51:16 iPad                 ipad-mini            2016-06-03 00:28:00  2018-09-21 00:12:42  Apple     192.168.1.95    True    False       False      927,424     115,752,108    603,397,330   1,005,472,928    802,893,611
4   2c:76:8a:c8:5b:c9 HPBF51A1             hp-ink               2016-06-07 21:07:47  2018-09-20 23:32:46  HewlettP  192.168.1.43    True    True  False False       13,388           2,257         26,411             926         16,365
5   18:65:90:6a:b9:0c kristins-iPhone      iphone Kristin       2016-10-05 21:02:01  2018-09-20 20:42:14  Apple     192.168.1.94    True    False       False      657,014     215,654,572    359,166,870     360,428,144    348,514,709
6   1c:36:bb:97:c0:85 iPhone               iphone Karl          2018-01-05 15:36:04  2018-09-20 17:32:33  Apple     192.168.1.93    True    False False False      464,820     132,208,516    205,982,426     223,353,412    222,530,303
7   b8:27:eb:5c:0d:c6 clock_1              rpi-38-zero          2017-06-07 19:07:56  2018-09-20 09:07:21  Raspberr  192.168.1.38    True    False       False        9,906          85,755        641,051          52,711        896,961


you should see some in the blocked column with true. If not there will be no blocked=true states in the devices. .. If yes, i need more info

Karl

Posted on
Fri Sep 21, 2018 7:48 pm
kw123 offline
User avatar
Posts: 8366
Joined: May 12, 2013
Location: Dallas, TX

Re: Blocked/unblocked status

found the bug.. it work only at start of plugin. the time window check was wrong . new version is posted

Karl

Posted on
Sat Sep 22, 2018 2:01 am
mat offline
Posts: 769
Joined: Nov 25, 2010
Location: Cambridgeshire - UK

Re: Blocked/unblocked status

Hi Karl,

Thanks for the update, unfortunately still not showing in the Custom State Panel.

This is after waiting around 10 minutes just to make sure:

Extract of the requested below. (no 16) is blocked = true

Screenshot of Indigo Custom State for same showing custom state as being false. It looks like the first report is picking the "blocked" status up correctly, but the custom state in indigo is not changing.

Thanks

mat
Attachments
Screen Shot 2018-09-22 at 08.59.20.png
Screen Shot 2018-09-22 at 08.59.20.png (103.22 KiB) Viewed 3102 times
Screen Shot 2018-09-22 at 08.55.32.png
Screen Shot 2018-09-22 at 08.55.32.png (47.23 KiB) Viewed 3102 times

Late 2018 mini 10.14

Posted on
Sat Sep 22, 2018 2:38 am
kw123 offline
User avatar
Posts: 8366
Joined: May 12, 2013
Location: Dallas, TX

Re: Blocked/unblocked status

Is the device enabled? That’s another it does

Mine works fine Tested several times.

Do you have the right version? May be I uploaded an old one.




Sent from my iPhone using Tapatalk

Who is online

Users browsing this forum: No registered users and 3 guests