Isaksson / node-red-contrib-unifi

MIT License
50 stars 19 forks source link

HELP WANTED: could "WlanSettings" bring up all clients in the "mac_filter_list" and add clients ? #113

Closed austrogaucho closed 11 months ago

austrogaucho commented 11 months ago

Hi Kris,

thanks for your amazing project, I'm using it more and more every day!

Right now I am tackling with the Wlan settings that I would like to modify using node red. In particular I would like to populate "the mac_filter_list" with a list of about 60 client Mac-adresses and the parameter "mac_filter_policy" = allow

I have managed to get the Settings with the "WlanSettings" command, but unfortunately only the first device that I have entered manually appears in the json-file

Are there any ideas ??

Isaksson commented 11 months ago

Hello. Just to verify, I created a "fake" WLan and added 4 MAC manually, just to see what happens in the Wlan Settings command, but in that i managed to see all 4 addresses that I configured for that WLan.

Could you just verify if you can see all your addresses in that array when running the command.

image

austrogaucho commented 11 months ago

Uups, you are right!

I get the same result - all clients show up! on my first try I converted the json object into an xlsx-file and there appears only the first client!

So up to the next step, can you kindly guide me on how I can populate most of my 60 clients into that list?

thanks!

Roman

Isaksson commented 11 months ago

That's good, then we are on the same page :)

I am looking into your other issue right now, there is no command to add to mac_filter_list today, but I will see what I could do, I will keep you updated in this thread.

austrogaucho commented 11 months ago

thanks for your great support, how can I buy you a beer? Skål!

Isaksson commented 11 months ago

I have now published version 0.3.5 that includes two new commands, the first one is almost the same as the one you use now 'WLanSettings' but you could add the WLan id to just get your selected WLan settings

Example: { command: "getwlansetting", wlan_id: "64de5963e803f12c441d13b2"}

And the next command allow you to set the Filter Type, Allow or Deny and also add an array of MAC addresses, this will remove the current list so you have to add them all in one request.

Example { command: "setwlanfilter", wlan_id: "64de5963e803f12c441d13b2", policy: "allow", mac: ['00:b0:d0:63:c2:16','00:b0:d0:63:c2:17','00:b0:d0:63:c2:18'] }

Let me know what you think when you have tried this new commands, and if its a success then lets celebrate with a beer tomorrow :) Skål.

austrogaucho commented 11 months ago

Servus Kris!

it works like a charm! I just pushed the MAC addresses of 80 clients in no time into to the WiFi config!

thanks a bunch!

thank good its Friday - time for a beer! I have some bottles of cold bavarian-beer in my fridge, I wish I could offer you one!

Skål! Prost!

Isaksson commented 11 months ago

Perfect, great that it works :) Thanks for the offer and the gift.

People like you keeps this project growing.