{"id":15170368,"url":"https://github.com/sirkirby/unifi-network-rules","last_synced_at":"2025-10-06T01:10:27.379Z","repository":{"id":256843839,"uuid":"856448738","full_name":"sirkirby/unifi-network-rules","owner":"sirkirby","description":"Allows you to manage, backup, and automate your UDM firewall policies, routes, and rules in Home Assistant","archived":false,"fork":false,"pushed_at":"2025-09-26T19:58:20.000Z","size":627,"stargazers_count":35,"open_issues_count":4,"forks_count":5,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-09-26T21:28:21.092Z","etag":null,"topics":["automation","home-assistant","integration","unifi"],"latest_commit_sha":null,"homepage":"https://chriskirby.net/automate-your-unifi-network-firewall-and-traffic-rules-with-home-assistant/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sirkirby.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-09-12T15:38:02.000Z","updated_at":"2025-09-25T12:38:02.000Z","dependencies_parsed_at":"2024-09-13T11:06:14.889Z","dependency_job_id":"185e63f6-bbf5-4a7f-a501-9c725ae5a95e","html_url":"https://github.com/sirkirby/unifi-network-rules","commit_stats":{"total_commits":9,"total_committers":2,"mean_commits":4.5,"dds":0.4444444444444444,"last_synced_commit":"f39942626fa3a5ffce9810732aa94fefca659720"},"previous_names":["sirkirby/ha-udm-rule-manager","sirkirby/unifi-network-rules"],"tags_count":63,"template":false,"template_full_name":null,"purl":"pkg:github/sirkirby/unifi-network-rules","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sirkirby%2Funifi-network-rules","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sirkirby%2Funifi-network-rules/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sirkirby%2Funifi-network-rules/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sirkirby%2Funifi-network-rules/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sirkirby","download_url":"https://codeload.github.com/sirkirby/unifi-network-rules/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sirkirby%2Funifi-network-rules/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278543854,"owners_count":26004215,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-05T02:00:06.059Z","response_time":54,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["automation","home-assistant","integration","unifi"],"created_at":"2024-09-27T08:01:35.598Z","updated_at":"2025-10-06T01:10:27.366Z","avatar_url":"https://github.com/sirkirby.png","language":"Python","funding_links":["https://www.buymeacoffee.com/sirkirby"],"categories":["Home Automation"],"sub_categories":["Home Assistant"],"readme":"# UniFi Network Rules\n\n[![License][license-shield]](LICENSE)\n![Project Maintenance][maintenance-shield]\n[![GitHub Activity][commits-shield]][commits]\n\n[![GitHub Release][release-shield]][releases]\n[![issues][issues-shield]][issues-link]\n[![validate-badge]][validate-workflow]\n\n[![\"Buy Me A Coffee\"](https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png)](https://www.buymeacoffee.com/sirkirby)\n\nUniFi Network Rules is a custom integration for Home Assistant that integrates with your UniFi Dream Machine/Router to both provide and help you create useful interactions and automations for your Home Lab. The goal of this integration is to simplify policy and rule management for real world use cases. I built this because I wanted to unlock the power of my UniFi firewall. From simple things like screen time and game server access controls for my kids, to more advanced like getting notified when a critical rule is changed and automatically backing up your rules. And most importantly, make all of this easy to use and share with anyone in your home or home lab. I hope you find it useful!\n\n## What this integration provides\n\n### Switches for enabling and disabling rules and configuration\n\n- Firewall policies (zone-based firewall)\n- Traffic/firewall rules (non-zone-based firewall)\n- Port Forwarding rules\n- Traffic Routes \u0026 Traffic Route Kill Switch\n- Static Routes (network routing configurations)\n- NAT rules\n- QoS rules\n- OpenVPN Client and Server configurations\n- WireGuard Client and Server configurations\n- UniFi Device LEDs\n- WLAN SSIDs\n- Port Profiles (switch port configurations)\n- Networks (network configurations)\n\n### Advanced automations powered by [Custom Triggers](#smart-polling-triggers) and [Custom Services](#services)\n\nThe included [Triggers](#smart-polling-triggers) and [Services](#services) provide a framework for building custom UDM automations to cover a wide range of use cases. For example, you can [backup](#3-backup-trigger---save-config-on-important-changes) and [restore](#full-and-selective-restore) all rules when a change is detected, ensure game server port [forwarding rules get disabled](#2-game-server-management---auto-disable-after-hours) at bedtime, [create and maintain an audit log](#1-security-monitoring---alert-on-unexpected-rule-changes) of all UDM configuration changes, and so much more. Get inspired by the many examples below.\n\n\u003e Questions, ideas, help, or feedback? [Discussions](https://github.com/sirkirby/unifi-network-rules/discussions). Errors or bugs? [Issues](https://github.com/sirkirby/unifi-network-rules/issues).\n\n## Installation\n\n[![Open your Home Assistant instance and open a repository inside the Home Assistant Community Store.](https://my.home-assistant.io/badges/hacs_repository.svg)](https://my.home-assistant.io/redirect/hacs_repository/?owner=sirkirby\u0026repository=UniFi-network-rules\u0026category=integration)\n\n[![hacs][hacsbadge]][hacs]\n[![Discord][discord-shield]][discord]\n[![Community Forum][forum-shield]][forum]\n\nIf you don't or can't use HACS, alternatively, copy the `custom_components/unifi_network_rules` directory to your `config/custom_components` directory.\n\nI recommend installing the Studio Code Server addon to make it easier to copy in the custom component directly in the Home Assistant UI. `Settings -\u003e Add-ons -\u003e Studio Code Server -\u003e Install`. Then turn on `Show in Sidebar`.\n\nTHEN\n\n1. Restart Home Assistant.\n2. In the Home Assistant configuration page, click on \"Integrations\".\n3. Click on the \"+\" button in the bottom right corner.\n4. Search for \"UniFi Network Rule Manager\" and select it.\n5. Enter credentials of a local admin user on your UDM and click on the \"Submit\" button.\n\n### Requirements\n\n- A UniFi device running network application 9.0.92 or later.\n- A local account with Admin privileges to the network application. Must not be a UniFi Cloud account.\n- Home Assistant 2025.2 or later with network access to the UniFi device.\n\n## Configuration\n\n**Host**: The IP address or hostname of your UniFi Device. ex. `192.168.1.1` or `udm.mydomain.com`\n\n**Username**: The local admin account on the UDM. ex. `admin`\n\n**Password**: The password for the UDM account. ex. `password`\n\n**Site**: The UniFi site name to connect to (defaults to \"default\" if not specified).\n\n**Update Interval**: The automatic refresh interval in minutes. Can be longer since updates real-time.\n\n**Verify SSL**: Enable SSL certificate verification (defaults to disabled for self-signed certificates).\n\n### Advanced Smart Polling Options\n\nThese options configure the intelligent polling system that provides near real-time updates. You can access these settings by going to **Settings → Devices \u0026 Services → UniFi Network Rules → Configure → Options**.\n\n**Base Interval** (default: 300 seconds): The standard polling interval when the system is idle and no recent activity has been detected. This is the baseline refresh rate that maintains system state without excessive API calls.\n\n**Active Interval** (default: 30 seconds): The faster polling interval used when recent activity has been detected. The system automatically switches to this mode after detecting changes to maintain responsiveness.\n\n**Realtime Interval** (default: 10 seconds): The fastest polling interval used immediately after detecting changes, providing near real-time updates. The system uses this for a short period after activity before stepping down to the active interval.\n\n**Activity Timeout** (default: 120 seconds): How long (in seconds) the system remains in active/realtime polling mode after the last detected activity before returning to the base interval. This balances responsiveness with resource usage.\n\n**Debounce Seconds** (default: 10 seconds): The debounce window for Home Assistant-initiated changes. When you toggle a switch in HA, the system waits this long before polling to allow the change to propagate, preventing unnecessary API calls from rapid successive changes.\n\n**Optimistic Timeout** (default: 15 seconds): Maximum time to show optimistic state updates in the UI before requiring confirmation from the UniFi controller. This provides instant feedback while ensuring accuracy.\n\n\u003e **💡 Tip**: The default values work well for most setups. Only adjust these if you need faster response times (lower values) or want to reduce API load (higher values). The smart polling system automatically adapts based on activity levels.\n\n## Services\n\nThe integration provides several services focused on managing and automating existing UniFi Network rules:\n\n### Getting Started with Services\n\nHere are some examples of how to get started with services in Home Assistant:\n\n#### Example 1: Using an Input Button Helper with Automation\n\n1. Go to Settings → Devices \u0026 Services → Helpers\n2. Add a Button helper (e.g., \"Refresh UniFi Rules\")\n3. Create an automation that triggers when the button is pressed\n4. Use the service in the automation's action\n\nExample automation for refresh:\n\n```yaml\nalias: Backup UniFi Network Rules\ndescription: \u003e-\n  Dumps all policy, rule, and route JSON state to a file in the ha config\n  directory\ntriggers:\n  - trigger: state\n    entity_id:\n      - input_button.backup_unr\nconditions: []\nactions:\n  - action: unifi_network_rules.backup_rules\n    metadata: {}\n    data:\n      filename: unr_daily_backup.json\nmode: single\n```\n\n#### Example 2: Using Scripts with a Lovelace Button Card (More Customizable)\n\nFirst, create a script in your Settings → Automations \u0026 Scenes → Scripts:\n\n```yaml\nsequence:\n  - sequence:\n      - action: unifi_network_rules.backup_rules\n        metadata: {}\n        data:\n          filename: my_custom_unr_backup.json\nalias: Backup my UniFi Rules\ndescription: Custom script that will backup all rules and routes imported from your UDM\n```\n\nThen add a button card to your dashboard that references the script:\n\n```yaml\nshow_name: true\nshow_icon: true\ntype: button\ntap_action:\n  action: perform-action\n  perform_action: script.backup_my_unifi_rules\n  target: {}\nname: Backup my Network Rules\nicon: mdi:cloud-upload\n```\n\nSee below for more automation examples using [Services with Triggers](#service-automation-examples).\n\n### Services Reference\n\n| Service | Description | Parameters |\n|---------|-------------|------------|\n| `unifi_network_rules.refresh_rules` | Manually refresh all network rules from the UniFi controller | None |\n| `unifi_network_rules.backup_rules` | Create a backup of all firewall policies and traffic routes | `filename`: Name of the backup file to create |\n| `unifi_network_rules.restore_rules` | Restore rules from a backup file | `filename`: Backup file to restore from\u003cbr\u003e`name_filter`: (Optional) Only restore rules containing this string\u003cbr\u003e`rule_ids`: (Optional) List of specific rule IDs to restore\u003cbr\u003e`rule_types`: (Optional) List of rule types to restore (policy, port_forward, traffic_route, qos_rule, port_profile, network, static_route, nat) |\n| `unifi_network_rules.bulk_update_rules` | Enable or disable multiple rules by name pattern | `state`: true (enable) or false (disable)\u003cbr\u003e`name_filter`: String to match in rule names |\n| `unifi_network_rules.delete_rule` | Delete an existing firewall policy by ID | `rule_id`: ID of the rule to delete |\n| `unifi_network_rules.refresh_data` | Refresh data for a specific integration instance or all | `entry_id`: (Optional) Specific integration instance ID |\n| `unifi_network_rules.websocket_diagnostics` | Run diagnostics on WebSocket connections and try to repair if needed | None |\n| `unifi_network_rules.force_cleanup` | Force cleanup of all entities in the integration | None |\n| `unifi_network_rules.force_remove_stale` | Force removal of stale or broken entities | `remove_all`: (Optional) Remove all entities instead of just stale ones |\n| `unifi_network_rules.apply_template` | Apply a predefined rule template | `template_id`: ID of the template to apply\u003cbr\u003e`variables`: (Optional) Variables to use in the template |\n| `unifi_network_rules.save_template` | Save a rule as a template for reuse | `rule_id`: UniFi rule ID (use `trigger.rule_id` in automations)\u003cbr\u003e`template_id`: ID to save the template as\u003cbr\u003e`rule_type`: (Optional) Type of rule - auto-detected if not provided |\n| `unifi_network_rules.toggle_rule` | Toggle a specific rule on or off | `rule_id`: UniFi rule ID (use `trigger.rule_id` in automations)\u003cbr\u003e`rule_type`: (Optional) Type of the rule - auto-detected if not provided |\n\n\u003e **Note**: For `rule_types` parameter, you can specify one or more of: `policy` (firewall policies), `port_forward` (port forwarding rules), `traffic_route` (policy-based routes), `qos_rule` (quality of service rules), `port_profile` (switch port profiles), or `network` (network configurations), static_route (static routes), or nat (NAT rules). While not all of these are strictly \"rules,\" they are all toggleable configuration entities. See the \"Understanding Rule Types\" section for more details.\n\n## Smart Polling Triggers\n\n\u003e **⚠️ BREAKING CHANGE**: Legacy triggers (`rule_enabled`, `rule_disabled`, `rule_changed`, `rule_deleted`, `device_changed`) have been **removed** and replaced with a unified `unr_changed` trigger system. See [Migration Guide](#migration-options) below.\n\nUniFi Network Rules provides a **unified trigger system** powered by intelligent polling that gives you near real-time notifications when network rules change, regardless of whether the changes originate from Home Assistant or directly from the UniFi console.\n\n### Key Features\n\n- **🔄 Bi-Directional Monitoring**: Triggers fire for changes made both from Home Assistant and directly from the UniFi console\n- **⚡ Smart Polling**: Intelligent polling with dynamic intervals (10s during activity, 5min when idle)\n- **🎯 Unified Interface**: Single `unr_changed` trigger with powerful filtering options\n- **📊 Rich Data**: Each trigger includes entity IDs, old/new states, timestamps, and metadata\n- **🛡️ Reliable Detection**: Centralized state comparison ensures accurate change detection\n- **🚀 Debounced Updates**: Batches rapid changes into single operations to prevent API spam\n\n### The Unified Trigger\n\n**All events now use a single trigger type:** `unr_changed`\n\n| Filter | Description | Example |\n|--------|-------------|---------|\n| `entity_id` | Monitor specific entity | `switch.unr_firewall_policy_abc123` |\n| `change_type` | Monitor entity type | `firewall_policy`, `traffic_route`, `port_forward` |\n| `change_action` | Monitor action type | `enabled`, `disabled`, `modified`, `created`, `deleted` |\n| `name_filter` | Filter by entity name | `\"Guest Network\"` (case-insensitive substring) |\n\n### Supported Entity Types\n\n- **Firewall Policies** (`firewall_policy`): Zone-based firewall rules\n- **Port Forwards** (`port_forward`): Port forwarding rules  \n- **Traffic Routes** (`traffic_route`): Network routing rules\n- **Static Routes** (`route`): Static network routing configurations\n- **Traffic Rules** (`traffic_rule`): Legacy firewall rules\n- **QoS Rules** (`qos_rule`): Quality of Service rules\n- **VPN Clients** (`vpn_client`): VPN client configurations\n- **VPN Servers** (`vpn_server`): VPN server configurations\n- **WLANs** (`wlan`): Wireless network configurations\n- **Devices** (`device`): Device LED controls\n- **Port Profiles** (`port_profile`): Switch port profiles\n- **Networks** (`network`): Network configurations\n- **NAT Rules** (`nat`): UniFi NAT (SNAT/DNAT) rules\n\n### Setting Up Triggers\n\n#### YAML Configuration\n\n```yaml\ntriggers:\n  - trigger: unifi_network_rules\n    type: unr_changed\n    change_type: firewall_policy    # Optional: filter by entity type\n    change_action: enabled          # Optional: filter by action type\n    name_filter: \"Minecraft\"       # Optional: filter by entity name\n```\n\n#### Advanced Examples\n\n```yaml\n# Monitor any firewall policy change\ntriggers:\n  - trigger: unifi_network_rules\n    type: unr_changed\n    change_type: firewall_policy\n\n# Monitor specific entity\ntriggers:  \n  - trigger: unifi_network_rules\n    type: unr_changed\n    entity_id: switch.unr_firewall_policy_abc123\n\n# Monitor multiple actions\ntriggers:\n  - trigger: unifi_network_rules\n    type: unr_changed\n    change_action: [enabled, disabled]\n    name_filter: \"Gaming\"\n```\n\n### Available Trigger Data\n\nEach trigger provides rich data you can use in conditions and actions:\n\n```yaml\n# Available in automations as trigger.*\nplatform: \"unifi_network_rules\"         # Platform name\ntype: \"unr_changed\"                      # Trigger type (always unr_changed)\nentity_id: \"switch.unr_firewall_policy_abc123\"  # HA entity ID\nunique_id: \"unr_firewall_policy_abc123\"  # Unique identifier\nrule_id: \"64f1a2b3c4d5e6f7g8h9i0j1\"     # UniFi rule ID\nchange_type: \"firewall_policy\"           # Entity type that changed\nchange_action: \"enabled\"                 # What happened (enabled/disabled/modified/created/deleted)\nentity_name: \"Minecraft Server Access\"   # Human-readable entity name\nold_state: { ... }                       # Previous rule configuration\nnew_state: { ... }                       # New rule configuration  \ntimestamp: \"2025-08-27T10:30:00Z\"        # When the change occurred\nsource: \"polling\"                        # Always \"polling\" in new architecture\n```\n\n### Example Usage in Templates\n\n```yaml\n# Use trigger data in notifications\naction: notify.mobile_app\ndata:\n  title: \"🔥 Network Rule Changed\"\n  message: \u003e\n    {{ trigger.entity_name }} was {{ trigger.change_action }}\n    Entity: {{ trigger.entity_id }}\n    Time: {{ trigger.timestamp }}\n\n# Use trigger data in service calls\naction: unifi_network_rules.toggle_rule\ndata:\n  rule_id: \"{{ trigger.rule_id }}\"        # Clean UniFi rule ID from trigger\n  enabled: true\n\n# Example service calls\naction: unifi_network_rules.delete_rule\ndata:\n  rule_id: \"{{ trigger.rule_id }}\"        # Use trigger data for clean automation\n  \naction: unifi_network_rules.save_template  \ndata:\n  rule_id: \"{{ trigger.rule_id }}\"        # Consistent approach across all services\n  template_id: \"my_vpn_template\"\n```\n\n## Trigger Migration Guide 📝\n\n\u003e **Required for users upgrading from previous versions with legacy triggers**\n\n### Overview\n\n**Legacy triggers have been completely removed** in favor of a unified, more powerful `unr_changed` trigger system. This is a **breaking change** that requires updating your automation files.\n\n### Migration Options\n\n#### Option 1: Automated Migration (Recommended)\n\nUse the migration utility script to automatically convert your automations. The utility offers multiple workflows depending on your comfort level:\n\n##### Copy-and-Migrate Workflow (Safest - Recommended for Most Users)\n\nThis workflow is perfect if you need to download your automations file from Home Assistant. The easiest method is using the Visual Studio Code add-on:\n\n**Step-by-step using VS Code Add-on:**\n\n1. **Download your automations.yaml**:\n   - Install the [Visual Studio Code add-on](https://community.home-assistant.io/t/home-assistant-community-add-on-visual-studio-code/107863) from Home Assistant Community Add-ons\n   - Open VS Code in your browser and navigate to `/config/automations.yaml`\n   - Right-click the file and select \"Download\"\n\n2. **Run the migration**:\n\n   ```bash\n   python migrate_triggers.py --copy-migrate automations.yaml\n   ```\n\n3. **Review the migrated file** to ensure it looks correct\n\n4. **Upload the migrated file**:\n   - In VS Code, navigate to the `/config/` folder\n   - Drag and drop the migrated file to replace your existing `automations.yaml`\n   - Or right-click in the folder and select \"Upload Files\"\n\n5. **Restart Home Assistant**\n\n##### Additional Commands\n\n```bash\n# 1. Scan for legacy triggers\npython migrate_triggers.py --scan /config/automations.yaml\n\n# 2. Preview migration (dry-run)\npython migrate_triggers.py --migrate /config/automations.yaml --dry-run\n\n# 3. Apply migration (creates backup automatically)\npython migrate_triggers.py --migrate /config/automations.yaml --apply\n```\n\n##### Getting the Migration Utility\n\nSince the migration utility is not included in the integration itself (it's only needed once), you have a few options:\n\n1. **Download from GitHub** (Recommended):\n   - Go to the [UniFi Network Rules repository](https://github.com/sirkirby/unifi-network-rules)\n   - Download `scripts/migrate_triggers.py` to your computer\n   - Ensure you have Python 3 and PyYAML installed (`pip install pyyaml`)\n\n2. **Clone the repository**:\n\n   ```bash\n   git clone https://github.com/sirkirby/unifi-network-rules.git\n   cd unifi-network-rules\n   python scripts/migrate_triggers.py --help\n   ```\n\n##### Alternative ways to download your Automations File from Home Assistant\n\nIf you don't have direct access to your Home Assistant files, you can download them through the web interface:\n\n1. **Using File Editor Add-on**:\n   - Install the \"File Editor\" add-on from the Add-on Store\n   - Navigate to `/config/automations.yaml`\n   - Copy the content and save it to a local file\n\n2. **Using SSH/SCP** (Advanced):\n\n   ```bash\n   scp homeassistant@your-ha-ip:/config/automations.yaml ./automations.yaml\n   ```\n\n**After migration, upload the migrated file back:**\n\n- **VS Code Add-on**: Drag and drop the migrated file into the `/config/` folder, or right-click and select \"Upload Files\"\n- **File Editor Add-on**: Copy and paste the migrated content into the editor\n- **SSH/SCP**: Use `scp` to upload the migrated file back to your Home Assistant system\n\n##### Migration Utility Troubleshooting\n\n**Python/PyYAML not installed:**\n\n```bash\n# Install Python 3 (if needed)\n# On Windows: Download from python.org\n# On macOS: brew install python\n# On Linux: apt-get install python3 python3-pip\n\n# Install PyYAML\npip install pyyaml\n# or\npip3 install pyyaml\n```\n\n**\"No legacy triggers found\" but you have v3.x automations:**\n\n- Ensure you're running the utility on the correct automations.yaml file\n- Check that your automations use `platform: unifi_network_rules` (not just any triggers)\n- Verify your automations use legacy trigger types: `rule_enabled`, `rule_disabled`, `rule_changed`, `rule_deleted`, or `device_changed`\n\n**Need help?**\n\n- Use `python migrate_triggers.py --help` for command line options\n- Use `python migrate_triggers.py --scan your_file.yaml` to see what would be migrated\n- [Open a discussion](https://github.com/sirkirby/unifi-network-rules/discussions) if you need assistance\n\n#### Option 2: Manual Migration\n\nUpdate your automation triggers manually using the examples below.\n\n### Common Migration Patterns\n\n#### Basic State Changes\n\n```yaml\n# OLD (removed)\ntrigger:\n  platform: unifi_network_rules\n  type: rule_enabled\n  rule_type: firewall_policies\n\n# NEW (required)\ntrigger:\n  platform: unifi_network_rules\n  type: unr_changed\n  change_type: firewall_policy\n  change_action: enabled\n```\n\n#### Rule Disabled\n\n```yaml  \n# OLD (removed)\ntrigger:\n  platform: unifi_network_rules\n  type: rule_disabled\n  rule_id: \"abc123\"\n\n# NEW (required)\ntrigger:\n  platform: unifi_network_rules\n  type: unr_changed\n  entity_id: \"switch.unr_firewall_policy_abc123\"  # Convert rule_id to entity_id\n  change_action: disabled\n```\n\n#### Any Rule Change\n\n```yaml\n# OLD (removed) \ntrigger:\n  platform: unifi_network_rules\n  type: rule_changed\n  rule_type: port_forwards\n\n# NEW (required)\ntrigger:\n  platform: unifi_network_rules\n  type: unr_changed\n  change_type: port_forward\n  change_action: [enabled, disabled, modified]\n```\n\n#### Rule Deletion\n\n```yaml\n# OLD (removed)\ntrigger:\n  platform: unifi_network_rules\n  type: rule_deleted\n  name_filter: \"Guest*\"\n\n# NEW (required)\ntrigger:\n  platform: unifi_network_rules\n  type: unr_changed\n  change_action: deleted\n  name_filter: \"Guest\"\n```\n\n#### Device Changes (LED)\n\n```yaml\n# OLD (removed)\ntrigger:\n  platform: unifi_network_rules\n  type: device_changed\n  device_id: \"aa:bb:cc:dd:ee:ff\"\n  change_type: \"led_toggled\"\n\n# NEW (required)\ntrigger:\n  platform: unifi_network_rules\n  type: unr_changed\n  change_type: device\n  entity_id: \"switch.unr_device_aabbccddeeff_led\"\n  change_action: [enabled, disabled]\n```\n\n### Benefits of New System\n\n- **🎯 More Precise Filtering**: Target specific entities, actions, or patterns\n- **📊 Richer Data**: Access to entity IDs, timestamps, and structured state data\n- **🔧 Simpler Configuration**: One trigger type instead of five\n- **⚡ Better Performance**: Smart polling reduces API load while maintaining responsiveness  \n- **🛡️ More Reliable**: No WebSocket dependency, consistent behavior\n\n### Need Help?\n\n- **Questions about migration?** [Open a Discussion](https://github.com/sirkirby/unifi-network-rules/discussions)\n- **Found a migration issue?** [Report a Bug](https://github.com/sirkirby/unifi-network-rules/issues)\n- **See examples below** for updated automation patterns\n\n## Trigger Automation Examples\n\n### 1. Security Monitoring - Alert on Unexpected Rule Changes\n\nCreate rich notifications when firewall policies are modified:\n\n```yaml\nalias: Security Alert - Firewall Changes\ndescription: Alert when firewall rules are modified outside of HA\ntriggers:\n  - trigger: unifi_network_rules\n    type: unr_changed\n    change_type: firewall_policy\n    change_action: [modified, deleted]\nconditions: []\nactions:\n  - action: notify.mobile_app_admin_phone\n    data:\n      title: \"🚨 Network Security Alert\"\n      message: \u003e\n        Firewall rule \"{{ trigger.entity_name }}\" was {{ trigger.change_action }}\n        Entity: {{ trigger.entity_id }}\n        Time: {{ trigger.timestamp }}\n      data:\n        priority: high\n        category: security\nmode: single\n```\n\nUse the `new_state` and `old_state` to get the full details of the rule change. (check your backup file to see what is available for each rule type)\n\n```yaml\nalias: UniFi Policy Changed\ndescription: UniFi Rule Changed Trigger\ntriggers:\n  - trigger: unifi_network_rules\n    type: unr_changed\n    change_type: firewall_policy\n    change_action: [enabled, disabled, modified]\nconditions: []\nactions:\n  - data:\n      title: \u003e-\n        Firewall Policy {{ trigger.entity_name }} was {{ trigger.change_action.upper() }}\n      message: |-\n        {% if trigger.new_state %}\n          The {{ trigger.new_state.action }} policy '{{ trigger.entity_name }}' was updated. It is now {{ 'enabled' if trigger.new_state.enabled else 'disabled' }}.\n        {% else %}\n          The policy '{{ trigger.entity_name }}' was deleted.\n        {% endif %}\n    action: persistent_notification.create\nmode: single\n```\n\n### 2. Game Server Management - Auto-Disable After Hours\n\nAutomatically disable game server access when enabled outside of allowed hours:\n\n```yaml\nalias: Game Server Auto-Disable\ndescription: Disable Minecraft server if enabled during school hours\ntriggers:\n  - trigger: unifi_network_rules\n    type: unr_changed\n    change_action: enabled\n    name_filter: \"Minecraft\"\nconditions:\n  - condition: time\n    after: \"08:00:00\"\n    before: \"15:30:00\"\n  - condition: time\n    weekday:\n      - mon\n      - tue\n      - wed\n      - thu\n      - fri\nactions:\n  - delay:\n      minutes: 5  # Give a 5-minute grace period\n  - action: unifi_network_rules.toggle_rule\n    data:\n      rule_id: \"{{ trigger.rule_id }}\"\n      enabled: false\n  - action: notify.family_devices\n    data:\n      title: \"🎮 Game Server Disabled\"\n      message: \"Minecraft server was automatically disabled during school hours\"\nmode: single\n```\n\n### 3. Backup Trigger - Save Config on Important Changes\n\nAutomatically backup network rules when critical changes are made by combining triggers and services:\n\n```yaml\nalias: Auto-Backup on Critical Changes\ndescription: Backup rules when important firewall or VPN changes occur\ntriggers:\n  - trigger: unifi_network_rules\n    type: unr_changed\n    change_type: firewall_policy\n    change_action: [modified, deleted]\n  - trigger: unifi_network_rules\n    type: unr_changed\n    change_type: vpn_server\n    change_action: [enabled, disabled, modified]\nconditions:\n  # Only backup if it's been more than 1 hour since last backup\n  - condition: template\n    value_template: \u003e\n      {% set last = state_attr('automation.auto_backup_on_critical_changes','last_triggered') %}\n      {% set last_ts = last.timestamp() if last else 0 %}\n      {{ (now().timestamp() - last_ts) \u003e 3600 }}\nactions:\n  - action: unifi_network_rules.backup_rules\n    data:\n      filename: \"auto_backup_{{ now().strftime('%Y%m%d_%H%M') }}.json\"\n  - action: persistent_notification.create\n    data:\n      title: \"📁 Network Rules Backed Up\"\n      message: \u003e\n        Automatic backup created due to {{ trigger.change_action }} \n        of {{ trigger.change_type.replace('_', ' ').title() }}: \"{{ trigger.entity_name }}\"\nmode: single\n```\n\n### 4. VPN Connection Monitoring\n\nMonitor specificVPN client connections and reconnect them when they disconnect:\n\n```yaml\nalias: Reconnect VPN Client\ndescription: Monitor when a specific VPN client disconnects and reconnect\ntriggers:\n  - trigger: unifi_network_rules\n    type: unr_changed\n    change_type: vpn_client\n    change_action: disabled\n    name_filter: \"NordVPN-Chicago\"\nactions:\n  - action: unifi_network_rules.toggle_rule\n    data:\n      rule_id: \"{{ trigger.rule_id }}\"      # Direct UniFi ID (recommended)\n      enabled: true\n      # Note: rule_type auto-detected from ID, no need to specify\n  - action: persistent_notification.create\n    data:\n      title: \"🔒 Attempting to reconnect VPN\"\n      message: \u003e\n        VPN \"{{ trigger.entity_name }}\" was disconnected, attempting to reconnect\nmode: parallel\n```\n\n```yaml\nalias: VPN Client connected\ndescription: Notify when VPN clients connect\ntriggers:\n  - trigger: unifi_network_rules\n    type: unr_changed\n    change_type: vpn_client\n    change_action: enabled\nactions:\n  - action: persistent_notification.create\n    data:\n      title: \"🔒 VPN Connected\"\n      message: \u003e\n        VPN \"{{ trigger.entity_name }}\" was connected\n```\n\n### 5. Kids' Device Management with Notifications\n\nMonitor and log when parental control rules change:\n\n```yaml\nalias: Parental Control Monitor\ndescription: Track changes to kids' internet access rules\ntriggers:\n  - trigger: unifi_network_rules\n    type: unr_changed\n    change_action: [enabled, disabled]\n    name_filter: \"Kid\"\n  - trigger: unifi_network_rules\n    type: unr_changed\n    change_action: modified\n    name_filter: \"Block\"\nactions:\n  - action: logbook.log\n    data:\n      name: \"Parental Controls\"\n      message: \u003e\n        {{ trigger.entity_name }} was {{ trigger.change_action }}\n        {% if trigger.change_action == 'enabled' %}\n        ✅ Internet access restored\n        {% elif trigger.change_action == 'disabled' %}\n        🚫 Internet access blocked\n        {% else %}\n        🔧 Settings modified\n        {% endif %}\n      entity_id: automation.parental_control_monitor\n  - action: notify.parents_devices\n    data:\n      title: \"👨‍👩‍👧‍👦 Parental Control Update\"\n      message: \"{{ trigger.entity_name }} - {{ trigger.change_action.title() }}\"\nmode: parallel\n```\n\n### 6. Network Health Dashboard\n\nCreate input helpers to track network rule changes on your dashboard:\n\n```yaml\nalias: Update Network Stats\ndescription: Update dashboard counters for network changes\ntriggers:\n  - trigger: unifi_network_rules\n    type: unr_changed\n    change_action: [enabled, disabled, modified]\nactions:\n  - action: counter.increment\n    target:\n      entity_id: counter.network_rule_changes\n  - action: input_text.set_value\n    target:\n      entity_id: input_text.last_network_change\n    data:\n      value: \u003e\n        {{ now().strftime('%H:%M') }}: {{ trigger.entity_name }} ({{ trigger.change_action }})\n  - action: input_datetime.set_datetime\n    target:\n      entity_id: input_datetime.last_rule_change\n    data:\n      datetime: \"{{ now() }}\"\nmode: parallel\n```\n\n### 7. Static Route Management - Network Connectivity Monitoring\n\nMonitor static route changes and ensure critical network paths remain active:\n\n```yaml\nalias: Critical Route Monitor\ndescription: Alert when critical static routes are disabled\ntriggers:\n  - trigger: unifi_network_rules\n    type: unr_changed\n    change_type: route\n    change_action: disabled\n    name_filter: \"Critical\"\nconditions: []\nactions:\n  - action: notify.admin_team\n    data:\n      title: \"⚠️ Critical Network Route Disabled\"\n      message: \u003e\n        ALERT: Critical network route \"{{ trigger.entity_name }}\" was disabled.\n        Destination: {{ trigger.old_state.destination if trigger.old_state else \"Unknown\" }}\n        This may affect network connectivity to critical services.\n      data:\n        priority: high\n        category: network\n  - action: persistent_notification.create\n    data:\n      title: \"Network Route Alert\"\n      message: \u003e\n        Critical route {{ trigger.entity_name }} was disabled at {{ trigger.timestamp }}\nmode: single\n```\n\n### Advanced Filtering Examples\n\n#### Filter by Multiple Rule Types\n\n```yaml\ntriggers:\n  - trigger: unifi_network_rules\n    type: unr_changed\n    change_type: port_forward\n    change_action: [enabled, disabled, modified]\n  - trigger: unifi_network_rules\n    type: unr_changed\n    change_type: vpn_client\n    change_action: [enabled, disabled, modified]\n  - trigger: unifi_network_rules\n    type: unr_changed\n    change_type: route\n    change_action: [enabled, disabled, modified]\n```\n\n#### Filter by Specific Rule Names\n\n```yaml\ntriggers:\n  - trigger: unifi_network_rules\n    type: unr_changed\n    change_action: enabled\n    name_filter: \"Gaming\"  # Matches any rule containing \"Gaming\"\n```\n\n#### Monitor Specific Entity\n\n```yaml\ntriggers:\n  - trigger: unifi_network_rules\n    type: unr_changed\n    entity_id: \"switch.unr_firewall_policy_abc123\"  # Monitor one specific entity\n    change_action: [enabled, disabled, modified]\n```\n\n### Best Practices for Triggers\n\n1. **Use Specific Filters**: Filter triggers to avoid unnecessary automation runs\n2. **Add Conditions**: Use time, state, or template conditions to refine when automations run\n3. **Set Appropriate Modes**: Use `single`, `parallel`, or `queued` based on your needs\n4. **Log Important Changes**: Use logbook entries for audit trails\n5. **Test Thoroughly**: Test triggers with both HA-initiated and console-initiated changes\n6. **Monitor Performance**: Triggers are real-time, so ensure your automations are efficient\n\n### Troubleshooting Triggers\n\n- **VS Code Validation Errors**: The automation validator in HA 2025.7.0 doesn't recognize custom trigger platforms yet, causing false validation errors. The triggers work correctly despite these warnings.\n- **UI Shows \"Unknown\"**: The automation UI doesn't display custom trigger options. Use YAML configuration as shown in the examples above.\n- **Enable Debug Logging**: Set `LOG_TRIGGERS = True` in `const.py` for detailed trigger logs\n- **Check WebSocket Connection**: Triggers require active WebSocket connection to UniFi OS\n- **Verify Permissions**: Ensure your UniFi user has admin access to receive all rule change events\n- **Test Both Sources**: Verify triggers work for both HA-initiated and console-initiated changes\n\n## Service Automation Examples\n\n### Automated Daily Backup\n\n```yaml\nalias: Backup UniFi Network Rules\ndescription: \u003e-\n  Creates a daily backup of all policy, rule, and route JSON state to a file in \n  the Home Assistant config directory every day at 2:00 AM\ntriggers:\n  - trigger: time_pattern\n    hours: \"2\"\nconditions: []\nactions:\n  - action: unifi_network_rules.backup_rules\n    metadata: {}\n    data:\n      filename: unr_daily_backup.json\nmode: single\n```\n\n### Full and Selective restore\n\nFully restore the state of all policies\n\n```yaml\nalias: Restore all policies from last backup\ndescription: Restores the backed-up state of all policies, including zones, devices, objects, etc.\ntriggers:\n  - trigger: state\n    entity_id:\n      - input_button.restore_unr\nconditions: []\nactions:\n  - action: unifi_network_rules.restore_rules\n    metadata: {}\n    data:\n      filename: unr_daily_backup.json\nmode: single\n```\n\nSelectively restore rules based on name and type\n\n```yaml\nalias: Restore Kid Downtime Policies\ndescription: Restores the backed-up state of the policies that contain the name `Block Kid`\ntriggers:\n  - trigger: state\n    entity_id:\n      - input_button.restore_unr\nconditions: []\nactions:\n  - action: unifi_network_rules.restore_rules\n    metadata: {}\n    data:\n      filename: unr_daily_backup.json\n      name_filter: Block Kid\n      rule_types:\n        - policy\nmode: single\n```\n\n### Block Kid's devices at bedtime\n\nEvery night at 11PM, Policies or Rules that contain the name \"Block Kid Internet\" will `enable` and send a notification to Chris's iPhone\n\n```yaml\nalias: Daily Device Downtime\ndescription: Block kid devices at bedtime daily\ntriggers:\n  - trigger: time_pattern\n    hours: \"23\"\nconditions: []\nactions:\n  - action: unifi_network_rules.bulk_update_rules\n    metadata: {}\n    data:\n      state: true\n      name_filter: Block Kid internet\n  - action: notify.mobile_app_chrisiphone\n    metadata: {}\n    data:\n      message: Kids Device Downtime Enabled\n      title: Daily Device Downtime\nmode: single\n```\n\n### Temporarily Enable Game Server Access\n\n```yaml\nalias: Turn Off Minecraft Server Port after 2 hours\ndescription: \u003e-\n  We don't want to leave this port open indefinitely, just leave open for a\n  normal gaming session, then automatically turn off.\ntriggers:\n  - trigger: state\n    entity_id:\n      - switch.port_forward_minecraft_10_1_1_75_4882\n    from: \"off\"\n    to: \"on\"\nconditions: []\nactions:\n  - delay:\n      hours: 2\n      minutes: 0\n      seconds: 0\n      milliseconds: 0\n  - action: switch.turn_off\n    metadata: {}\n    data: {}\n    target:\n      entity_id: switch.port_forward_minecraft_10_1_1_75_4882\nmode: single\n```\n\nThis automation uses a helper to toggle port forwarding access to a game server. When enabled, it automatically disables the port forwarding after 2 hours for security.\n\n## Tips for Using Services\n\n1. **Backup Organization**: Use descriptive filenames with timestamps:\n\n   ```yaml\n   filename: \"UniFi_rules_{{now().strftime('%Y%m%d_%H%M')}}.json\"\n   ```\n\n2. **Selective Restore**: When restoring rules, use filters to target specific rules:\n\n   ```yaml\n   action: unifi_network_rules.restore_rules\n   data:\n     filename: \"backup.json\"\n     name_filter: \"Guest\"  # Only restore guest-related rules\n     rule_types:\n       - policy  # Only restore firewall policies\n   ```\n\n3. **Bulk Updates**: Use naming conventions in UniFi to make bulk updates easier:\n   - Name related rules with common prefixes (e.g., \"Guest_\", \"IoT_\")\n   - Use the bulk_update_rules service with name_filter to manage groups of rules\n\n4. **Integration with Other Services**: Combine with other Home Assistant integrations:\n   - Use the Folder Watcher integration to monitor backup file changes\n   - Combine with the Google Drive Backup integration for offsite copies\n   - Set up notifications when rule states change\n\n## Understanding Rule Types\n\nThe UniFi Network Rules integration supports several types of rules:\n\n1. **Firewall Policies (policy)**: Zone-based firewall rules that control traffic between different security zones (WAN, LAN, Guest, etc.). These form the backbone of your network security.\n\n2. **Port Forwarding Rules (port_forward)**: Allow external traffic to reach specific internal devices and services by forwarding specific ports from your WAN to internal IP addresses.\n\n3. **Traffic Routes (route)**: Control how traffic is routed through your network, typically used for VPN routing or specific network destinations. Each traffic route has two components:\n   - The main switch that enables/disables the route\n   - A child \"kill switch\" that blocks all traffic if the route is down (prevents data leakage if your VPN disconnects)\n\n4. **Static Routes (route)**: Configure static network routes that define how traffic is routed between different network segments. These are fundamental routing table entries that determine network paths and can be enabled/disabled for network management and troubleshooting.\n\n5. **QoS Rules (qos_rule)**: Quality of Service rules that prioritize certain types of traffic on your network. These rules can ensure critical applications (like video conferencing) get bandwidth priority over less time-sensitive applications.\n\n6. **Port Profiles (port_profile)**: Switch port configurations that define how network ports are configured, including VLAN assignments, PoE settings, and operational modes. These control the behavior of individual switch ports.\n\n7. **Networks (network)**: Network configurations that define VLANs and network segments in your UniFi environment. These control the fundamental network infrastructure and IP addressing schemes.\n\n8. **Legacy Rules**: For older UniFi OS versions, there are also legacy_firewall and legacy_traffic rule types, which are mapped to \"policy\" when using the service.\n\n## Local Development\n\n### Testing\n\nTo run the tests, you need to install the dependencies in the `requirements.txt` file.\n\n```bash\npython3 -m venv venv\nsource venv/bin/activate\npip install -r requirements.txt\n```\n\nThen run the tests:\n\n```bash\npytest tests\n```\n\n### API Testing\n\nWe've created a [Bruno](https://github.com/sirkirby/bruno-udm-api) collection to manually test the API requests. These are the same requests that the integration makes. This is a great way to verify your credentials are valid and to verify device connectivity and compatibility.\n\n## Diagnostics and Debugging\n\nThe integration includes targeted diagnostics and debugging capabilities to help troubleshoot issues while minimizing resource usage.\n\n### Standard Logging\n\nTo enable debug logging for the entire integration, add the following to your `configuration.yaml`:\n\n```yaml\nlogger:\n  logs:\n    custom_components.unifi_network_rules: debug\n    aiounifi: debug  # Also log the underlying UniFi library\n```\n\n### Targeted Debugging\n\nFor more focused debugging of specific subsystems, you can enable only what you need by editing the constants in `custom_components/unifi_network_rules/const.py`:\n\n- `LOG_WEBSOCKET`: Enable detailed WebSocket connection and message logs\n- `LOG_API_CALLS`: Log API requests and responses\n- `LOG_DATA_UPDATES`: Log data refresh and update cycles\n- `LOG_ENTITY_CHANGES`: Log entity addition, removal, and state changes\n- `LOG_TRIGGERS`: Log trigger detection and firing\n\nThese targeted flags help reduce log noise when troubleshooting specific issues.\n\n### Home Assistant Diagnostics\n\nThis integration supports Home Assistant's built-in diagnostics. To access:\n\n1. Go to Settings → Devices \u0026 Services → Integrations\n2. Find the UniFi Network Rules integration\n3. Click on Configure → Download Diagnostics\n4. Share the generated file when reporting issues\n\nThe diagnostics provide essential information about your system configuration without exposing sensitive data.\n\n### Temporary Websocket Health Monitor\n\nFor advanced troubleshooting of connectivity issues, the integration includes a WebSocket health monitor that can help identify connection problems with the UniFi controller.\n\n### Temporary Enable API Call Tracing [Advanced]\n\nTo temporarily enable API call tracing for a session:\n\n1. SSH into your Home Assistant instance\n2. Enter the `/config/custom_components/unifi_network_rules` directory\n3. Edit the file: `const.py`\n4. Change `LOG_API_CALLS = False` to `LOG_API_CALLS = True`\n5. Restart Home Assistant\n\n*Remember to revert this change after troubleshooting to prevent excessive logging.*\n\n## General Troubleshooting\n\nIf you are having trouble getting the integration to work, please check the following:\n\n1. Ensure the UDM is running the latest version of the network application.\n2. Ensure the UDM is connected to the same network as your Home Assistant instance.\n3. Ensure you are using the IP address of the UDM, not the hostname.\n4. Verify your local account has proper admin privileges.\n\n### Verify your local account is working\n\nRun this on a computer connected to the same network as your UDM or directly on your Home Assistant instance to verify connectivity to the UDM and that your credentials are valid.\n\n```bash\ncurl -k -X POST https://[UDM-IP]/api/auth/login \\\n-H \"Content-Type: application/json\" \\\n-d '{\"username\":\"[USERNAME]\",\"password\":\"[PASSWORD]\"}' \n```\n\nPossible responses:\n\n- 200 OK: Credentials are valid. Returns a JSON object with the user's information.\n- 401 Unauthorized: Credentials are invalid.\n- 429 Too Many Requests: The user has made too many requests in a short period of time. Wait a few minutes and try again.\n\n### Verify your account has admin privileges\n\nYou can do this by logging into your UniFi device locally or via \u003chttps://UniFi.ui.com\u003e, navigate to Settings -\u003e Admins \u0026 Users, and checking the local user's permissions. It should be Admin or Super Admin for the network application.\n\n### Open a bug issue\n\nIf you are having trouble getting the integration to work, please open an [Issue](https://github.com/sirkirby/UniFi-network-rules/issues) using the bug report template. Please enable debug logging and include the full log output in your report. Note that it may contain sensitive network information, so please review it before posting. The logs can be large, so i recommend attaching them as a file.\n\nTo get the debug log, navigate Devices and Services -\u003e UniFi Network Rules -\u003e Enable Debug Logging. Then reload the integration and try to reproduce the issue. Finally, disable debug logging and download the log file.\n\n## Limitations\n\nThis integration uses the same core library that Home Assistant Unifi integration uses, so there can be version incompatibility issues at time. We may ship with a higher version causing conflicts if you use multiple UniFi integrations. Sometimes restarting Home Assistant can help.\n\nThis will not support all the features of the UniFi controller, for that, leverage the core integration. The focus of this integration will be home and home lab use cases to extend and differentiate from the core integration.\n\n## Contributions\n\nContributions are welcome! Please read our [Contributing Guidelines](CONTRIBUTING.md) and feel free to submit a PR.\n\n***\n\n[commits-shield]: https://img.shields.io/github/commit-activity/y/sirkirby/unifi-network-rules?style=for-the-badge\n[commits]: https://github.com/sirkirby/unifi-network-rules/commits/main\n[license-shield]: https://img.shields.io/github/license/sirkirby/unifi-network-rules.svg?style=for-the-badge\n[maintenance-shield]: https://img.shields.io/badge/maintainer-sirkirby-blue.svg?style=for-the-badge\n\n[hacs]: https://github.com/custom-components/hacs\n[hacsbadge]: https://img.shields.io/badge/HACS-Custom-orange.svg?style=for-the-badge\n[discord]: https://discord.gg/Qa5fW2R\n[discord-shield]: https://img.shields.io/discord/330944238910963714.svg?style=for-the-badge\n[forum-shield]: https://img.shields.io/badge/community-forum-brightgreen.svg?style=for-the-badge\n[forum]: https://community.home-assistant.io/\n\n[releases]: https://github.com/sirkirby/unifi-network-rules/releases\n[release-shield]: https://img.shields.io/github/v/release/sirkirby/unifi-network-rules?style=flat\n\n[issues-shield]: https://img.shields.io/github/issues/sirkirby/unifi-network-rules?style=flat\n[issues-link]: https://github.com/sirkirby/unifi-network-rules/issues\n\n[validate-badge]: https://github.com/sirkirby/unifi-network-rules/actions/workflows/test-suite.yml/badge.svg\n[validate-workflow]: https://github.com/sirkirby/unifi-network-rules/actions/workflows/test-suite.yml\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsirkirby%2Funifi-network-rules","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsirkirby%2Funifi-network-rules","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsirkirby%2Funifi-network-rules/lists"}