A Home Assistant integration for Firewalla firewall devices that provides rule management and control through the MSP (Managed Service Provider) API. Automatically discover your existing Firewalla rules and control them (pause/unpause) directly from Home Assistant.
- Rule Detection: Automatically discovers all existing Firewalla rules
- Switch Entities: Creates a switch entity for each controllable rule
- Dynamic Updates: Automatically adds new rules and removes deleted ones
- Real-time Sync: Keeps Home Assistant entities synchronized with Firewalla
- Pause/Unpause Rules: Turn switches ON to activate rules, OFF to pause them
- Rule Preservation: Paused rules retain all configuration for easy re-activation
- Instant Control: Immediate rule state changes through Home Assistant
- Bulk Management: Control multiple rules through automations and scripts
- Rule Metadata: View rule type, target, description, priority, and schedule
- Rule Statistics: Monitor total, active, and paused rule counts
- Rule History: Track rule creation and modification timestamps
- Integration Health: Monitor API connectivity and rule synchronization status
- Rule Filtering: Configure which rules appear in Home Assistant using Firewalla's query syntax
- MSP API Integration: Full integration with Firewalla's MSP API v2
- Automatic Discovery: Discover and select from available Firewalla boxes
- Error Recovery: Robust error handling with automatic retry logic
- Rate Limiting: Respects API rate limits with intelligent caching and batching
- Open HACS in Home Assistant
- Go to "Integrations"
- Click the three dots in the top right corner
- Select "Custom repositories"
- Add this repository URL:
https://github.com/djuntgen/firewalla-home-assistant - Select "Integration" as the category
- Click "Add"
- Find "Firewalla" in the integration list and install it
- Restart Home Assistant
- Download the latest release from the releases page
- Extract the
custom_components/firewallafolder to your Home Assistantcustom_componentsdirectory - Restart Home Assistant
- Firewalla MSP Account: You need access to Firewalla's MSP (Managed Service Provider) API
- Personal Access Token: Generate a personal access token from your MSP account settings
- MSP Domain: Your MSP domain (e.g.,
mydomain.firewalla.netorhttps://mydomain.firewalla.net) - Existing Rules: The integration manages existing Firewalla rules (it doesn't create new ones)
- Go to Configuration → Integrations in Home Assistant
- Click Add Integration and search for "Firewalla"
- Enter your MSP credentials:
- MSP Domain: Your Firewalla MSP domain (e.g.,
mydomain.firewalla.netorhttps://mydomain.firewalla.net) - Personal Access Token: Your MSP API access token
- MSP Domain: Your Firewalla MSP domain (e.g.,
- Select your Firewalla box (if you have multiple boxes)
- (Optional) Configure rule filters to show only specific rules
- Complete the setup and wait for rule discovery
| Field | Description | Required | Example |
|---|---|---|---|
| MSP Domain | Firewalla MSP domain | Yes | mydomain.firewalla.net or https://mydomain.firewalla.net |
| Personal Access Token | Your MSP API access token | Yes | msp_token_abc123... |
| Firewalla Box | Select from discovered boxes | Yes | Auto-selected if only one |
Configure which Firewalla rules appear in Home Assistant using powerful filtering options. This allows you to show only the rules you need, reducing clutter and improving organization.
- Go to Configuration → Integrations
- Find your Firewalla integration and click Configure
- Add include/exclude filters using Firewalla's query syntax
- Save and the integration will reload with filtered rules
status:active- Show only active rules (71 of 83 rules)target.type:app- Show only app rules (13 rules: YouTube, Facebook, TikTok)action:block- Show only blocking rules (60 rules)scope.value:"FC:34:97:A5:9F:91"- Show rules for specific device (8 rules)
-status:paused- Hide paused rules (show 71 instead of 83)-action:allow- Hide allow rules (show 60 instead of 83)-target.type:category- Hide category rules (show 49 instead of 83)
Parent Dashboard: Show only kids' device rules
Include: scope.value:"FC:34:97:A5:9F:91"
Result: 8 device-specific rules (av, social, facebook)
IT Admin View: Show only active security rules
Include: status:active, action:block
Result: 48 active blocking rules
Home User: Show only app controls
Include: target.type:app
Result: 13 app rules (YouTube, Facebook, TikTok, etc.)
- Status:
status:active,status:paused - Action:
action:block,action:allow - Type:
target.type:app,target.type:category,target.type:internet,target.type:ip,target.type:domain - Device:
scope.value:"MAC:ADDRESS",device.name:*iphone*
- Entity ID:
switch.firewalla_rule_{rule_name}(e.g.,switch.firewalla_rule_youtube,switch.firewalla_rule_internet_access) - Purpose: Control individual Firewalla rules (pause/unpause)
- States:
on: Rule is active (unpaused)off: Rule is paused (temporarily disabled)
- Naming: Uses human-readable names based on rule description or rule type/target
- Attributes:
rule_id: Firewalla rule identifierrule_type: Type of rule (internet, category, domain, etc.)target: Rule target (MAC address, category, domain, etc.)target_name: Human-readable target nameaction: Rule action (block, allow, etc.)priority: Rule priority levelschedule: Rule schedule information (if applicable)created_at: Rule creation timestampmodified_at: Rule last modification timestampdescription: Rule description
- Entity ID:
sensor.firewalla_rules_summary - Purpose: Monitor overall rule statistics and integration health
- State: Total number of discovered rules
- Attributes:
total_rules: Total number of discovered rulesactive_rules: Number of active (unpaused) rulespaused_rules: Number of paused rulesrules_by_type: Breakdown of rules by type (internet, category, domain, etc.)last_updated: Last successful rule discovery timestampapi_status: Current API connectivity statusbox_name: Firewalla box namebox_model: Firewalla box modelbox_online: Firewalla box online status
automation:
- alias: "Activate Gaming Block During Work Hours"
trigger:
- platform: time
at: "09:00:00"
condition:
- condition: time
weekday:
- mon
- tue
- wed
- thu
- fri
action:
- service: switch.turn_on
target:
entity_id: switch.firewalla_rule_gaming_categoryautomation:
- alias: "Pause Internet Restrictions in Evening"
trigger:
- platform: time
at: "18:00:00" # 6 PM
action:
- service: switch.turn_off
target:
entity_id:
- switch.firewalla_rule_internet_access
- switch.firewalla_rule_gaming_categoryautomation:
- alias: "Notify When Rules Change"
trigger:
- platform: state
entity_id: sensor.firewalla_rules_summary
attribute: active_rules
action:
- service: notify.mobile_app
data:
message: "Firewalla active rules changed to {{ trigger.to_state.attributes.active_rules }}"automation:
- alias: "Weekend Rule Relaxation"
trigger:
- platform: time
at: "08:00:00"
condition:
- condition: time
weekday:
- sat
- sun
action:
- service: switch.turn_off
target:
entity_id:
- switch.firewalla_rule_internet_access
- switch.firewalla_rule_gaming_categorytype: entities
title: Firewalla Rule Control
entities:
- switch.firewalla_rule_internet_access
- switch.firewalla_rule_gaming_category
- switch.firewalla_rule_social_category
- switch.firewalla_rule_youtube
- switch.firewalla_rule_facebook
- sensor.firewalla_rules_summarytype: glance
title: Rule Statistics
entities:
- entity: sensor.firewalla_rules_summary
name: Total Rules
- entity: sensor.firewalla_rules_summary
name: Active Rules
attribute: active_rules
- entity: sensor.firewalla_rules_summary
name: Paused Rules
attribute: paused_rulestype: custom:auto-entities
card:
type: entities
title: All Firewalla Rules
filter:
include:
- entity_id: "switch.firewalla_rule_*"
exclude: []
sort:
method: name- Problem: "Invalid MSP API credentials"
- Solution: Verify your personal access token is correct and has proper permissions
- Problem: "Cannot connect to Firewalla MSP API"
- Solutions:
- Check your MSP API URL
- Verify network connectivity
- Ensure firewall allows outbound HTTPS connections
- Problem: "No Firewalla boxes found in your MSP account"
- Solution: Ensure your MSP account has access to at least one Firewalla box
- Problem: "Cannot access rules. Please check your MSP permissions"
- Solution: Verify your MSP account has permissions to view and manage rules
- Problem: Integration sets up but no rule entities are created
- Solutions:
- Ensure you have existing rules in your Firewalla configuration
- Check that rules are not disabled or system-managed
- Verify API permissions allow rule access
- Problem: Rule entity states not reflecting current status
- Solutions:
- Check Home Assistant logs for API errors
- Verify Firewalla box is online and accessible
- Try reloading the integration
- Check if rules were modified outside of Home Assistant
Enable debug logging to troubleshoot issues:
logger:
default: warning
logs:
custom_components.firewalla: debugThe integration respects Firewalla's API rate limits:
- Maximum 10 requests per minute per device
- Automatic retry with exponential backoff
- Intelligent caching to minimize API calls
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests for new functionality
- Ensure all tests pass
- Submit a pull request
# Install test dependencies
pip install -r tests/requirements.txt
# Run all tests
python run_tests.py
# Run specific tests
pytest tests/test_coordinator.py -vThe project maintains high code quality standards:
- Type hints throughout the codebase
- Comprehensive error handling
- Extensive test coverage
- Home Assistant coding standards compliance
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Home Assistant Community: Community Forum
When reporting bugs, please include:
- Home Assistant version
- Integration version
- Firewalla device model
- Relevant log entries
- Steps to reproduce
This project is licensed under the MIT License - see the LICENSE file for details.
- Firewalla for providing the MSP API
- Home Assistant community for integration standards
- HACS for custom component distribution
See CHANGELOG.md for version history and breaking changes.