Kane610 / aiounifi

Asynchronous library to communicate with Unifi Controller
MIT License
57 stars 49 forks source link

Add ability to activate/deactivate traffic rules #560

Closed lensherm closed 6 months ago

lensherm commented 6 months ago

In the Unifi controller (UDMP in my case), there is a Traffic Rules section under Settings-->Security

As an example, I created a number of these rules block access to Youtube and separately online games on my kids' devices, but that's just an example.

Proceeding with my example, as I only want these rules to be enabled when the kids are doing their homework, I created some HA automations using the below in Node Red, but ideally, it would be nice to be able to have an on/off switch for each of the rules in the list in HA directly. [node-red-contrib-unifi](https://github.com/Isaksson/node-red-contrib-unifi)

In Node Red the payload looks something like this: msg.payload = { command: "enableTrafficManagementRule", rule_id: "12345678901234567890" }

where each rule is identified by it's unique rule_id

and the list of rules can be gotten by calling getTrafficManagementRule

lensherm commented 6 months ago

Upon further digging, it looks like this might have already been discussed in https://github.com/Kane610/aiounifi/issues/323

Regardless, it would be really nice to have this functionality

Kane610 commented 6 months ago

It's being worked on here https://github.com/home-assistant/core/pull/104671

lensherm commented 6 months ago

@Kane610 Thank you! Much appreciated!

lensherm commented 6 months ago

Duplicate per

It's being worked on here home-assistant/core#104671