{"id":28565409,"url":"https://github.com/ssl/kpnboxapi","last_synced_at":"2025-06-10T14:15:33.849Z","repository":{"id":297461614,"uuid":"996216923","full_name":"ssl/KPNBoxAPI","owner":"ssl","description":"Python library for interacting with KPN Box modem/router (Tested with Box 14)","archived":false,"fork":false,"pushed_at":"2025-06-05T15:37:19.000Z","size":0,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-05T15:50:54.729Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/ssl.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-06-04T16:14:35.000Z","updated_at":"2025-06-05T15:46:49.000Z","dependencies_parsed_at":"2025-06-05T15:50:58.594Z","dependency_job_id":"358107c2-3104-4c12-a28b-8afef6209139","html_url":"https://github.com/ssl/KPNBoxAPI","commit_stats":null,"previous_names":["ssl/kpnboxapi"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ssl%2FKPNBoxAPI","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ssl%2FKPNBoxAPI/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ssl%2FKPNBoxAPI/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ssl%2FKPNBoxAPI/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ssl","download_url":"https://codeload.github.com/ssl/KPNBoxAPI/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ssl%2FKPNBoxAPI/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259090425,"owners_count":22803678,"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","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":[],"created_at":"2025-06-10T14:15:32.890Z","updated_at":"2025-06-10T14:15:33.837Z","avatar_url":"https://github.com/ssl.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# KPNBoxAPI\n\nPython library for interacting with KPN Box modem/router. Tested with Box 14.\n\n## Installation\n\n```bash\npip install kpnboxapi\n```\n\n## Quick Start\n\n```python\nfrom kpnboxapi import KPNBoxAPI\n\n# Connect and authenticate\napi = KPNBoxAPI(host=\"192.168.2.254\")\napi.login(username=\"admin\", password=\"your_password\")\n\n# Get all connected devices\ndevices = api.get_devices()\n\n# Get only currently connected devices\nactive_devices = api.get_devices(filter='active')\n\n# Get previously connected devices\ninactive_devices = api.get_devices(filter='inactive')\n```\n\nmore examples in the `examples/` folder and down below in this readme.\n\n```bash\npython examples/basic_usage.py\n```\n\n## API Reference\n\n### KPNBoxAPI(host=\"192.168.2.254\", timeout=30)\n\nInitialize the API client.\n\n**Parameters:**\n- `host` (str): KPN Box IP address (default: \"192.168.2.254\")\n- `timeout` (int): Request timeout in seconds (default: 30)\n\n### login(username=\"admin\", password=\"\")\n\nAuthenticate with the KPN Box.\n\n**Parameters:**\n- `username` (str): Username (default: \"admin\")\n- `password` (str): Password\n\n**Returns:** `bool` - True if successful\n\n### get_connected_devices()\n\nGet raw device data from the KPN Box API.\n\n**Returns:** Raw device data (dict/list)\n\n### get_devices(filter='all')\n\nGet filtered list of connected devices.\n\n**Parameters:**\n- `filter` (str): Filter devices - `'all'`, `'active'`, or `'inactive'` (default: 'all')\n\n**Returns:** List of device dictionaries\n\n**Device Fields:**\n- `Name`: Device name\n- `PhysAddress`: MAC address\n- `IPAddress`: IP address\n- `Active`: Connection status (True/False)\n- `DeviceType`: Device type (e.g., \"Computer\", \"Mobile\", \"TV\")\n- `Layer2Interface`: Network interface (e.g., \"ETH0\", \"ETH3\")\n- `FirstSeen`: First connection timestamp\n- `LastConnection`: Last connection timestamp\n- `VendorClassID`: DHCP vendor class\n- `ClientID`: DHCP client ID\n- `UniqueID`: Device unique identifier\n- `Index`: Device index\n- `Names`: List of device names from different sources\n- `DeviceTypes`: List of device types from different sources\n- `IPv4Address`: List of IPv4 addresses\n- `IPv6Address`: List of IPv6 addresses\n- `Security`: Security scoring information\n- `Priority`: Traffic priority settings\n- And many other fields from the KPN Box API\n\n### delete_device(mac_address)\n\nDelete/destroy a device from the router's device list.\n\n**Parameters:**\n- `mac_address` (str): MAC address of the device to delete (e.g., \"96:16:1A:D6:0F:30\")\n\n**Returns:** `bool` - True if device was successfully deleted\n\n**Note:** \n- This only removes the device from the router's memory\n- If the device reconnects, it will reappear in the device list\n- Typically used for inactive devices to clean up the device list\n- Device schedules and restrictions are also removed\n\n### cleanup_inactive_devices(days_inactive=30)\n\nClean up devices that haven't been seen for a specified number of days.\n\n**Parameters:**\n- `days_inactive` (int): Number of days of inactivity before considering device for cleanup (default: 30)\n\n**Returns:** Dictionary with cleanup results\n\n**Cleanup Result Fields:**\n- `candidates`: List of devices eligible for cleanup\n- `deleted`: List of devices that were deleted\n- `failed`: List of devices that failed to delete\n- `total_candidates`: Number of devices eligible for cleanup\n- `total_deleted`: Number of devices successfully deleted\n- `total_failed`: Number of devices that failed to delete\n\n**Note:** This function will automatically delete devices, use with caution.\n\n### list_inactive_devices(days_inactive=7)\n\nList devices that haven't been seen for a specified number of days.\n\n**Parameters:**\n- `days_inactive` (int): Number of days of inactivity to filter by (default: 7)\n\n**Returns:** List of inactive device dictionaries with additional fields\n\n**Additional Fields:**\n- `days_since_seen`: Number of days since last connection\n- All standard device management fields\n\n### get_device_info()\n\nGet information about the KPN Box modem itself.\n\n**Returns:** Dictionary with modem information\n\n**Modem Info Fields:**\n- `Manufacturer`: Modem manufacturer (e.g., \"Arcadyan\")\n- `ModelName`: Modem model (e.g., \"BoxV14\")\n- `SerialNumber`: Modem serial number\n- `SoftwareVersion`: Current firmware version\n- `HardwareVersion`: Hardware version\n- `UpTime`: Modem uptime in seconds\n- `ExternalIPAddress`: External/WAN IP address\n- `DeviceStatus`: Current device status\n- `BaseMAC`: Modem base MAC address\n- `Country`: Country code\n- `NumberOfReboots`: Total number of reboots\n- `ManufacturerOUI`: Manufacturer OUI\n- `Description`: Device description\n- `ProductClass`: Product class\n- `RescueVersion`: Rescue firmware version\n- `FirstUseDate`: First use timestamp\n- And other modem details\n\n### get_public_ipv6()\n\nGet the public IPv6 address of the KPN Box modem.\n\n**Returns:** `str` - Public IPv6 address\n\n### get_wifi_networks()\n\nGet WiFi network configurations (regular networks, not guest).\n\n**Returns:** List of WiFi network dictionaries\n\n**WiFi Network Fields:**\n- `VAPName`: Virtual Access Point name (e.g., \"vap2g0priv\", \"vap5g0priv\")\n- `SSID`: Network name\n- `VAPStatus`: Status (\"Up\" or \"Down\")\n- `BSSID`: MAC address of the access point\n- `MACAddress`: MAC address\n- `Security`: Security configuration including:\n  - `ModeEnabled`: Security mode (e.g., \"WPA2-Personal\")\n  - `KeyPassPhrase`: WiFi password\n  - `ModesSupported`: List of supported security modes\n- `MaxAssociatedDevices`: Maximum number of devices\n- `AssociatedDeviceNumberOfEntries`: Current connected devices\n- `EssIdentifier`: Network identifier (\"Primary\", \"Secondary\")\n- `BridgeInterface`: Network bridge interface\n- `WPS`: WPS configuration\n- `IEEE80211r`: Fast roaming configuration\n- `MACFiltering`: MAC filtering settings\n- And many other WiFi configuration fields\n\n### get_guest_wifi_networks()\n\nGet guest WiFi network configurations.\n\n**Returns:** List of guest WiFi network dictionaries with same structure as `get_wifi_networks()` but for guest networks\n\n### get_all_wifi_networks()\n\nGet all WiFi networks (both regular and guest).\n\n**Returns:** Dictionary with keys:\n- `'regular'`: List of regular WiFi networks\n- `'guest'`: List of guest WiFi networks\n\n### set_wifi_config(ssid_2g=None, ssid_5g=None, password_2g=None, password_5g=None, security_mode_2g=None, security_mode_5g=None, mfp_config_2g=\"\", mfp_config_5g=\"\")\n\nConfigure WiFi network settings (SSID, password, security).\n\n**Parameters:**\n- `ssid_2g` (str): 2.4GHz network name/SSID\n- `ssid_5g` (str): 5GHz network name/SSID\n- `password_2g` (str): 2.4GHz network password\n- `password_5g` (str): 5GHz network password\n- `security_mode_2g` (str): 2.4GHz security mode (e.g., \"WPA2-Personal\", \"WPA3-Personal\")\n- `security_mode_5g` (str): 5GHz security mode (e.g., \"WPA2-Personal\", \"WPA3-Personal\")\n- `mfp_config_2g` (str): 2.4GHz Management Frame Protection - \"\", \"Optioneel\", \"Benodigd\", \"Uit\" (default: \"\")\n- `mfp_config_5g` (str): 5GHz Management Frame Protection - \"\", \"Optioneel\", \"Benodigd\", \"Uit\" (default: \"\")\n\n**Returns:** `bool` - True if successful\n\n### set_wifi_visibility(visible_2g=None, visible_5g=None)\n\nEnable or disable WiFi network visibility (SSID advertisement).\n\n**Parameters:**\n- `visible_2g` (bool): Whether 2.4GHz network should be visible (broadcast SSID)\n- `visible_5g` (bool): Whether 5GHz network should be visible (broadcast SSID)\n\n**Returns:** `bool` - True if successful\n\n### set_wps_enabled(enabled_2g=None, enabled_5g=None)\n\nEnable or disable WPS (WiFi Protected Setup) for WiFi networks.\n\n**Parameters:**\n- `enabled_2g` (bool): Whether to enable WPS on 2.4GHz network\n- `enabled_5g` (bool): Whether to enable WPS on 5GHz network\n\n**Returns:** Dictionary with 'band_2g' and 'band_5g' keys indicating success for each band\n\n### get_dhcp_server(pool_id=\"default\")\n\nGet DHCP server configuration for a specific pool.\n\n**Parameters:**\n- `pool_id` (str): DHCP pool ID - `\"default\"` or `\"guest\"` (default: \"default\")\n\n**Returns:** Dictionary with DHCP server configuration\n\n**DHCP Server Fields:**\n- `PoolID`: DHCP pool identifier (\"default\" or \"guest\")\n- `Enable`: Whether DHCP server is enabled (True/False)\n- `Status`: Current status (\"Enabled\" or \"Disabled\")\n- `MinAddress`: Start of IP address range (e.g., \"192.168.2.100\")\n- `MaxAddress`: End of IP address range (e.g., \"192.168.2.200\")\n- `SubnetMask`: Network subnet mask (e.g., \"255.255.255.0\")\n- `IPRouters`: Gateway IP address (e.g., \"192.168.2.254\")\n- `LeaseTime`: DHCP lease duration in seconds (e.g., 14400 = 4 hours)\n- `DNSServers`: DNS server addresses (comma-separated)\n- `DomainName`: Network domain name (e.g., \"home\")\n- `Interface`: Network interface (e.g., \"bridge\", \"brguest\")\n- `LeaseNumberOfEntries`: Number of active DHCP leases\n- `StaticAddressNumberOfEntries`: Number of static IP assignments\n- `Allocation`: DHCP allocation method (\"dynamic\")\n- `ARPProtect`: ARP protection enabled\n- And many other DHCP configuration fields\n\n### get_default_dhcp_server()\n\nGet default network DHCP server configuration.\n\n**Returns:** Dictionary with default DHCP server configuration\n\n### get_guest_dhcp_server()\n\nGet guest network DHCP server configuration.\n\n**Returns:** Dictionary with guest DHCP server configuration\n\n### get_all_dhcp_servers()\n\nGet all DHCP server configurations (both default and guest).\n\n**Returns:** Dictionary with keys:\n- `'default'`: Default network DHCP configuration\n- `'guest'`: Guest network DHCP configuration\n\n### set_dhcp_server_config(network=\"lan\", gateway_ip=None, subnet_mask=None, dhcp_enabled=None, dhcp_min_ip=None, dhcp_max_ip=None, lease_time_seconds=None, dhcp_authoritative=None, dns_servers=None)\n\nConfigure DHCP server settings for a network.\n\n**Parameters:**\n- `network` (str): Network to configure (\"lan\" for home, \"guest\" for guest network)\n- `gateway_ip` (str): Gateway IP address (e.g., \"192.168.2.254\")\n- `subnet_mask` (int): Subnet prefix length (e.g., 24 for /24)\n- `dhcp_enabled` (bool): Enable/disable DHCP server\n- `dhcp_min_ip` (str): Minimum IP address for DHCP pool (e.g., \"192.168.2.100\")\n- `dhcp_max_ip` (str): Maximum IP address for DHCP pool (e.g., \"192.168.2.200\")\n- `lease_time_seconds` (int): DHCP lease time in seconds (e.g., 14400 for 4 hours)\n- `dhcp_authoritative` (bool): Whether DHCP server is authoritative\n- `dns_servers` (str): DNS servers as comma-separated string (e.g., \"9.9.9.9,149.112.112.112\")\n\n**Returns:** `bool` - True if configuration was successful\n\n### set_home_dhcp_config(gateway_ip=None, subnet_mask=None, dhcp_enabled=None, dhcp_min_ip=None, dhcp_max_ip=None, lease_time_seconds=None, dhcp_authoritative=None, dns_servers=None)\n\nConfigure DHCP server settings for the home network.\n\n**Parameters:**\n- `gateway_ip` (str): Gateway IP address (default: \"192.168.2.254\")\n- `subnet_mask` (int): Subnet prefix length (default: 24)\n- `dhcp_enabled` (bool): Enable/disable DHCP server (default: True)\n- `dhcp_min_ip` (str): Minimum IP for DHCP pool (default: \"192.168.2.100\")\n- `dhcp_max_ip` (str): Maximum IP for DHCP pool (default: \"192.168.2.200\")\n- `lease_time_seconds` (int): DHCP lease time in seconds (default: 14400)\n- `dhcp_authoritative` (bool): Whether DHCP server is authoritative (default: True)\n- `dns_servers` (str): DNS servers comma-separated (default: \"9.9.9.9,149.112.112.112\")\n\n**Returns:** `bool` - True if configuration was successful\n\n### set_guest_dhcp_config(gateway_ip=None, subnet_mask=None, dhcp_enabled=None, dhcp_min_ip=None, dhcp_max_ip=None, lease_time_seconds=None, dns_servers=None)\n\nConfigure DHCP server settings for the guest network.\n\n**Parameters:**\n- `gateway_ip` (str): Gateway IP address (default: \"192.168.3.254\")\n- `subnet_mask` (int): Subnet prefix length (default: 24)\n- `dhcp_enabled` (bool): Enable/disable DHCP server (default: True)\n- `dhcp_min_ip` (str): Minimum IP for DHCP pool (default: \"192.168.3.1\")\n- `dhcp_max_ip` (str): Maximum IP for DHCP pool (default: \"192.168.3.32\")\n- `lease_time_seconds` (int): DHCP lease time in seconds (default: 14400)\n- `dns_servers` (str): DNS servers comma-separated (default: \"9.9.9.9,149.112.112.112\")\n\n**Returns:** `bool` - True if configuration was successful\n\n### configure_network_isolation(home_subnet=\"192.168.2.0/24\", guest_subnet=\"192.168.3.0/24\", home_dhcp_range=(\"192.168.2.100\", \"192.168.2.200\"), guest_dhcp_range=(\"192.168.3.1\", \"192.168.3.32\"), dns_servers=\"9.9.9.9,149.112.112.112\")\n\nConfigure network isolation between home and guest networks.\n\n**Parameters:**\n- `home_subnet` (str): Home network subnet in CIDR notation\n- `guest_subnet` (str): Guest network subnet in CIDR notation\n- `home_dhcp_range` (tuple): Tuple of (min_ip, max_ip) for home DHCP\n- `guest_dhcp_range` (tuple): Tuple of (min_ip, max_ip) for guest DHCP\n- `dns_servers` (str): DNS servers for both networks\n\n**Returns:** Dictionary with configuration results for home and guest networks\n\n**Note:** This sets up proper IP ranges and DHCP pools to keep networks separated.\n\n### get_dhcp_leases(pool_id=\"default\")\n\nGet DHCP leases for a specific pool.\n\n**Parameters:**\n- `pool_id` (str): DHCP pool ID - `\"default\"` or `\"guest\"` (default: \"default\")\n\n**Returns:** List of DHCP lease dictionaries\n\n**DHCP Lease Fields:**\n- `PoolID`: DHCP pool identifier (\"default\" or \"guest\")\n- `ClientID`: DHCP client identifier\n- `IPAddress`: Assigned IP address (e.g., \"192.168.2.117\")\n- `MACAddress`: Device MAC address\n- `FriendlyName`: Device name/hostname (e.g., \"Studio\", \"iPhone\")\n- `Active`: Whether lease is currently active (True/False)\n- `Reserved`: Whether IP is reserved for this device (True/False)\n- `LeaseTime`: Total lease duration in seconds\n- `LeaseTimeRemaining`: Remaining lease time in seconds (-1 = permanent)\n- `Gateway`: Gateway configuration\n- `Flags`: DHCP flags and options\n- `TransactionID`: DHCP transaction identifier\n- Various DHCP protocol fields\n\n### get_default_dhcp_leases()\n\nGet DHCP leases for the default network.\n\n**Returns:** List of DHCP lease dictionaries for default network\n\n### get_guest_dhcp_leases()\n\nGet DHCP leases for the guest network.\n\n**Returns:** List of DHCP lease dictionaries for guest network\n\n### get_all_dhcp_leases()\n\nGet all DHCP leases (both default and guest networks).\n\n**Returns:** Dictionary with keys:\n- `'default'`: List of default network DHCP leases\n- `'guest'`: List of guest network DHCP leases\n\n### get_active_dhcp_leases(pool_id=\"default\")\n\nGet only active DHCP leases for a specific pool.\n\n**Parameters:**\n- `pool_id` (str): DHCP pool ID - `\"default\"` or `\"guest\"` (default: \"default\")\n\n**Returns:** List of active DHCP lease dictionaries\n\n### get_dyndns_hosts()\n\nGet Dynamic DNS host configurations.\n\n**Returns:** List of DynDNS host dictionaries\n\n**DynDNS Host Fields:**\n- `service`: DynDNS provider service (e.g., \"No-IP\", \"DynDNS\")\n- `hostname`: Dynamic DNS hostname (e.g., \"example.ddns.net\")\n- `username`: DynDNS account username\n- `password`: DynDNS account password\n- `last_update`: Last update timestamp (ISO format, e.g., \"2025-06-03T23:58:30Z\")\n- `status`: Current status (e.g., \"UPDATED\", \"ERROR\", \"PENDING\")\n- `enable`: Whether DynDNS is enabled (True/False)\n\n### add_dyndns_host(service, username, hostname, password)\n\nAdd a new Dynamic DNS host configuration.\n\n**Parameters:**\n- `service` (str): DynDNS provider service (e.g., \"dyndns\", \"noip\", \"freedns\")\n- `username` (str): DynDNS account username\n- `hostname` (str): Dynamic DNS hostname (e.g., \"yourdomain.ddns.net\")\n- `password` (str): DynDNS account password\n\n**Returns:** `bool` - True if host was successfully added\n\n### delete_dyndns_host(hostname)\n\nDelete a Dynamic DNS host configuration.\n\n**Parameters:**\n- `hostname` (str): Dynamic DNS hostname to delete (e.g., \"yourdomain.ddns.net\")\n\n**Returns:** `bool` - True if host was successfully deleted\n\n### update_dyndns_host(hostname, service=None, username=None, password=None)\n\nUpdate an existing Dynamic DNS host configuration.\n\n**Parameters:**\n- `hostname` (str): Dynamic DNS hostname to update (e.g., \"yourdomain.ddns.net\")\n- `service` (str): New DynDNS provider service (if changing)\n- `username` (str): New DynDNS account username (if changing)\n- `password` (str): New DynDNS account password (if changing)\n\n**Returns:** `bool` - True if host was successfully updated\n\n**Note:** This method deletes the existing host and adds it back with new configuration.\n\n### get_dyndns_status(hostname=None)\n\nGet Dynamic DNS status for a specific hostname or all hosts.\n\n**Parameters:**\n- `hostname` (str): Specific hostname to check (optional, returns all if not specified)\n\n**Returns:** Dictionary with DynDNS status information or single host if hostname specified\n\n**Status Fields (when hostname=None):**\n- `total_hosts`: Total number of configured hosts\n- `hosts`: List of all host configurations\n- `active_hosts`: List of enabled hosts only\n- `last_updated`: Most recent update timestamp\n\n### manage_dyndns_service(action, hostname, service=None, username=None, password=None)\n\nComprehensive DynDNS management method.\n\n**Parameters:**\n- `action` (str): Action to perform (\"add\", \"delete\", \"update\")\n- `hostname` (str): Dynamic DNS hostname\n- `service` (str): DynDNS provider service (required for add)\n- `username` (str): DynDNS account username (required for add)\n- `password` (str): DynDNS account password (required for add)\n\n**Returns:** `bool` - True if action was successful\n\n### get_network_stats(interface=\"ETH0\")\n\nGet network device statistics for a specific interface.\n\n**Parameters:**\n- `interface` (str): Interface name - `\"ETH0\"`, `\"ETH1\"`, `\"ETH2\"`, `\"ETH3\"`, `\"eth4\"`, or `\"ppp_vdata\"` (default: \"ETH0\")\n  - ETH0-ETH3: Individual Ethernet ports\n  - eth4: Total WAN statistics (all WAN traffic combined)\n  - ppp_vdata: PPP connection statistics\n\n**Returns:** Dictionary with network statistics\n\n**Network Statistics Fields:**\n- `Interface`: Interface name (e.g., \"ETH0\", \"eth4\", \"ppp_vdata\")\n- `RxPackets`: Received packets count\n- `TxPackets`: Transmitted packets count\n- `RxBytes`: Received bytes count\n- `TxBytes`: Transmitted bytes count\n- `RxErrors`: Received errors count\n- `TxErrors`: Transmitted errors count\n- `RxDropped`: Received dropped packets count\n- `TxDropped`: Transmitted dropped packets count\n- `Multicast`: Multicast packets count\n- `Collisions`: Network collisions count\n- `RxLengthErrors`: Received length errors\n- `RxOverErrors`: Received overflow errors\n- `RxCrcErrors`: Received CRC errors\n- `RxFrameErrors`: Received frame errors\n- `RxFifoErrors`: Received FIFO errors\n- `RxMissedErrors`: Received missed errors\n- `TxAbortedErrors`: Transmitted aborted errors\n- `TxCarrierErrors`: Transmitted carrier errors\n- `TxFifoErrors`: Transmitted FIFO errors\n- `TxHeartbeatErrors`: Transmitted heartbeat errors\n- `TxWindowErrors`: Transmitted window errors\n\n### get_all_network_stats()\n\nGet network device statistics for all interfaces (ETH0-ETH3, WAN total, PPP).\n\n**Returns:** Dictionary with keys for all interfaces containing their respective statistics\n\n### get_wan_total_stats()\n\nGet total WAN network statistics (all WAN traffic combined).\n\n**Returns:** Dictionary with total WAN network statistics\n\n### get_ppp_stats()\n\nGet PPP connection network statistics.\n\n**Returns:** Dictionary with PPP connection network statistics\n\n### format_bytes(bytes_count)\n\nHelper method to format byte counts in human-readable format.\n\n**Parameters:**\n- `bytes_count` (int): Number of bytes\n\n**Returns:** `str` - Formatted string (e.g., \"1.2 GB\", \"45.6 MB\")\n\n### get_port_forwarding(origin=\"webui\")\n\nGet firewall port forwarding rules.\n\n**Parameters:**\n- `origin` (str): Rule origin filter - `\"webui\"`, `\"upnp\"`, or other origin (default: \"webui\")\n\n**Returns:** List of port forwarding rule dictionaries\n\n**Port Forwarding Rule Fields:**\n- `Id`: Rule identifier (e.g., \"webui_pi\")\n- `Origin`: Rule origin (e.g., \"webui\", \"upnp\")\n- `Description`: Human-readable description (e.g., \"pi\", \"HTTP\")\n- `Status`: Current status (\"Enabled\" or \"Disabled\")\n- `Enable`: Whether rule is enabled (True/False)\n- `SourceInterface`: Source interface (e.g., \"data\")\n- `Protocol`: Protocol numbers (6=TCP, 17=UDP, comma-separated)\n- `ExternalPort`: External port number (e.g., \"1339\", \"8080\")\n- `InternalPort`: Internal port number\n- `DestinationIPAddress`: Target internal IP address\n- `DestinationMACAddress`: Target MAC address (if specified)\n- `LeaseDuration`: Rule lease duration in seconds\n- `HairpinNAT`: Whether hairpin NAT is enabled\n- `SymmetricSNAT`: Whether symmetric SNAT is enabled\n- `UPnPV1Compat`: Whether UPnP v1 compatibility is enabled\n\n### get_all_port_forwarding()\n\nGet all port forwarding rules from different origins.\n\n**Returns:** Dictionary with keys for different origins containing their respective rules\n\n### get_active_port_forwarding(origin=\"webui\")\n\nGet only enabled port forwarding rules.\n\n**Parameters:**\n- `origin` (str): Rule origin filter - `\"webui\"`, `\"upnp\"`, or other origin (default: \"webui\")\n\n**Returns:** List of enabled port forwarding rule dictionaries\n\n### format_protocol(protocol_str)\n\nHelper method to format protocol numbers into readable names.\n\n**Parameters:**\n- `protocol_str` (str): Protocol string (e.g., \"6,17\" or \"6\")\n\n**Returns:** `str` - Formatted protocol string (e.g., \"TCP,UDP\" or \"TCP\")\n\n### get_ipv6_pinholes()\n\nGet IPv6 pinhole (port forwarding) rules.\n\n**Returns:** List of IPv6 pinhole rule dictionaries\n\n**IPv6 Pinhole Rule Fields:**\n- `Id`: Rule identifier (e.g., \"webui_1\")\n- `Origin`: Rule origin (e.g., \"webui\", \"upnp\")\n- `Description`: Human-readable description (e.g., \"FTP\")\n- `Status`: Current status (\"Enabled\" or \"Disabled\")\n- `Enable`: Whether rule is enabled (True/False)\n- `SourceInterface`: Source interface (e.g., \"data\")\n- `Protocol`: Protocol numbers (6=TCP, 17=UDP, comma-separated)\n- `IPVersion`: IP version (6 for IPv6)\n- `SourcePort`: Source port filter (if specified)\n- `DestinationPort`: Destination port or port range (e.g., \"20-21\", \"80\")\n- `SourcePrefix`: Source IP prefix filter (if specified)\n- `DestinationIPAddress`: Target IPv6 address\n- `DestinationMACAddress`: Target MAC address (if specified)\n\n### get_active_ipv6_pinholes()\n\nGet only enabled IPv6 pinhole rules.\n\n**Returns:** List of enabled IPv6 pinhole rule dictionaries\n\n### get_all_firewall_rules()\n\nGet all firewall rules (both IPv4 port forwarding and IPv6 pinholes).\n\n**Returns:** Dictionary with keys:\n- `'port_forwarding'`: IPv4 port forwarding rules organized by origin\n- `'ipv6_pinholes'`: IPv6 pinhole rules\n\n### get_wan_status()\n\nGet WAN connection status and information.\n\n**Returns:** Dictionary with WAN connection information\n\n**WAN Status Fields:**\n- `LinkType`: Connection link type (e.g., \"ethernet\")\n- `LinkState`: Physical link state (e.g., \"up\", \"down\")\n- `MACAddress`: WAN interface MAC address\n- `Protocol`: Connection protocol (e.g., \"ppp\")\n- `ConnectionState`: Connection state (e.g., \"Connected\", \"Disconnected\")\n- `LastConnectionError`: Last connection error (if any)\n- `IPAddress`: Current public IPv4 address\n- `RemoteGateway`: ISP gateway IP address\n- `DNSServers`: DNS server addresses (comma-separated)\n- `IPv6Address`: Current public IPv6 address\n- `IPv6DelegatedPrefix`: IPv6 prefix delegated by ISP\n\n### get_ppp_info()\n\nGet detailed PPP connection information.\n\n**Returns:** Dictionary with PPP connection details\n\n**PPP Info Fields:**\n- `Interface`: PPP interface name (e.g., \"ppp_vdata\")\n- `Username`: PPP authentication username\n- `Password`: PPP authentication password\n- `ConnectionStatus`: Current connection status\n- `LastConnectionError`: Last connection error code\n- `MaxMRUSize`: Maximum Receive Unit size\n- `PPPoESessionID`: PPPoE session identifier\n- `PPPoEACName`: PPPoE Access Concentrator name\n- `PPPoEServiceName`: PPPoE service name\n- `RemoteIPAddress`: Remote PPP endpoint IP\n- `LocalIPAddress`: Local PPP endpoint IP\n- `LastChangeTime`: Time since last status change\n- `LastChange`: Last change timestamp\n- `DNSServers`: DNS servers from PPP negotiation\n- `TransportType`: Transport protocol (e.g., \"PPPoE\")\n- `LCPEcho`: LCP echo interval\n- `LCPEchoRetry`: LCP echo retry count\n- `IPCPEnable`: Whether IPCP is enabled\n- `IPv6CPEnable`: Whether IPv6CP is enabled\n- `IPv6CPLocalInterfaceIdentifier`: Local IPv6 interface ID\n- `IPv6CPRemoteInterfaceIdentifier`: Remote IPv6 interface ID\n- `ConnectionTrigger`: Connection trigger mode\n- `IdleDisconnectTime`: Idle disconnect timeout\n\n### get_connection_info()\n\nGet comprehensive internet connection information (WAN + PPP).\n\n**Returns:** Dictionary with keys:\n- `'wan_status'`: WAN connection status\n- `'ppp_info'`: Detailed PPP connection information\n\n### is_connected()\n\nCheck if the internet connection is active.\n\n**Returns:** `bool` - True if connected to the internet, False otherwise\n\n### get_wwan_status()\n\nGet WWAN (mobile internet backup) interface status and configuration.\n\n**Returns:** Dictionary with WWAN interface information\n\n**WWAN Status Fields:**\n- `Name`: Interface name (\"wwan\")\n- `Enable`: Whether WWAN interface is enabled\n- `Status`: Current status (True/False)\n- `Flags`: Interface flags\n- `Alias`: Interface alias (e.g., \"cpe-wwan\")\n- `APN`: Access Point Name (e.g., \"basicinternet\")\n- `PINCode`: SIM PIN code (if configured)\n- `Username`: Authentication username\n- `Password`: Authentication password\n- `AuthenticationMethod`: Auth method (e.g., \"chap\")\n- `DNSServers`: DNS servers for mobile connection\n- `IPRouter`: Gateway IP address\n- `LocalIPAddress`: Assigned local IP address\n- `ConnectionStatus`: Connection status (e.g., \"NotPresent\", \"Connected\")\n- `ConnectionError`: Last connection error\n- `ConnectionErrorSource`: Source of connection error\n- `AutoConnection`: Whether auto-connection is enabled\n- `SignalStrength`: Signal strength (0-100)\n- `Technology`: Mobile technology (e.g., \"4G\", \"5G\", \"none\")\n- `Manufacturer`: Modem manufacturer\n- `Model`: Modem model\n- `IMEI`: Device IMEI number\n- `PinType`: PIN type required\n- `PinRetryCount`: Remaining PIN retry attempts\n- `PukRetryCount`: Remaining PUK retry attempts\n- `IMSI`: SIM IMSI number\n- `ICCID`: SIM card identifier\n- `MSISDN`: Mobile number\n- `LastChange`: Last change timestamp\n- `LastChangeTime`: Last change time\n- `TechnologyPreference`: Preferred technology\n- `NATEnabled`: Whether NAT is enabled\n- `MTU`: Maximum Transmission Unit\n- `IPv4Forwarding`: Whether IPv4 forwarding is enabled\n- `IPv6Disable`: Whether IPv6 is disabled\n- And other network interface settings\n\n### get_lan_ipv4_config()\n\nGet LAN IPv4 network configuration.\n\n**Returns:** Dictionary with LAN IPv4 configuration\n\n**LAN IPv4 Config Fields:**\n- `Address`: LAN IPv4 address (e.g., \"192.168.2.254\")\n- `PrefixLength`: Network prefix length (e.g., 24)\n- `DHCPEnable`: Whether DHCP server is enabled\n- `DHCPAuthoritative`: Whether DHCP server is authoritative\n- `DHCPMinAddress`: DHCP range start address\n- `DHCPMaxAddress`: DHCP range end address\n- `LeaseTime`: DHCP lease time in seconds\n- `DNSServers`: DNS server addresses (comma-separated)\n- `NTPServers`: NTP server addresses (comma-separated)\n- `DomainSearchList`: Domain search list\n- `Enable`: Whether IPv4 is enabled\n- `AllowPublic`: Whether public access is allowed\n- `NATEnable`: Whether NAT is enabled\n\n### get_lan_ipv6_config()\n\nGet LAN IPv6 network configuration.\n\n**Returns:** Dictionary with LAN IPv6 configuration\n\n**LAN IPv6 Config Fields:**\n- `Address`: LAN IPv6 address\n- `PrefixLength`: Network prefix length\n- `Intf`: Interface name (e.g., \"data\")\n- `SubnetOffset`: Subnet offset value\n- `DHCPEnable`: Whether DHCPv6 server is enabled\n- `DHCPIAPDEnable`: Whether DHCPv6 Identity Association for Prefix Delegation is enabled\n- `DHCPIANAEnable`: Whether DHCPv6 Identity Association for Non-temporary Addresses is enabled\n- `DNSServers`: IPv6 DNS server addresses (comma-separated)\n- `NTPServers`: IPv6 NTP server addresses (comma-separated)\n- `Enable`: Whether IPv6 is enabled\n\n### get_lan_config()\n\nGet comprehensive LAN network configuration (both IPv4 and IPv6).\n\n**Returns:** Dictionary with keys:\n- `'ipv4'`: LAN IPv4 configuration\n- `'ipv6'`: LAN IPv6 configuration\n\n### get_dns_servers()\n\nGet DNS server configuration for both IPv4 and IPv6.\n\n**Returns:** Dictionary with keys:\n- `'ipv4'`: IPv4 DNS servers (comma-separated)\n- `'ipv6'`: IPv6 DNS servers (comma-separated)\n\n### set_ipv6_enabled(enabled=True, prefix_mode=\"DHCPv6\")\n\nEnable or disable IPv6 globally on the router.\n\n**Parameters:**\n- `enabled` (bool): Whether to enable IPv6 (default: True)\n- `prefix_mode` (str): IPv6 prefix mode when enabling - \"DHCPv6\" or \"RA\" (default: \"DHCPv6\")\n\n**Returns:** `bool` - True if successful\n\n### set_ipv6_prefix_delegation(mode=\"off\")\n\nConfigure IPv6 prefix delegation settings.\n\n**Parameters:**\n- `mode` (str): IPv6 prefix delegation mode - \"off\", \"on\", or \"on_with_dhcpv6\" (default: \"off\")\n\n**Returns:** `bool` - True if all configuration calls were successful\n\n**IPv6 Prefix Delegation Modes:**\n- `\"off\"`: Disable prefix delegation, use DHCPv6 mode for single address\n- `\"on\"`: Enable prefix delegation with RA (Router Advertisement) mode\n- `\"on_with_dhcpv6\"`: Enable prefix delegation with RA + DHCPv6 mode\n\n**Note:** This function makes multiple API calls (2-4 depending on mode) to configure both LAN and guest network prefix delegation.\n\n### disable_ipv6_prefix_delegation()\n\nDisable IPv6 prefix delegation.\n\n**Returns:** `bool` - True if successful\n\n**Note:** Convenience method that calls `set_ipv6_prefix_delegation(\"off\")`.\n\n### enable_ipv6_prefix_delegation(use_dhcpv6=False)\n\nEnable IPv6 prefix delegation.\n\n**Parameters:**\n- `use_dhcpv6` (bool): Whether to enable with DHCPv6 mode (True) or RA mode (False, default)\n\n**Returns:** `bool` - True if successful\n\n**Note:** \n- When `use_dhcpv6=False`: Uses RA (Router Advertisement) mode only\n- When `use_dhcpv6=True`: Uses RA + DHCPv6 combined mode\n\n### configure_ipv6_prefix_delegation(enabled=True, use_dhcpv6=False, prefix_length=56)\n\nComprehensive IPv6 prefix delegation configuration.\n\n**Parameters:**\n- `enabled` (bool): Whether to enable prefix delegation (default: True)\n- `use_dhcpv6` (bool): Whether to enable DHCPv6 mode when enabling (default: False = RA mode)\n- `prefix_length` (int): Prefix length for delegation (default: 56)\n\n**Returns:** `bool` - True if successful\n\n**Note:** This is the most comprehensive method that combines all prefix delegation options into a single call.\n\n### set_lan_ipv4_config(network=\"lan\", dns_servers=None, address=None, dhcp_enabled=None, dhcp_min_address=None, dhcp_max_address=None, prefix_length=None)\n\nConfigure LAN IPv4 settings including DNS servers and DHCP.\n\n**Parameters:**\n- `network` (str): Network to configure - \"lan\" (default) or \"guest\"\n- `dns_servers` (str): DNS servers (comma-separated, e.g., \"9.9.9.9,149.112.112.112\")\n- `address` (str): LAN gateway IP address (e.g., \"192.168.2.254\")\n- `dhcp_enabled` (bool): Whether to enable DHCP server\n- `dhcp_min_address` (str): DHCP range start (e.g., \"192.168.2.100\")\n- `dhcp_max_address` (str): DHCP range end (e.g., \"192.168.2.200\")\n- `prefix_length` (int): Network prefix length (e.g., 24 for /24)\n\n**Returns:** `bool` - True if successful\n\n### set_lan_ipv6_config(network=\"lan\", dns_servers=None)\n\nConfigure LAN IPv6 DNS servers.\n\n**Parameters:**\n- `network` (str): Network to configure - \"lan\" (default) or \"guest\"\n- `dns_servers` (str): IPv6 DNS servers (comma-separated, e.g., \"2620:fe::fe,2620:fe::9\")\n\n**Returns:** `bool` - True if successful\n\n### set_dns_servers(ipv4_dns=None, ipv6_dns=None, network=\"lan\")\n\nSet DNS servers for both IPv4 and IPv6 on specified network.\n\n**Parameters:**\n- `ipv4_dns` (str): IPv4 DNS servers (comma-separated, e.g., \"9.9.9.9,149.112.112.112\")\n- `ipv6_dns` (str): IPv6 DNS servers (comma-separated, e.g., \"2620:fe::fe,2620:fe::9\")\n- `network` (str): Network to configure - \"lan\" (default) or \"guest\"\n\n**Returns:** Dictionary with 'ipv4' and 'ipv6' keys indicating success for each\n\n### get_netmaster_config()\n\nGet NetMaster network configuration settings.\n\n**Returns:** Dictionary with network master configuration\n\n**NetMaster Config Fields:**\n- `EnableInterfaces`: Whether interfaces are enabled\n- `EnableIPv6`: Whether IPv6 is globally enabled\n- `IPv6PrefixMode`: IPv6 prefix mode (e.g., \"RA\" for Router Advertisement)\n- `DisablePhysicalInterfaces`: Whether physical interfaces are disabled\n- `WANMode`: WAN connection mode (e.g., \"Ethernet_PPP\")\n\n### get_dhcpv6_client_status()\n\nGet DHCPv6 client status (router acting as DHCPv6 client to ISP).\n\n**Returns:** Dictionary with DHCPv6 client information\n\n**DHCPv6 Client Status Fields:**\n- `Name`: Interface name (e.g., \"dhcpv6_pdata\")\n- `Enable`: Whether DHCPv6 client is enabled\n- `Status`: Current status (True/False)\n- `Flags`: Status flags (e.g., \"dhcpv6 enabled up\")\n- `Alias`: Interface alias\n- `DHCPStatus`: DHCP status (e.g., \"Bound\", \"Requesting\")\n- `LastConnectionError`: Last connection error (e.g., \"RenewTimeout\")\n- `Uptime`: Client uptime in seconds\n- `DSCPMark`: DSCP marking value\n- `DUID`: DHCP Unique Identifier\n- `RequestAddresses`: Whether requesting individual addresses\n- `RequestPrefixes`: Whether requesting prefix delegation\n- `RapidCommit`: Whether using rapid commit\n- `IAID`: Identity Association Identifier\n- `SuggestedT1`: Suggested renewal time (-1 = not set)\n- `SuggestedT2`: Suggested rebind time (-1 = not set)\n- `SupportedOptions`: Supported DHCP options\n- `RequestedOptions`: Requested DHCP options (comma-separated)\n- `Reason`: Status reason\n- `Renew`: Whether currently renewing\n- `ResetOnPhysDownTimeout`: Reset timeout on physical down\n- `CheckAuthentication`: Whether checking authentication\n- `AuthenticationInfo`: Authentication information\n- `RetryOnFailedAuth`: Whether retrying on failed authentication\n\n### get_firewall_level()\n\nGet the current firewall security level.\n\n**Returns:** `str` - Firewall level (e.g., \"Low\", \"Medium\", \"High\")\n\n### get_ping_response_settings(source_interface=\"data\")\n\nGet ping response settings for a specific interface.\n\n**Parameters:**\n- `source_interface` (str): Source interface to check (default: \"data\")\n\n**Returns:** Dictionary with ping response settings\n\n**Ping Response Settings Fields:**\n- `enableIPv4`: Whether responding to IPv4 pings is enabled\n- `enableIPv6`: Whether responding to IPv6 pings is enabled\n\n### get_firewall_config()\n\nGet comprehensive firewall configuration.\n\n**Returns:** Dictionary with firewall configuration\n\n**Firewall Config Fields:**\n- `Status`: Firewall status (\"Enabled\" or \"Disabled\")\n- `AdvancedLevel`: Advanced firewall level for IPv4\n- `AdvancedIPv6Level`: Advanced firewall level for IPv6\n- `ExcludedOriginsPCP`: Excluded origins for PCP\n- `UpnpPortForwardingStatus`: Current UPnP port forwarding status\n- `UpnpPortForwardingEnable`: Whether UPnP port forwarding is enabled\n- `ChainNumberOfEntries`: Number of firewall chain entries\n- `ProtocolForwardingNumberOfEntries`: Number of protocol forwarding entries\n- `PinholeNumberOfEntries`: Number of pinhole entries\n- `ListNumberOfEntries`: Number of list entries\n\n### get_dmz_config()\n\nGet DMZ (Demilitarized Zone) configuration.\n\n**Returns:** Dictionary with DMZ configuration\n\n**DMZ Config Fields:**\n- `Origin`: Configuration origin (e.g., \"webui\")\n- `SourceInterface`: Source interface (e.g., \"data\")\n- `DestinationIPAddress`: IP address of DMZ host\n- `SourcePrefix`: Source prefix filter\n- `Status`: DMZ status (\"Enabled\" or \"Disabled\")\n- `Enable`: Whether DMZ is enabled\n\n### set_upnp_enabled(enabled=True)\n\nEnable or disable UPnP port forwarding.\n\n**Parameters:**\n- `enabled` (bool): Whether to enable UPnP port forwarding (default: True)\n\n**Returns:** `bool` - True if successful\n\n**Note:**\nWhen enabled, devices on the network can automatically open ports through UPnP protocol. This can be convenient but may reduce security.\n\n### set_dmz_host(destination_ip, enabled=True, dmz_id=\"webui\", source_interface=\"data\")\n\nSet up a DMZ (Demilitarized Zone) host.\n\n**Parameters:**\n- `destination_ip` (str): IP address of the DMZ host (e.g., \"192.168.2.108\")\n- `enabled` (bool): Whether to enable the DMZ (default: True)\n- `dmz_id` (str): DMZ configuration ID (default: \"webui\")\n- `source_interface` (str): Source interface (default: \"data\")\n\n**Returns:** `str` - DMZ ID if successful, empty string if failed\n\n**Note:**\nDMZ forwards all incoming traffic to the specified host. This effectively puts the host outside the firewall protection. Only one DMZ host can be active at a time.\n\n### delete_dmz_host(dmz_id=\"webui\")\n\nDelete DMZ host configuration.\n\n**Parameters:**\n- `dmz_id` (str): DMZ configuration ID to delete (default: \"webui\")\n\n**Returns:** `bool` - True if successful\n\n### set_ping_response(source_interface=\"data\", enable_ipv4=True, enable_ipv6=True)\n\nConfigure ping response settings for router.\n\n**Parameters:**\n- `source_interface` (str): Source interface to configure (default: \"data\")\n- `enable_ipv4` (bool): Whether to respond to IPv4 pings (default: True)\n- `enable_ipv6` (bool): Whether to respond to IPv6 pings (default: True)\n\n**Returns:** `bool` - True if successful\n\n**Note:** When disabled, the router will not respond to ping requests from the internet, improving security but making connectivity testing harder.\n\n### enable_ping_response(ipv4=True, ipv6=True)\n\nEnable ping response for IPv4 and/or IPv6.\n\n**Parameters:**\n- `ipv4` (bool): Enable IPv4 ping response (default: True)\n- `ipv6` (bool): Enable IPv6 ping response (default: True)\n\n**Returns:** `bool` - True if successful\n\n**Note:** Convenience method that calls `set_ping_response(enable_ipv4=ipv4, enable_ipv6=ipv6)`.\n\n### disable_ping_response()\n\nDisable ping response for both IPv4 and IPv6.\n\n**Returns:** `bool` - True if successful\n\n**Note:** Convenience method that calls `set_ping_response(enable_ipv4=False, enable_ipv6=False)`.\n\n### set_firewall_level(level=\"Medium\", ipv6_level=None)\n\nSet firewall security level for IPv4 and optionally IPv6.\n\n**Parameters:**\n- `level` (str): Firewall level - \"Low\", \"Medium\", \"High\", or \"Custom\" (default: \"Medium\")\n- `ipv6_level` (str): IPv6 firewall level - if None, uses same as IPv4 level (default: None)\n\n**Returns:** Dictionary with 'ipv4' and 'ipv6' keys indicating success for each\n\n**Firewall Levels:**\n- `Low`: Minimal protection, allows most traffic\n- `Medium`: Balanced protection and functionality\n- `High`: Maximum protection, blocks more traffic\n- `Custom`: Allows custom firewall rules (required for custom rule methods)\n\n### set_firewall_level_ipv4(level=\"Medium\")\n\nSet IPv4 firewall security level.\n\n**Parameters:**\n- `level` (str): Firewall level - \"Low\", \"Medium\", \"High\", or \"Custom\" (default: \"Medium\")\n\n**Returns:** `bool` - True if successful\n\n### set_firewall_level_ipv6(level=\"Medium\")\n\nSet IPv6 firewall security level.\n\n**Parameters:**\n- `level` (str): Firewall level - \"Low\", \"Medium\", \"High\", or \"Custom\" (default: \"Medium\")\n\n**Returns:** `bool` - True if successful\n\n### enable_custom_firewall()\n\nEnable custom firewall mode for both IPv4 and IPv6.\n\n**Returns:** Dictionary with 'ipv4' and 'ipv6' keys indicating success for each\n\n**Note:** This is required before using custom firewall rule methods. Sets both IPv4 and IPv6 firewall levels to \"Custom\".\n\n### get_custom_firewall_rules()\n\nGet all custom firewall rules.\n\n**Returns:** List of custom firewall rule dictionaries\n\n**Custom Rule Fields:**\n- `Id`: Rule identifier (e.g., \"ssh\", \"http\", \"myshit\")\n- `Target`: Rule action (\"Accept\" or \"Drop\")\n- `Status`: Rule status (\"Enabled\" or \"Disabled\")\n- `Class`: Rule class (e.g., \"Forward\")\n- `IPVersion`: IP version (4 or 6)\n- `Protocol`: Protocol number (6=TCP, 17=UDP, comma-separated)\n- `DestinationPort`: Destination port or port range (e.g., \"22\", \"6660-6669\")\n- `SourcePort`: Source port filter\n- `DestinationPrefix`: Destination IP prefix filter\n- `SourcePrefix`: Source IP prefix filter\n- `DestinationMACAddress`: Destination MAC address filter\n- `SourceMACAddress`: Source MAC address filter\n- `TargetChain`: Target firewall chain\n- `Description`: Rule description\n- `Enable`: Whether rule is enabled\n\n**Note:** This method requires Custom firewall level to be enabled.\n\n### add_custom_firewall_rule(rule_id, action=\"Accept\", protocol=\"6\", destination_port=\"\", source_port=\"\", destination_prefix=\"\", source_prefix=\"\", ip_version=4, chain=None, enabled=True)\n\nAdd or update a custom firewall rule.\n\n**Parameters:**\n- `rule_id` (str): Unique identifier for the rule (e.g., \"ssh\", \"myapp\")\n- `action` (str): Rule action - \"Accept\" or \"Drop\" (default: \"Accept\")\n- `protocol` (str): Protocol number - \"6\" (TCP), \"17\" (UDP), or \"6,17\" (default: \"6\")\n- `destination_port` (str): Destination port or range (e.g., \"22\", \"8080\", \"6660-6669\")\n- `source_port` (str): Source port filter (default: \"\")\n- `destination_prefix` (str): Destination IP address/prefix (e.g., \"192.168.2.100\")\n- `source_prefix` (str): Source IP address/prefix filter (default: \"\")\n- `ip_version` (int): IP version - 4 or 6 (default: 4)\n- `chain` (str): Firewall chain - auto-determined if None (default: None)\n- `enabled` (bool): Whether to enable the rule (default: True)\n\n**Returns:** `str` - Rule ID if successful, empty string if failed\n\n**Notes:**\n- Requires Custom firewall level to be enabled\n- Chain is auto-determined: \"Custom\" for IPv4, \"Custom_V6Out\" for IPv6\n- Protocol numbers: 6=TCP, 17=UDP, 1=ICMP, 58=ICMPv6\n- Port ranges: \"80\", \"80-90\", \"80,443,8080\"\n\n### delete_custom_firewall_rule(rule_id, ip_version=4, chain=None)\n\nDelete a custom firewall rule.\n\n**Parameters:**\n- `rule_id` (str): Rule identifier to delete\n- `ip_version` (int): IP version of the rule - 4 or 6 (default: 4)\n- `chain` (str): Firewall chain - auto-determined if None (default: None)\n\n**Returns:** `bool` - True if successful\n\n**Note:** Chain is auto-determined: \"Custom\" for IPv4, \"Custom_V6Out\" for IPv6\n\n### update_custom_firewall_rule(rule_id, **kwargs)\n\nUpdate an existing custom firewall rule.\n\n**Parameters:**\n- `rule_id` (str): Rule identifier to update\n- `**kwargs`: Rule parameters to update (same as add_custom_firewall_rule)\n\n**Returns:** `str` - Rule ID if successful, empty string if failed\n\n**Note:** This is equivalent to calling add_custom_firewall_rule with the same rule_id. Only specified parameters will be updated.\n\n### manage_custom_firewall_rule(action, rule_id, **kwargs)\n\nManage custom firewall rules with a unified interface.\n\n**Parameters:**\n- `action` (str): Action to perform - \"add\", \"update\", \"delete\", \"enable\", \"disable\"\n- `rule_id` (str): Rule identifier\n- `**kwargs`: Rule parameters (for add/update actions)\n\n**Returns:** \n- For add/update: Rule ID if successful, empty string if failed\n- For delete/enable/disable: True if successful, False if failed\n\n### get_dhcp_static_leases(pool_id=\"default\")\n\nGet DHCP static lease reservations for a specific pool.\n\n**Parameters:**\n- `pool_id` (str): DHCP pool ID - `\"default\"` or `\"guest\"` (default: \"default\")\n\n**Returns:** List of static lease dictionaries\n\n**Static Lease Fields:**\n- `PoolID`: DHCP pool identifier (\"default\" or \"guest\")\n- `IPAddress`: Reserved IP address\n- `MACAddress`: Device MAC address\n- `LeasePath`: Internal lease path identifier\n\n### get_default_dhcp_static_leases()\n\nGet DHCP static lease reservations for the default network.\n\n**Returns:** List of static lease dictionaries for default network\n\n### get_guest_dhcp_static_leases()\n\nGet DHCP static lease reservations for the guest network.\n\n**Returns:** List of static lease dictionaries for guest network\n\n### get_all_dhcp_static_leases()\n\nGet static DHCP leases (IP reservations) for all pools.\n\n**Returns:** Dictionary with keys:\n- `'default'`: List of default network static leases\n- `'guest'`: List of guest network static leases\n\n### add_static_lease(mac_address, ip_address, pool_id=\"default\")\n\nAdd a static DHCP lease (IP reservation) for a device.\n\n**Parameters:**\n- `mac_address` (str): MAC address of the device (e.g., \"50:DE:06:9A:A6:98\")\n- `ip_address` (str): IP address to reserve (e.g., \"192.168.2.118\")\n- `pool_id` (str): DHCP pool ID (\"default\" for home network, \"guest\" for guest network)\n\n**Returns:** `bool` - True if static lease was successfully added\n\n**Note:** This ensures a device with the specified MAC address will always receive the same IP address from the DHCP server.\n\n### delete_static_lease(mac_address, pool_id=\"default\")\n\nDelete a static DHCP lease (IP reservation) for a device.\n\n**Parameters:**\n- `mac_address` (str): MAC address of the device (e.g., \"50:DE:06:9A:A6:98\")\n- `pool_id` (str): DHCP pool ID (\"default\" for home network, \"guest\" for guest network)\n\n**Returns:** `bool` - True if static lease was successfully deleted\n\n**Note:** This removes the IP reservation, allowing the device to receive any available IP address from the DHCP pool.\n\n### set_static_lease(mac_address, ip_address, pool_id=\"default\")\n\nSet/update a static DHCP lease (IP reservation) for a device.\n\n**Parameters:**\n- `mac_address` (str): MAC address of the device (e.g., \"00:17:88:4A:40:B4\")\n- `ip_address` (str): IP address to reserve (e.g., \"192.168.2.124\")\n- `pool_id` (str): DHCP pool ID (\"default\" for home network, \"guest\" for guest network)\n\n**Returns:** `bool` - True if static lease was successfully set/updated\n\n**Note:** This modifies an existing IP reservation or creates a new one if it doesn't exist.\n\n### manage_device_ip_reservation(mac_address, ip_address=None, action=\"add\", pool_id=\"default\")\n\nComprehensive IP reservation management for a device.\n\n**Parameters:**\n- `mac_address` (str): MAC address of the device\n- `ip_address` (str): IP address to reserve (required for add/set actions)\n- `action` (str): Action to perform (\"add\", \"delete\", \"set\", \"update\")\n- `pool_id` (str): DHCP pool ID (\"default\" or \"guest\")\n\n**Returns:** `bool` - True if action was successful\n\n### reserve_device_ip(device_identifier, ip_address, pool_id=\"default\", auto_detect_mac=True)\n\nReserve an IP address for a device (with smart device detection).\n\n**Parameters:**\n- `device_identifier` (str): MAC address or device name\n- `ip_address` (str): IP address to reserve\n- `pool_id` (str): DHCP pool ID (\"default\" or \"guest\")\n- `auto_detect_mac` (bool): If True, try to find MAC address from device name\n\n**Returns:** `bool` - True if reservation was successful\n\n### get_device_ip_reservation(mac_address, pool_id=\"default\")\n\nGet IP reservation information for a specific device.\n\n**Parameters:**\n- `mac_address` (str): MAC address of the device\n- `pool_id` (str): DHCP pool ID (\"default\" or \"guest\")\n\n**Returns:** Dictionary with reservation information or empty dict if not found\n\n### list_ip_reservations(pool_id=\"default\", include_device_info=True)\n\nList all IP reservations with enhanced device information.\n\n**Parameters:**\n- `pool_id` (str): DHCP pool ID (\"default\" or \"guest\")\n- `include_device_info` (bool): Include device names and types from device list\n\n**Returns:** List of IP reservations with device information\n\n**Enhanced Fields (when include_device_info=True):**\n- `device_name`: Device name from device list\n- `device_type`: Device type from device list\n- `active`: Whether device is currently connected\n- `last_seen`: Last connection timestamp\n\n### suggest_available_ips(pool_id=\"default\", count=5)\n\nSuggest available IP addresses for new reservations.\n\n**Parameters:**\n- `pool_id` (str): DHCP pool ID (\"default\" or \"guest\")\n- `count` (int): Number of IP suggestions to return\n\n**Returns:** List of suggested available IP addresses\n\n### cleanup_invalid_reservations(pool_id=\"default\")\n\nClean up invalid or conflicting IP reservations.\n\n**Parameters:**\n- `pool_id` (str): DHCP pool ID (\"default\" or \"guest\")\n\n**Returns:** Dictionary with cleanup results\n\n**Cleanup Result Fields:**\n- `invalid_range`: List of reservations with IPs outside DHCP range\n- `duplicate_ips`: Dictionary of duplicate IP assignments\n- `total_issues`: Total number of issues found\n- `recommendations`: List of recommended actions\n\n### get_device_schedules(schedule_type=\"ToD\")\n\nGet device access schedules (Time of Day restrictions).\n\n**Parameters:**\n- `schedule_type` (str): Type of schedule to retrieve (default: \"ToD\")\n\n**Returns:** List of device schedule dictionaries\n\n**Device Schedule Fields:**\n- `ID`: Device identifier (usually MAC address)\n- `name`: Device name\n- `enable`: Whether scheduling is enabled for this device\n- `base`: Schedule base type (e.g., \"Weekly\")\n- `def`: Default state (\"Enable\" or \"Disable\")\n- `stateMode`: Current state mode (\"Default\", \"Override\")\n- `override`: Override setting (\"Enable\", \"Disable\", or \"\")\n- `temporaryOverride`: Whether temporary override is active\n- `value`: Current effective value (\"Enable\" or \"Disable\")\n- `schedule`: List of schedule rules\n- `device`: Device location (\"LOCAL\")\n- `target`: List of target devices\n\n### get_hgw_device_info()\n\nGet detailed Home Gateway (HGW) device information.\n\n**Returns:** Dictionary with comprehensive HGW device information\n\n**HGW Device Info Fields:**\n- `Key`: Device key (MAC address)\n- `DiscoverySource`: How device was discovered (e.g., \"selfhgw\")\n- `Name`: Device name\n- `DeviceType`: Device type (\"SAH HGW\")\n- `Active`: Whether device is active\n- `Tags`: Device tags (space-separated)\n- `FirstSeen`: First discovery timestamp\n- `LastConnection`: Last connection timestamp\n- `LastChanged`: Last change timestamp\n- `Master`: Master device identifier\n- `Manufacturer`: Device manufacturer (e.g., \"Arcadyan\")\n- `ModelName`: Device model (e.g., \"BoxV14\")\n- `Description`: Device description\n- `SerialNumber`: Device serial number\n- `ProductClass`: Product class\n- `HardwareVersion`: Hardware version\n- `SoftwareVersion`: Software/firmware version\n- `BootLoaderVersion`: Bootloader version\n- `FirewallLevel`: Current firewall level\n- `LinkType`: Link type (e.g., \"ethernet\")\n- `LinkState`: Link state (e.g., \"up\", \"down\")\n- `ConnectionProtocol`: Connection protocol (e.g., \"ppp\")\n- `ConnectionState`: Connection state (e.g., \"Connected\")\n- `LastConnectionError`: Last connection error\n- `ConnectionIPv4Address`: Current public IPv4 address\n- `ConnectionIPv6Address`: Current public IPv6 address\n- `RemoteGateway`: ISP gateway address\n- `DNSServers`: DNS servers (comma-separated)\n- `Internet`: Whether internet is available\n- `IPTV`: Whether IPTV service is available\n- `Telephony`: Whether telephony service is available\n- `IPAddress`: Local IP address\n- `IPAddressSource`: IP address source (e.g., \"Static\")\n- `Index`: Device index\n- `Actions`: Available device actions\n- `IPv6Address`: List of IPv6 addresses with details\n- `Names`: List of device names from different sources\n- `DeviceTypes`: List of device types from different sources\n\n### get_router_time()\n\nGet the current time from the router.\n\n**Returns:** `str` - Current time (e.g., \"Wed, 04 Jun 2025 19:50:34 GMT+0200\")\n\n### get_ntp_servers()\n\nGet configured NTP (Network Time Protocol) servers.\n\n**Returns:** Dictionary with NTP servers where keys are server numbers and values are server addresses\n\n### get_ntp_servers_list()\n\nGet configured NTP servers as a list.\n\n**Returns:** List of NTP server addresses\n\n### set_ntp_servers(servers)\n\nConfigure NTP (Network Time Protocol) servers.\n\n**Parameters:**\n- `servers` (dict): Dictionary mapping server numbers to server addresses\n  Example: {\n    \"1\": \"time.kpn.net\",\n    \"2\": \"0.nl.pool.ntp.org\", \n    \"3\": \"1.nl.pool.ntp.org\",\n    \"4\": \"2.nl.pool.ntp.org\",\n    \"5\": \"3.nl.pool.ntp.org\"\n  }\n\n**Returns:** `bool` - True if successful\n\n**Note:**\n- Server numbers should be strings (\"1\", \"2\", etc.)\n- You can configure up to 5 NTP servers\n- Common NTP servers: time.kpn.net, pool.ntp.org servers\n\n### get_time_config()\n\nGet comprehensive time configuration including current time and NTP servers.\n\n**Returns:** Dictionary with keys:\n- `'current_time'`: Current router time\n- `'ntp_servers'`: Dictionary of NTP servers\n- `'ntp_servers_list'`: List of NTP server addresses\n\n### run_download_speedtest()\n\nRun a download speed test using KPN's speed test service.\n\n**Note:** This test takes several seconds to complete and will consume bandwidth.\n\n**Returns:** Dictionary with download speed test results\n\n**Download Speedtest Fields:**\n- `RetrievedStartTS`: Test start timestamp (ISO format)\n- `RetrievedTS`: Test end timestamp (ISO format)\n- `testserver`: Speed test server used (e.g., \"speedtests.kpn.com\")\n- `interface`: Network interface used (e.g., \"data\")\n- `latency`: Network latency in milliseconds\n- `suite`: Test suite used (e.g., \"BCMSpeedSvc\")\n- `duration`: Test duration in milliseconds\n- `rxbytes`: Total bytes received during test\n- `throughput`: Download throughput in kilobits per second\n\n### run_upload_speedtest()\n\nRun an upload speed test using KPN's speed test service.\n\n**Note:** This test takes several seconds to complete and will consume bandwidth.\n\n**Returns:** Dictionary with upload speed test results\n\n**Upload Speedtest Fields:**\n- `RetrievedStartTS`: Test start timestamp (ISO format)\n- `RetrievedTS`: Test end timestamp (ISO format)\n- `testserver`: Speed test server used (e.g., \"speedtests.kpn.com\")\n- `interface`: Network interface used (e.g., \"data\")\n- `latency`: Network latency in milliseconds\n- `suite`: Test suite used (e.g., \"BCMSpeedSvc\")\n- `duration`: Test duration in milliseconds\n- `rxbytes`: Total bytes sent during test\n- `throughput`: Upload throughput in kilobits per second\n\n### run_full_speedtest()\n\nRun both download and upload speed tests sequentially.\n\n**Note:** This test takes 10+ seconds to complete and will consume significant bandwidth.\n\n**Returns:** Dictionary with keys:\n- `'download'`: Download speed test results\n- `'upload'`: Upload speed test results\n\n### format_speed(kilobits_per_second)\n\nHelper method to format speed in human-readable format.\n\n**Parameters:**\n- `kilobits_per_second` (int): Speed in kilobits per second (as returned by KPN Box API)\n\n**Returns:** `str` - Formatted speed string (e.g., \"100.5 Mbps\", \"1.2 Gbps\")\n\n### run_traceroute(host, ip_version=\"IPv4\")\n\nRun a traceroute diagnostic to a target host.\n\n**Parameters:**\n- `host` (str): Target hostname or IP address (e.g., \"www.google.com\", \"8.8.8.8\")\n- `ip_version` (str): IP version to use - \"IPv4\", \"IPv6\", or \"Any\" (default: \"IPv4\")\n\n**Returns:** Dictionary with traceroute results\n\n**Traceroute Result Fields:**\n- `DiagnosticState`: Test state (\"Complete\", \"Error\", \"InProgress\")\n- `Interface`: Network interface used\n- `ProtocolVersion`: IP version used (\"IPv4\" or \"IPv6\")\n- `Host`: Target hostname or IP\n- `NumberOfTries`: Number of attempts per hop (default: 3)\n- `Timeout`: Timeout per hop in milliseconds (default: 5000)\n- `DataBlockSize`: Packet size in bytes\n- `DSCP`: DSCP marking value\n- `MaxHopCount`: Maximum number of hops (default: 30)\n- `IPAddressUsed`: Resolved IP address of target\n- `ResponseTime`: Total test duration in milliseconds\n- `RouteHopsNumberOfEntries`: Number of hops in route\n- `RouteHops`: Dictionary of hop information with hop number as key and values:\n  - `Host`: Reverse DNS hostname (may be empty)\n  - `HostAddress`: IP address of hop router\n  - `ErrorCode`: Error code (0=success, 11=TTL exceeded, 4294967295=no response)\n  - `RTTimes`: Round-trip times in milliseconds (comma-separated, e.g., \"18,2,2\")\n\n### run_ping(host, protocol_version=\"Any\")\n\nRun a ping diagnostic to a target host.\n\n**Parameters:**\n- `host` (str): Target hostname or IP address (e.g., \"www.google.com\", \"8.8.8.8\")\n- `protocol_version` (str): Protocol version - \"Any\", \"IPv4\", or \"IPv6\" (default: \"Any\")\n\n**Returns:** Dictionary with ping results\n\n**Ping Result Fields:**\n- `DiagnosticsState`: Test state (\"Success\", \"Error\", \"InProgress\")\n- `ipHost`: Resolved IP address of target\n- `packetsSuccess`: Number of successful ping packets\n- `packetsFailed`: Number of failed ping packets\n- `packetSize`: Size of ping packets in bytes\n- `averageResponseTime`: Average response time in milliseconds\n- `minimumResponseTime`: Minimum response time in milliseconds\n- `maximumResponseTime`: Maximum response time in milliseconds\n\n### set_interface_duplex(interface=\"eth4\", duplex_mode=\"Auto\")\n\nSet network interface duplex mode.\n\n**Parameters:**\n- `interface` (str): Interface name (default: \"eth4\" for WAN)\n- `duplex_mode` (str): Duplex mode - \"Auto\", \"Half\", or \"Full\" (default: \"Auto\")\n\n**Returns:** `bool` - True if successful\n\n### set_interface_speed(interface=\"eth4\", max_speed=-1)\n\nSet network interface maximum link speed.\n\n**Parameters:**\n- `interface` (str): Interface name (default: \"eth4\" for WAN)\n- `max_speed` (int): Maximum speed in Mbps, or -1 for Auto (default: -1)\n\n**Returns:** `bool` - True if successful\n\n### get_iptv_ip()\n\nGet the IP address of the IPTV interface.\n\n**Returns:** `str` - IPTV interface IP address (e.g., \"10.233.241.178\")\n\n### get_voice_profiles()\n\nGet voice service profiles configuration.\n\n**Returns:** Dictionary with voice profiles\n\n**Voice Profile Fields:**\n- `SIP-Trunk1`, `SIP-Trunk2`, `SIP-Trunk3`, `SIP-Trunk4`: SIP trunk profiles\n- `ATA`: Analog Telephone Adapter profile with Name field\n- `SIP-Extensions`: SIP extensions profile with Name field\n\n### get_voice_trunks()\n\nGet SIP trunk configurations for telephone service.\n\n**Returns:** List of SIP trunk dictionaries\n\n**Voice Trunk Fields:**\n- `name`: Trunk name (e.g., \"SIP-Trunk1\")\n- `trunkName`: Trunk identifier\n- `signalingProtocol`: Protocol used (\"SIP\")\n- `enable`: Whether trunk is enabled (\"Enabled\"/\"Disabled\")\n- `dtmfMethod`: DTMF method (e.g., \"RFC2833\")\n- `trunk_lines`: List of trunk lines with details:\n  - `name`: Line name (e.g., \"LINE11\")\n  - `enable`: Line enable status\n  - `status`: Line status\n  - `directoryNumber`: Phone number\n  - `uri`: SIP URI\n  - `authUserName`: Authentication username\n  - `friendlyName`: Display name\n- `sip`: SIP configuration:\n  - `proxyServer`: SIP proxy server\n  - `proxyServerPort`: Proxy port (default: 5060)\n  - `registrarServer`: SIP registrar server\n  - `userAgentDomain`: User agent domain\n  - `sessionExpire`: Session expiration time\n- `rtp`: RTP configuration:\n  - `localPortMin`: Minimum local port\n  - `localPortMax`: Maximum local port\n\n### get_voice_groups()\n\nGet voice groups configuration.\n\n**Returns:** List of voice group dictionaries\n\n**Voice Group Fields:**\n- `group_id`: Group identifier (e.g., \"Group1\")\n- `ep_names`: List of endpoint names in the group\n\n### get_voice_handsets()\n\nGet voice handsets/endpoints configuration.\n\n**Returns:** List of handset dictionaries\n\n**Voice Handset Fields:**\n- `line`: Line identifier (e.g., \"FXS1\", \"Account1\")\n- `name`: Handset name\n- `enable`: Whether handset is enabled (\"Enabled\"/\"Disabled\")\n- `status`: Current status (\"Up\"/\"Down\"/\"Disabled\")\n- `directoryNumber`: Phone number or extension\n- `endpointType`: Type of endpoint (\"FXS\", \"SIP\")\n- `dtmfMethod`: DTMF method (\"Inherit\" or specific)\n- `outgoingTrunkLine`: Associated trunk line\n- `outgoingSubscriberNumberId`: Subscriber number ID\n- `callWaitingEnable`: Whether call waiting is enabled\n- `sipExtensionIPAddress`: SIP extension IP (for SIP endpoints)\n- `authUserName`: Authentication username (for SIP endpoints)\n\n### ring_test_phone()\n\nRing the phone for testing purposes.\n\n**Returns:** `bool` - True if ring test command was sent successfully\n\n### enable_guest_network(enabled=True)\n\nEnable or disable the guest WiFi network completely.\n\n**Parameters:**\n- `enabled` (bool): Whether to enable guest network (default: True)\n\n**Returns:** `bool` - True if all operations successful\n\n**Note:** This function makes 3 API calls to fully enable/disable guest networking.\n\n### set_guest_wifi_config(ssid_2g=None, ssid_5g=None, password_2g=None, password_5g=None, security_mode_2g=None, security_mode_5g=None, mfp_config_2g=\"\", mfp_config_5g=\"\")\n\nConfigure guest WiFi network settings (SSID, password, security).\n\n**Parameters:**\n- `ssid_2g` (str): 2.4GHz guest network name/SSID\n- `ssid_5g` (str): 5GHz guest network name/SSID\n- `password_2g` (str): 2.4GHz guest network password\n- `password_5g` (str): 5GHz guest network password\n- `security_mode_2g` (str): 2.4GHz security mode (e.g., \"WPA2-Personal\", \"WPA3-Personal\")\n- `security_mode_5g` (str): 5GHz security mode (e.g., \"WPA2-Personal\", \"WPA3-Personal\")\n- `mfp_config_2g` (str): 2.4GHz Management Frame Protection - \"\", \"Optioneel\", \"Benodigd\", \"Uit\" (default: \"\")\n- `mfp_config_5g` (str): 5GHz Management Frame Protection - \"\", \"Optioneel\", \"Benodigd\", \"Uit\" (default: \"\")\n\n**Returns:** `bool` - True if successful\n\n**Note:** Uses the same underlying API as regular WiFi configuration but targets guest network VAPs.\n\n### set_guest_wifi_visibility(visible_2g=None, visible_5g=None)\n\nEnable or disable guest WiFi network visibility (SSID advertisement).\n\n**Parameters:**\n- `visible_2g` (bool): Whether 2.4GHz guest network should be visible (broadcast SSID)\n- `visible_5g` (bool): Whether 5GHz guest network should be visible (broadcast SSID)\n\n**Returns:** `bool` - True if successful\n\n**Note:** Uses the same underlying API as regular WiFi visibility but targets guest network VAPs (vap2g0guest, vap5g0guest).\n\n### set_guest_bandwidth_limit(limit_mbps=0)\n\nSet bandwidth limitation for guest network.\n\n**Parameters:**\n- `limit_mbps` (int): Bandwidth limit in Mbps (0 = unlimited, max 50000 = 50 Gbps)\n\n**Returns:** `bool` - True if successful\n\n### enable_extra_wifi(enabled_2g=None, enabled_5g=None)\n\nEnable or disable extra WiFi networks.\n\n**Parameters:**\n- `enabled_2g` (bool): Whether to enable 2.4GHz extra network\n- `enabled_5g` (bool): Whether to enable 5GHz extra network\n\n**Returns:** Dictionary with 'band_2g' and 'band_5g' keys indicating success for each band\n\n**Note:** Extra WiFi networks provide a third set of WiFi networks (beyond regular and guest).\n\n### set_extra_wifi_config(ssid_2g=None, ssid_5g=None, password_2g=None, password_5g=None, security_mode_2g=None, security_mode_5g=None, mfp_config_2g=\"\", mfp_config_5g=\"\")\n\nConfigure extra WiFi network settings (SSID, password, security).\n\n**Parameters:**\n- `ssid_2g` (str): 2.4GHz extra network name/SSID\n- `ssid_5g` (str): 5GHz extra network name/SSID\n- `password_2g` (str): 2.4GHz extra network password\n- `password_5g` (str): 5GHz extra network password\n- `security_mode_2g` (str): 2.4GHz security mode (e.g., \"WPA2-Personal\", \"WPA3-Personal\")\n- `security_mode_5g` (str): 5GHz security mode (e.g., \"WPA2-Personal\", \"WPA3-Personal\")\n- `mfp_config_2g` (str): 2.4GHz Management Frame Protection - \"\", \"Optioneel\", \"Benodigd\", \"Uit\" (default: \"\")\n- `mfp_config_5g` (str): 5GHz Management Frame Protection - \"\", \"Optioneel\", \"Benodigd\", \"Uit\" (default: \"\")\n\n**Returns:** `bool` - True if successful\n\n**Note:** Uses the same underlying API as regular WiFi configuration but targets extra network VAPs (vap2g0ext, vap5g0ext).\n\n### set_extra_wifi_visibility(visible_2g=None, visible_5g=None)\n\nEnable or disable extra WiFi network visibility (SSID advertisement).\n\n**Parameters:**\n- `visible_2g` (bool): Whether 2.4GHz extra network should be visible (broadcast SSID)\n- `visible_5g` (bool): Whether 5GHz extra network should be visible (broadcast SSID)\n\n**Returns:** `bool` - True if successful\n\n**Note:** Uses the same underlying API as regular WiFi visibility but targets extra network VAPs (vap2g0ext, vap5g0ext).\n\n### get_wifi_status()\n\nGet overall WiFi status and configuration.\n\n**Returns:** Dictionary with WiFi status including:\n- `Enable`: Whether WiFi is globally enabled\n- `Status`: Current WiFi status\n- Various WiFi configuration fields\n\n### set_wifi_enabled(enabled=True, sync_extenders=True)\n\nEnable or disable WiFi radios completely.\n\n**Parameters:**\n- `enabled` (bool): Whether to enable WiFi (default: True)\n- `sync_extenders` (bool): Whether to keep WiFi on extenders enabled (default: True)\n\n**Returns:** `bool` - True if all operations successful\n\n**Note:** This function makes 5-6 API calls to completely enable/disable WiFi radios and networks.\n\n### set_wifi_radio_config(band_2g_config=None, band_5g_config=None)\n\nConfigure WiFi radio settings for 2.4GHz and/or 5GHz bands.\n\n**Parameters:**\n- `band_2g_config` (dict): 2.4GHz radio configuration dictionary with keys:\n  - `AutoChannelEnable`: Whether to enable auto channel selection (bool)\n  - `OperatingChannelBandwidth`: Channel bandwidth (\"20MHz\", \"40MHz\")\n  - `OperatingStandards`: Supported standards (e.g., \"g,n,ax\")\n- `band_5g_config` (dict): 5GHz radio configuration dictionary with keys:\n  - `AutoChannelEnable`: Whether to enable auto channel selection (bool)\n  - `OperatingChannelBandwidth`: Channel bandwidth (\"20MHz\", \"40MHz\", \"80MHz\", \"160MHz\")\n  - `OperatingStandards`: Supported standards (e.g., \"a,n,ac,ax\")\n\n**Returns:** Dictionary with 'band_2g' and 'band_5g' keys indicating success for each band\n\n### set_wifi_radio_defaults()\n\nSet WiFi radio configuration to recommended defaults.\n\n**Returns:** Dictionary with 'band_2g' and 'band_5g' keys indicating success for each band\n\n**Note:** Sets auto channel, 20MHz for 2.4GHz, 80MHz for 5GHz, and modern standards.\n\n### enable_wifi_schedule(network_id=\"wl0\", enabled=True)\n\nEnable or disable WiFi time scheduling.\n\n**Parameters:**\n- `network_id` (str): WiFi network identifier (default: \"wl0\")\n- `enabled` (bool): Whether to enable scheduling (default: True)\n\n**Returns:** `bool` - True if successful\n\n### set_wifi_schedule(network_id=\"wl0\", disable_blocks=None, enabled=True)\n\nSet WiFi time schedule with specific disable periods.\n\n**Parameters:**\n- `network_id` (str): WiFi network identifier (default: \"wl0\")\n- `disable_blocks` (list): List of time blocks when WiFi should be disabled. Each block is a dict with 'begin' and 'end' keys (seconds from Monday 00:00)\n- `enabled` (bool): Whether the schedule should be enabled (default: True)\n\n**Returns:** `bool` - True if successful\n\n**Example:**\n```python\n# Disable WiFi from 10 PM to 6 AM on Monday\napi.set_wifi_schedule(disable_blocks=[\n    {\"begin\": 79200, \"end\": 108000}  # Monday 22:00 to Tuesday 06:00\n])\n```\n\n### set_wifi_bedtime_schedule(network_id=\"wl0\", bedtime_hour=22, wakeup_hour=6, weekdays_only=True)\n\nSet a simple bedtime WiFi schedule (disable during night hours).\n\n**Parameters:**\n- `network_id` (str): WiFi network identifier (default: \"wl0\")\n- `bedtime_hour` (int): Hour to disable WiFi (0-23, default: 22 = 10 PM)\n- `wakeup_hour` (int): Hour to enable WiFi (0-23, default: 6 = 6 AM)\n- `weekdays_only` (bool): Whether to apply only on weekdays (default: True)\n\n**Returns:** `bool` - True if successful\n\n### clear_wifi_schedule(network_id=\"wl0\")\n\nClear WiFi schedule (remove all time restrictions).\n\n**Parameters:**\n- `network_id` (str): WiFi network identifier (default: \"wl0\")\n\n**Returns:** `bool` - True if successful\n\n### set_interface_speed(interface=\"eth4\", max_speed=-1)\n\nSet network interface maximum link speed.\n\n**Parameters:**\n- `interface` (str): Interface name (default: \"eth4\" for WAN)\n- `max_speed` (int): Maximum speed in Mbps, or -1 for Auto (default: -1)\n\n**Returns:** `bool` - True if successful\n\n### set_port4_guest_network(enabled=True)\n\nEnable or disable guest network on Ethernet port 4.\n\n**Parameters:**\n- `enabled` (bool): Whether to enable guest network on port 4 (default: True)\n  - When `True`: Port 4 connects to guest network\n  - When `False`: Port 4 connects to home LAN network\n\n**Returns:** `bool` - True if both API calls were successful\n\n**Note:** \n- Port 4 corresponds to ETH3 interface in the KPN Box\n- This function makes 2 API calls to remove and add the interface to the appropriate bridge (lan or guest)\n- Devices connected to port 4 will receive IP addresses from the selected network\n\n### enable_port4_guest_network()\n\nEnable guest network on Ethernet port 4.\n\n**Returns:** `bool` - True if successful\n\n**Note:** Convenience method that calls `set_port4_guest_network(True)`.\n\n### disable_port4_guest_network()\n\nDisable guest network on Ethernet port 4 (return to home LAN).\n\n**Returns:** `bool` - True if successful\n\n**Note:** Convenience method that calls `set_port4_guest_network(False)`.\n\n### configure_ethernet_port(port=4, guest_network=False)\n\nConfigure Ethernet port network assignment.\n\n**Parameters:**\n- `port` (int): Ethernet port number (currently only port 4 is supported)\n- `guest_network` (bool): Whether to assign port to guest network (default: False)\n\n**Returns:** `bool` - True if successful\n\n**Note:** Currently only port 4 (ETH3) configuration is supported.\n\n### set_stp_enabled(enabled=True)\n\nEnable or disable STP (Spanning Tree Protocol) on the bridge.\n\n**Parameters:**\n- `enabled` (bool): Whether to enable STP (default: True)\n\n**Returns:** `bool` - True if successful\n\n**Note:**\n- STP helps prevent network loops in bridged networks\n- Disabling STP can improve performance but may cause loops if multiple network paths exist\n\n### enable_stp()\n\nEnable STP (Spanning Tree Protocol).\n\n**Returns:** `bool` - True if successful\n\n**Note:** Convenience method that calls `set_stp_enabled(True)`.\n\n### disable_stp()\n\nDisable STP (Spanning Tree Protocol).\n\n**Returns:** `bool` - True if successful\n\n**Note:** Convenience method that calls `set_stp_enabled(False)`.\n\n### get_wifi_mac_filter_status()\n\nGet WiFi MAC filtering status and current whitelist.\n\n**Returns:** Dictionary with MAC filtering status\n\n**MAC Filter Status Fields:**\n- `enabled`: Whether MAC filtering is enabled (True/False)\n- `mode`: Current filtering mode (\"WhiteList\" or \"Off\")\n- `allowed_devices`: List of MAC addresses on whitelist\n- `count`: Number of devices on whitelist\n\n**Note:** MAC filtering only affects home and extra WiFi networks. Guest networks and wired devices are not affected.\n\n### set_wifi_mac_filtering(enabled=True, mac_addresses=None)\n\nEnable or disable WiFi MAC filtering with optional device list.\n\n**Parameters:**\n- `enabled` (bool): Whether to enable MAC filtering (default: True)\n- `mac_addresses` (list): List of MAC addresses to allow (default: None = keep current list)\n\n**Returns:** `bool` - True if successful\n\n**Note:**\n- When enabled, only devices on the whitelist can connect to WiFi\n- Affects home and extra networks only (not guest networks)\n- Wired devices are always allowed regardless of this setting\n- If mac_addresses is None, keeps current whitelist\n\n### enable_wifi_mac_filtering(mac_addresses=None)\n\nEnable WiFi MAC filtering with optional device list.\n\n**Parameters:**\n- `mac_addresses` (list): List of MAC addresses to allow (default: None = keep current list)\n\n**Returns:** `bool` - True if successful\n\n**Note:** Convenience method that calls `set_wifi_mac_filtering(True, mac_addresses)`.\n\n### disable_wifi_mac_filtering()\n\nDisable WiFi MAC filtering (allow all devices).\n\n**Returns:** `bool` - True if successful\n\n**Note:**\n- Convenience method that calls `set_wifi_mac_filtering(False)`\n- Keeps the current whitelist for when filtering is re-enabled\n\n### get_wifi_mac_filter_list()\n\nGet list of MAC addresses on WiFi whitelist.\n\n**Returns:** List of MAC addresses currently on the whitelist\n\n### add_wifi_mac_filter(mac_addresses)\n\nAdd MAC addresses to WiFi whitelist.\n\n**Parameters:**\n- `mac_addresses` (str or list): Single MAC address (str) or list of MAC addresses to add\n\n**Returns:** `bool` - True if successful\n\n**Note:**\n- Automatically enables MAC filtering if not already enabled\n- Avoids duplicates when adding addresses\n\n### remove_wifi_mac_filter(mac_addresses)\n\nRemove MAC addresses from WiFi whitelist.\n\n**Parameters:**\n- `mac_addresses` (str or list): Single MAC address (str) or list of MAC addresses to remove\n\n**Returns:** `bool` - True if successful\n\n**Note:** Keeps MAC filtering enabled even if list becomes empty.\n\n### clear_wifi_mac_filter()\n\nClear all MAC addresses from WiFi whitelist.\n\n**Returns:** `bool` - True if successful\n\n**Note:** Keeps MAC filtering enabled but with empty whitelist (blocks all WiFi devices).\n\n### set_wifi_mac_filter_list(mac_addresses, enabled=True)\n\nSet complete WiFi MAC filter whitelist.\n\n**Parameters:**\n- `mac_addresses` (list): Complete list of MAC addresses to allow\n- `enabled` (bool): Whether to enable MAC filtering (default: True)\n\n**Returns:** `bool` - True if successful\n\n**Note:** Replaces entire whitelist with provided list.\n\n### add_connected_wifi_devices_to_filter()\n\nAdd all currently connected WiFi devices to MAC filter whitelist.\n\n**Returns:** Dictionary with operation results\n\n**Operation Result Fields:**\n- `added_devices`: List of devices added to whitelist\n- `already_allowed`: List of devices already on whitelist\n- `total_devices`: Total number of WiFi devices found\n- `success`: Whether operation was successful\n\n**Note:**\n- Only adds WiFi-connected devices (excludes wired devices)\n- Automatically enables MAC filtering\n- Useful for quickly allowing all current WiFi devices\n\n### manage_wifi_mac_filter(action, mac_addresses=None, enabled=None)\n\nUnified WiFi MAC filter management interface.\n\n**Parameters:**\n- `action` (str): Action to perform - \"enable\", \"disable\", \"add\", \"remove\", \"clear\", \"set\", \"list\", \"status\", \"add_connected\"\n- `mac_addresses` (str or list): MAC addresses for add/remove/set actions\n- `enabled` (bool): Enable state for \"set\" action\n\n**Returns:**\n- For enable/disable/add/remove/clear/set: `bool` - True if successful\n- For list: List of MAC addresses\n- For status: Dictionary with status information\n- For add_connected: Dictionary with operation results\n\n### get_device_mst_status(mac_address)\n\nGet Managed Screen Time (MST) status for a specific device.\n\n**Parameters:**\n- `mac_address` (str): MAC address of the device (e.g., \"A8:A1:59:33:F1:E4\")\n\n**Returns:** Dictionary with MST status\n\n**MST Status Fields:**\n- `subject`: Device identifier (e.g., \"MAC:A8:A1:59:33:F1:E4\")\n- `enable`: Whether MST is enabled for this device\n- `status`: Current status (\"Active\" or other status)\n- `allowedTime`: Dictionary with daily time limits in minutes per day (Mon, Tue, Wed, Thu, Fri, Sat, Sun)\n\n**Returns:** Empty dict if no MST is configured for the device\n\n### set_device_mst(mac_address, daily_limits=None, enabled=True)\n\nSet Managed Screen Time (MST) daily limits for a specific device.\n\n**Parameters:**\n- `mac_address` (str): MAC address of the device (e.g., \"A8:A1:59:33:F1:E4\")\n- `daily_limits` (dict): Dictionary with daily time limits in minutes per day. Keys: Mon, Tue, Wed, Thu, Fri, Sat, Sun. Values: Minutes allowed per day (0-1440)\n- `enabled` (bool): Whether to enable MST for this device (default: True)\n\n**Returns:** `bool` - True if successful\n\n**Note:**\n- Automatically removes existing time-based schedules when setting MST\n- Time limits are in minutes per day (0-1440, where 1440 = 24 hours)\n- When MST is active, device will be blocked after time limit is reached\n\n### delete_device_mst(mac_address)\n\nDelete Managed Screen Time (MST) configuration for a specific device.\n\n**Parameters:**\n- `mac_address` (str): MAC address of the device (e.g., \"A8:A1:59:33:F1:E4\")\n\n**Returns:** `bool` - True if successful (also returns True if MST was not configured)\n\n### set_device_daily_time_limits(mac_address, weekday_minutes=120, weekend_minutes=240, enabled=True)\n\nSet daily time limits for a device (simplified MST setup).\n\n**Parameters:**\n- `mac_address` (str): MAC address of the device (e.g., \"A8:A1:59:33:F1:E4\")\n- `weekday_minutes` (int): Time limit for Mon-Fri in minutes (default: 120 = 2 hours)\n- `weekend_minutes` (int): Time limit for Sat-Sun in minutes (default: 240 = 4 hours)\n- `enabled` (bool): Whether to enable time limits (default: True)\n\n**Returns:** `bool` - True if successful\n\n**Note:** Convenience method that calls `set_device_mst` with weekday/weekend limits.\n\n### set_device_parental_control(mac_address, control_type, **kwargs)\n\nUnified parental control management for a device.\n\n**Parameters:**\n- `mac_address` (str): MAC address of the device (e.g., \"A8:A1:59:33:F1:E4\")\n- `control_type` (str): Type of control to apply - \"none\", \"block\", \"schedule\", \"daily_limits\"\n- `**kwargs`: Additional parameters based on control_type\n\n**Control Types:**\n- `\"none\"`: Remove all restrictions\n- `\"block\"`: Block device completely\n- `\"schedule\"`: Time-based schedule restrictions (requires schedule_blocks parameter)\n- `\"daily_limits\"`: Daily time limits (requires daily_limits or weekday_minutes/weekend_minutes parameters)\n\n**Returns:** `bool` - True if successful\n\n### get_device_parental_control_status(mac_address)\n\nGet comprehensive parental control status for a device.\n\n**Parameters:**\n- `mac_address` (str): MAC address of the device (e.g., \"A8:A1:59:33:F1:E4\")\n\n**Returns:** Dictionary with parental control status\n\n**Parental Control Status Fields:**\n- `control_type`: Type of control (\"none\", \"block\", \"schedule\", \"daily_limits\")\n- `enabled`: Whether any control is enabled\n- `schedule`: Schedule information (if applicable)\n- `mst`: MST information (if applicable)\n- `summary`: Human-readable summary of current restrictions\n\n### list_devices_with_parental_controls()\n\nGet list of all devices that have parental controls configured.\n\n**Returns:** List of devices with parental control information\n\n**Device Parental Control Fields:**\n- `mac_address`: Device MAC address\n- `name`: Device name\n- `device_type`: Device type\n- `active`: Whether device is currently connected\n- `control_type`: Type of parental control\n- `enabled`: Whether controls are enabled\n- `summary`: Summary of current restrictions\n\n### format_time_seconds_to_readable(seconds)\n\nConvert seconds from Monday 00:00 to human-readable time.\n\n**Parameters:**\n- `seconds` (int): Seconds from Monday 00:00\n\n**Returns:** `str` - Human-readable time string (e.g., \"Monday 08:30\", \"Friday 22:00\")\n\n### create_bedtime_schedule_blocks(bedtime_hour=22, wakeup_hour=6, days=None)\n\nCreate schedule blocks for bedtime restrictions.\n\n**Parameters:**\n- `bedtime_hour` (int): Hour when device should be blocked (0-23, default: 22 = 10 PM)\n- `wakeup_hour` (int): Hour when device should be unblocked (0-23, default: 6 = 6 AM)\n- `days` (list): List of days to apply (0=Monday, 6=Sunday, default: [0,1,2,3,4] = weekdays)\n\n**Returns:** List of schedule blocks suitable for `set_device_schedule`\n\n### add_port_forwarding_rule(rule_id, internal_port, external_port, destination_ip, protocol=\"6\", description=\"\", enabled=True, source_interface=\"data\", origin=\"webui\")\n\nAdd a new IPv4 port forwarding rule.\n\n**Parameters:**\n- `rule_id` (str): Unique identifier for the rule (e.g., \"SSH\", \"WebServer\")\n- `internal_port` (str): Internal port number or range (e.g., \"22\", \"8080-8090\")\n- `external_port` (str): External port number or range (e.g., \"22\", \"8080-8090\")\n- `destination_ip` (str): Internal IP address to forward to (e.g., \"192.168.2.100\")\n- `protocol` (str): Protocol type - \"6\" (TCP), \"17\" (UDP), or \"6,17\" (both) (default: \"6\")\n- `description` (str): Human-readable description (default: empty)\n- `enabled` (bool): Whether rule should be enabled (default: True)\n- `source_interface` (str): Source interface (default: \"data\")\n- `origin` (str): Rule origin (default: \"webui\")\n\n**Returns:** `str` - Full rule ID created by the router (e.g., \"webui_SSH\")\n\n**Note:**\n- Protocol 6 = TCP, 17 = UDP\n- Port ranges use format \"start-end\" (e.g., \"8080-8090\")\n- Individual ports use single numbers (e.g., \"22\")\n\n### update_port_forwarding_rule(rule_id, internal_port=None, external_port=None, destination_ip=None, protocol=None, description=None, enabled=None, source_interface=\"data\", origin=\"webui\")\n\nUpdate an existing IPv4 port forwarding rule.\n\n**Parameters:**\n- `rule_id` (str): Full rule ID (e.g., \"webui_SSH\") or simple ID (e.g., \"SSH\")\n- `internal_port` (str): Internal port number or range (optional)\n- `external_port` (str): External port number or range (optional)\n- `destination_ip` (str): Internal IP address to forward to (optional)\n- `protocol` (str): Protocol type - \"6\" (TCP), \"17\" (UDP), or \"6,17\" (both) (optional)\n- `description` (str): Human-readable description (optional)\n- `enabled` (bool): Whether rule should be enabled (optional)\n- `source_interface` (str): Source interface (default: \"data\")\n- `origin` (str): Rule origin (default: \"webui\")\n\n**Returns:** `str` - Full rule ID\n\n**Note:** Only specified parameters will be updated. Others remain unchanged.\n\n### delete_port_forwarding_rule(rule_id, destination_ip=None, origin=\"webui\")\n\nDelete an IPv4 port forwarding rule.\n\n**Parameters:**\n- `rule_id` (str): Full rule ID (e.g., \"webui_SSH\") or simple ID (e.g., \"SSH\")\n- `destination_ip` (str): Destination IP address (optional, for verification)\n- `origin` (str): Rule origin (default: \"webui\")\n\n**Returns:** `bool` - True if successful\n\n### enable_port_forwarding_rule(rule_id, origin=\"webui\") / disable_port_forwarding_rule(rule_id, origin=\"webui\")\n\nEnable or disable an existing IPv4 port forwarding rule.\n\n**Parameters:**\n- `rule_id` (str): Full rule ID (e.g., \"webui_SSH\") or simple ID (e.g., \"SSH\")\n- `origin` (str): Rule origin (default: \"webui\")\n\n**Returns:** `bool` - True if successful\n\n### add_ipv6_pinhole(destination_ip, destination_port, protocol=\"6\", description=\"\", enabled=True, source_interface=\"data\", source_port=\"\", origin=\"webui\")\n\nAdd a new IPv6 pinhole (firewall rule).\n\n**Parameters:**\n- `destination_ip` (str): IPv6 address to allow access to (e.g., \"2a02:a46f:ff52:0:f5a6:3bb7:c600:efc0\")\n- `destination_port` (str): Destination port number or range (e.g., \"22\", \"8080-8090\")\n- `protocol` (str): Protocol type - \"6\" (TCP), \"17\" (UDP), or \"6,17\" (both) (default: \"6\")\n- `description` (str): Human-readable description (default: empty)\n- `enabled` (bool): Whether rule should be enabled (default: True)\n- `source_interface` (str): Source interface (default: \"data\")\n- `source_port` (str): Source port filter (default: empty = any)\n- `origin` (str): Rule origin (default: \"webui\")\n\n**Returns:** `str` - Full rule ID created by the router (e.g., \"webui_1\")\n\n**Note:**\n- Protocol 6 = TCP, 17 = UDP\n- Port ranges use format \"start-end\" (e.g., \"8080-8090\")\n- IPv6 pinholes don't use external/internal port mapping like IPv4 port forwarding\n\n### update_ipv6_pinhole(rule_id, destination_ip=None, destination_port=None, protocol=None, description=None, enabled=None, source_interface=\"data\", source_port=None, origin=\"webui\")\n\nUpdate an existing IPv6 pinhole rule.\n\n**Parameters:**\n- `rule_id` (str): Full rule ID (e.g., \"webui_1\")\n- `destination_ip` (str): IPv6 address to allow access to (optional)\n- `destination_port` (str): Destination port number or range (optional)\n- `protocol` (str): Protocol type - \"6\" (TCP), \"17\" (UDP), or \"6,17\" (both) (optional)\n- `description` (str): Human-readable description (optional)\n- `enabled` (bool): Whether rule should be enabled (optional)\n- `source_interface` (str): Source interface (default: \"data\")\n- `source_port` (str): Source port filter (optional)\n- `origin` (str): Rule origin (default: \"webui\")\n\n**Returns:** `str` - Full rule ID\n\n### delete_ipv6_pinhole(rule_id, origin=\"webui\")\n\nDelete an IPv6 pinhole rule.\n\n**Parameters:**\n- `rule_id` (str): Full rule ID (e.g., \"webui_1\")\n- `origin` (str): Rule origin (default: \"webui\")\n\n**Returns:** `bool` - True if successful\n\n### enable_ipv6_pinhole(rule_id, origin=\"webui\") / disable_ipv6_pinhole(rule_id, origin=\"webui\")\n\nEnable or disable an existing IPv6 pinhole rule.\n\n**Parameters:**\n- `rule_id` (str): Full rule ID (e.g., \"webui_1\")\n- `origin` (str): Rule origin (default: \"webui\")\n\n**Returns:** `bool` - True if successful\n\n### manage_port_forwarding(action, rule_id=None, **kwargs)\n\nUnified port forwarding management for both IPv4 and IPv6.\n\n**Parameters:**\n- `action` (str): Action to perform - \"add\", \"update\", \"delete\", \"enable\", \"disable\", \"list\", \"get\"\n- `rule_id` (str): Rule identifier (required for most actions except \"list\")\n- `**kwargs`: Additional parameters based on action and IP version\n\n**Common Parameters:**\n- `ip_version`: 4 or 6 (default: 4)\n- `origin`: Rule origin (default: \"webui\")\n\n**For IPv4 port forwarding (ip_version=4):**\n- `internal_port`: Internal port number or range\n- `external_port`: External port number or range\n- `destination_ip`: Internal IP address to forward to\n- `protocol`: \"6\" (TCP), \"17\" (UDP), or \"6,17\" (both)\n- `description`: Human-readable description\n- `enabled`: Whether rule should be enabled\n\n**For IPv6 pinholes (ip_version=6):**\n- `destination_ip`: IPv6 address to allow access to\n- `destination_port`: Destination port number or range\n- `protocol`: \"6\" (TCP), \"17\" (UDP), or \"6,17\" (both)\n- `description`: Human-readable description\n- `enabled`: Whether rule should be enabled\n- `source_port`: Source port filter (optional)\n\n**Returns:**\n- For \"add\": Rule ID (str)\n- For \"update\": Rule ID (str)\n- For \"delete\", \"enable\", \"disable\": Success status (bool)\n- For \"list\": List of rules (List[Dict])\n- For \"get\": Single rule details (Dict) or None\n\n### change_password(new_password, old_password, username=\"admin\")\n\nChange the login password for a user account.\n\n**Parameters:**\n- `new_password` (str): The new password to set\n- `old_password` (str): The current password for authentication\n- `username` (str): Username to change password for (default: \"admin\")\n\n**Returns:** `bool` - True if password change was successful\n\n**Note:**\n- New password should be strong (recommended: 8+ chars with mixed case, numbers, symbols)\n- You must provide the correct current password\n- After changing password, you'll need to login again with the new password\n\n\n### get_system_stats(device_mac=None)\n\nGet system CPU and RAM statistics from the KPN Box router.\n\n**Parameters:**\n- `device_mac` (str): MAC address of the device to monitor (default: auto-detect router MAC)\n\n**Returns:** `Dict[str, Any]` - Dictionary containing system statistics:\n\n**System Statistics Fields:**\n- `timestamp`: ISO timestamp of the data\n- `uptime_seconds`: System uptime in seconds\n- `uptime_formatted`: Human-readable uptime (e.g., \"2d 14h 35m\")\n- `load_average`: Dict with CPU load averages:\n  - `1min`: 1-minute load average (0-100%)\n  - `5min`: 5-minute load average (0-100%)\n  - `15min`: 15-minute load average (0-100%)\n- `memory`: Dict with RAM statistics:\n  - `total_bytes`: Total RAM in bytes\n  - `used_bytes`: Used RAM in bytes\n  - `free_bytes`: Free RAM in bytes\n  - `shared_bytes`: Shared RAM in bytes\n  - `buffer_bytes`: Buffer RAM in bytes\n  - `cached_bytes`: Cached RAM in bytes\n  - `used_percentage`: Used RAM percentage (0-100%)\n  - `free_percentage`: Free RAM percentage (0-100%)\n- `swap`: Dict with swap statistics:\n  - `total_bytes`: Total swap space in bytes\n  - `free_bytes`: Free swap space in bytes\n- `processes`: Number of running processes\n- `device_mac`: MAC address of the monitored device\n\n\n**Note:**\n- If `device_mac` is not provided, attempts to auto-detect the router's MAC address\n- Load averages are normalized from raw kernel values to percentage-like values (0-100)\n- Memory values are provided in both bytes and percentages for convenience\n- Returns empty dict `{}` if unable to retrieve system statistics\n\n### reboot_system(reason=\"API reboot\")\n\nReboot the KPN Box system.\n\n**Parameters:**\n- `reason` (str): Reason for the reboot (default: \"API reboot\")\n\n**Returns:** `bool` - True if reboot command was sent successfully\n\n**⚠️ Warning:**\nThis will reboot the entire KPN Box router. All network connections will be temporarily lost during the reboot process (typically 2-3 minutes).\n\n### factory_reset_system(reason=\"API reset\")\n\nPerform a factory reset of the entire KPN Box system.\n\n**Parameters:**\n- `reason` (str): Reason for the factory reset (default: \"API reset\")\n\n**Returns:** `bool` - True if factory reset command was sent successfully\n\n**🚨 WARNING:**\nThis will completely reset the KPN Box to factory defaults! ALL settings will be lost including:\n- WiFi passwords and network names\n- Port forwarding rules\n- Device schedules and restrictions  \n- DHCP reservations\n- All custom configurations\nUse with extreme caution!\n\n### factory_reset_wifi()\n\nPerform a factory reset of WiFi settings only.\n\n**Returns:** `bool` - True if WiFi factory reset command was sent successfully\n\n**⚠️ Warning:**\nThis will reset ALL WiFi settings to factory defaults including:\n- WiFi network names (SSIDs)\n- WiFi passwords\n- WiFi security settings\n- Guest network configuration\n- WiFi scheduling settings\nYou will need to reconfigure WiFi after this operation!\n\n### restart_home_network(reason=\"API reboot\")\n\nRestart the home network group function.\n\n**Parameters:**\n- `reason` (str): Reason for the restart (default: \"API reboot\")\n\n**Returns:** `bool` - True if restart command was sent successfully\n\n**Note:**\nThis restarts network services without a full system reboot. May cause temporary network disruption.\n\n### factory_reset_home_network(reason=\"API reset\")\n\nPerform a factory reset of home network settings.\n\n**Parameters:**\n- `reason` (str): Reason for the factory reset (default: \"API reset\")\n\n**Returns:** `bool` - True if factory reset command was sent successfully\n\n**⚠️ Warning:**\nThis will reset home network settings to factory defaults including:\n- Network configuration\n- DHCP settings  \n- Port forwarding rules\n- Device schedules and restrictions\n- Network security settings\nUse with caution!\n\n\n## Usage Examples\n\n### Basic Device Management\n\n```python\nfrom kpnboxapi import KPNBoxAPI\n\nwith KPNBoxAPI() as api:\n    api.login(password=\"your_password\")\n    \n    # Get currently connected devices\n    active_devices = api.get_devices(filter='active')\n    print(f\"Active devices: {len(active_devices)}\")\n    \n    # Show device details\n    for device in active_devices[:3]:  # Show first 3\n        print(f\"{device['Name']} - {device['IPAddress']} ({device['PhysAddress']})\")\n```\n\n### Modem Information\n\n```python\n# Get modem details\nmodem_info = api.get_device_info()\nprint(f\"Model: {modem_info['Manufacturer']} {modem_info['ModelName']}\")\nprint(f\"Firmware: {modem_info['SoftwareVersion']}\")\nprint(f\"External IP: {modem_info['ExternalIPAddress']}\")\n```\n\n### WiFi Networks\n\n```python\n# Get all WiFi networks\nwifi_networks = api.get_all_wifi_networks()\n\n# Regular networks\nfor network in wifi_networks['regular']:\n    print(f\"SSID: {network['SSID']} - Status: {network['VAPStatus']}\")\n    print(f\"Security: {network['Security']['ModeEnabled']}\")\n    print(f\"Connected: {network['AssociatedDeviceNumberOfEntries']}\")\n\n# Guest networks  \nfor network in wifi_networks['guest']:\n    print(f\"Guest: {network['SSID']} - Status: {network['VAPStatus']}\")\n```\n\n### WiFi Configuration\n\n```python\n# Change WiFi name and password for both bands\nsuccess = api.set_wifi_config(\n    ssid_2g=\"MyNetwork_2G\",\n    ssid_5g=\"MyNetwork_5G\", \n    password_2g=\"NewPassword123\",\n    password_5g=\"NewPassword123\",\n    security_mode_2g=\"WPA2-Personal\",\n    security_mode_5g=\"WPA2-Personal\"\n)\nprint(f\"WiFi configured: {success}\")\n\n# Change only the SSID (keep existing password)\nsuccess = api.set_wifi_config(\n    ssid_2g=\"NewNetworkName\",\n    ssid_5g=\"NewNetworkName\"\n)\nprint(f\"SSID updated: {success}\")\n\n# Hide WiFi networks (disable SSID broadcast)\nsuccess = api.set_wifi_visibility(visible_2g=False, visible_5g=False)\nprint(f\"WiFi hidden: {success}\")\n\n# Show WiFi networks again\nsuccess = api.set_wifi_visibility(visible_2g=True, visible_5g=True)\nprint(f\"WiFi visible: {success}\")\n\n# Disable WPS for security\nresults = api.set_wps_enabled(enabled_2g=False, enabled_5g=False)\nprint(f\"WPS disabled - 2.4G: {results.get('band_2g')}, 5G: {results.get('band_5g')}\")\n\n# Enable WPS\nresults = api.set_wps_enabled(enabled_2g=True, enabled_5g=True)\nprint(f\"WPS enabled - 2.4G: {results.get('band_2g')}, 5G: {results.get('band_5g')}\")\n```\n\n### Guest Network Configuration\n\n```python\n# Enable guest network\nsuccess = api.enable_guest_network(enabled=True)\nprint(f\"Guest network enabled: {success}\")\n\n# Configure guest WiFi with simple settings\nsuccess = api.set_guest_wifi_config(\n    ssid_2g=\"Guest_WiFi\",\n    ssid_5g=\"Guest_WiFi\",\n    password_2g=\"GuestPass123\",\n    password_5g=\"GuestPass123\",\n    security_mode_2g=\"WPA2-Personal\",\n    security_mode_5g=\"WPA2-Personal\"\n)\nprint(f\"Guest WiFi configured: {success}\")\n\n# Set bandwidth limit for guests (10 Mbps)\nsuccess = api.set_guest_bandwidth_limit(10)\nprint(f\"Guest bandwidth limited to 10 Mbps: {success}\")\n\n# Hide guest networks\nsuccess = api.set_guest_wifi_visibility(visible_2g=False, visible_5g=False)\nprint(f\"Guest networks hidden: {success}\")\n\n# Remove bandwidth limit (unlimited)\nsuccess = api.set_guest_bandwidth_limit(0)\nprint(f\"Guest bandwidth unlimited: {success}\")\n\n# Disable guest network completely\nsuccess = api.enable_guest_network(enabled=False)\nprint(f\"Guest network disabled: {success}\")\n\n# Check current guest networks\nguest_networks = api.get_guest_wifi_networks()\nfor network in guest_networks:\n    print(f\"Guest: {network['SSID']} - Status: {network['VAPStatus']}\")\n```\n\n### Extra WiFi Configuration\n\n```python\n# Enable extra WiFi networks (third set of networks)\nresults = api.enable_extra_wifi(enabled_2g=True, enabled_5g=True)\nprint(f\"Extra WiFi enabled - 2.4G: {results.get('band_2g')}, 5G: {results.get('band_5g')}\")\n\n# Configure extra WiFi with specific purpose (e.g., IoT devices)\nsuccess = api.set_extra_wifi_config(\n    ssid_2g=\"IoT_Network\",\n    ssid_5g=\"IoT_Network_5G\",\n    password_2g=\"IoTSecure2024!\",\n    password_5g=\"IoTSecure2024!\",\n    security_mode_2g=\"WPA2-Personal\",\n    security_mode_5g=\"WPA2-Personal\"\n)\nprint(f\"Extra WiFi configured for IoT: {success}\")\n\n# Configure extra WiFi for different purposes per band\nsuccess = api.set_extra_wifi_config(\n    ssid_2g=\"Devices_2G\",      # 2.4GHz for legacy devices\n    ssid_5g=\"Work_5G\",         # 5GHz for work devices\n    password_2g=\"DevicePass123\",\n    password_5g=\"WorkPass456\",\n    security_mode_2g=\"WPA2-Personal\",\n    security_mode_5g=\"WPA2-Personal\"\n)\nprint(f\"Extra WiFi configured with different purposes: {success}\")\n\n# Hide extra networks for security\nsuccess = api.set_extra_wifi_visibility(visible_2g=False, visible_5g=False)\nprint(f\"Extra networks hidden: {success}\")\n\n# Show only the 5GHz extra network\nsuccess = api.set_extra_wifi_visibility(visible_2g=False, visible_5g=True)\nprint(f\"5GHz extra network visible, 2.4GHz hidden: {success}\")\n\n# Disable extra WiFi networks\nresults = api.enable_extra_wifi(enabled_2g=False, enabled_5g=False)\nprint(f\"Extra WiFi disabled - 2.4G: {results.get('band_2g')}, 5G: {results.get('band_5g')}\")\n```\n\n### WiFi Radio Control and Scheduling\n\n```python\n# Enable/disable WiFi completely\napi.set_wifi_enabled(True)  # Enable all WiFi\napi.set_wifi_enabled(False)  # Disable all WiFi\n\n# Get WiFi status\nstatus = api.get_wifi_status()\nprint(f\"WiFi enabled: {status.get('Enable')}\")\n\n# Configure radio settings\napi.set_wifi_radio_config(\n    band_2g_config={\n        \"AutoChannelEnable\": True,\n        \"OperatingChannelBandwidth\": \"20MHz\",\n        \"OperatingStandards\": \"g,n,ax\"\n    },\n    band_5g_config={\n        \"AutoChannelEnable\": True,\n        \"OperatingChannelBandwidth\": \"80MHz\",\n        \"OperatingStandards\": \"a,n,ac,ax\"\n    }\n)\n\n# Apply recommended defaults\napi.set_wifi_radio_defaults()\n```\n\n### WiFi Spectrum Analysis\n```python\n# Get detailed radio information\nradio_2g = api.get_wifi_radio_info(\"2g\")\nradio_5g = api.get_wifi_radio_info(\"5g\")\nall_radios = api.get_all_wifi_radio_info()\n\nprint(f\"2.4GHz Channel: {radio_2g.get('Channel')}\")\nprint(f\"5GHz Bandwidth: {radio_5g.get('CurrentOperatingChannelBandwidth')}\")\nprint(f\"Channel Load: {radio_2g.get('ChannelLoad')}%\")\nprint(f\"Interference: {radio_2g.get('Interference')}%\")\n\n# Analyze spectrum and channel usage\nspectrum_2g = api.get_wifi_spectrum_info(\"2g\")\nspectrum_5g = api.get_wifi_spectrum_info(\"5g\")\nall_spectrum = api.get_all_wifi_spectrum_info()\n\nfor channel in spectrum_2g:\n    print(f\"Channel {channel['channel']}: {channel['availability']}% available, \"\n          f\"{channel['accesspoints']} APs, {channel['noiselevel']} dBm noise\")\n\n# Scan for nearby networks\nnetworks_2g = api.get_wifi_scan_results(\"2g\")\nnetworks_5g = api.get_wifi_scan_results(\"5g\")\nall_networks = api.get_all_wifi_scan_results()\n\nfor network in networks_2g:\n    if network.get('SSID'):  # Skip hidden networks\n        print(f\"Network: {network['SSID']}, Channel: {network['Channel']}, \"\n              f\"Signal: {network['RSSI']} dBm, Security: {network['SecurityModeEnabled']}\")\n\n# Get best channel recommendations\nbest_2g = api.get_best_wifi_channels(\"2g\", top_n=3)\nbest_5g = api.get_best_wifi_channels(\"5g\", top_n=3)\n\nprint(\"Best 2.4GHz channels:\")\nfor i, channel in enumerate(best_2g, 1):\n    print(f\"  {i}. Channel {channel['channel']} (score: {channel['score']}, \"\n          f\"congestion: {channel['congestion_level']})\")\n\n# Comprehensive WiFi environment analysis\nanalysis = api.analyze_wifi_environment()\nprint(f\"Environment: {analysis['summary']}\")\nprint(f\"Total networks: {analysis['total_networks']}\")\n\nfor recommendation in analysis['recommendations']:\n    print(f\"💡 {recommendation}\")\n```\n\n### WiFi Scheduling\n\n```python\n# Enable/disable scheduling\nsuccess = api.enable_wifi_schedule(enabled=True)\nprint(f\"WiFi scheduling enabled: {'✅ Success' if success else '❌ Failed'}\")\n\n# Set custom WiFi schedule (disable specific time blocks)\ndisable_blocks = [\n    {\"begin\": 79200, \"end\": 108000},   # Monday 22:00-06:00\n    {\"begin\": 165600, \"end\": 194400},  # Tuesday 22:00-06:00\n    {\"begin\": 252000, \"end\": 280800},  # Wednesday 22:00-06:00\n]\nsuccess = api.set_wifi_schedule(disable_blocks=disable_blocks, enabled=True)\nprint(f\"Custom schedule set: {'✅ Success' if success else '❌ Failed'}\")\n\n# Set up bedtime WiFi schedule (disable 10 PM to 6 AM on weekdays)\nsuccess = api.set_wifi_bedtime_schedule(\n    bedtime_hour=22,    # 10 PM\n    wakeup_hour=6,      # 6 AM\n    weekdays_only=True  # Only Monday-Friday\n)\nprint(f\"Bedtime schedule set: {'✅ Success' if success else '❌ Failed'}\")\n\n# Clear all WiFi time restrictions\nsuccess = api.clear_wifi_schedule()\nprint(f\"WiFi schedule cleared: {'✅ Success' if success else '❌ Failed'}\")\n```\n\n### DHCP Configuration\n\n```python\n# Get DHCP servers\ndhcp_servers = api.get_all_dhcp_servers()\n\n# Default network\ndefault = dhcp_servers['default']\nprint(f\"Default DHCP: {default['Status']}\")\nprint(f\"Range: {default['MinAddress']} - {default['MaxAddress']}\")\nprint(f\"Active leases: {default['LeaseNumberOfEntries']}\")\n\n# Get actual leases\nleases = api.get_active_dhcp_leases(\"default\")\nfor lease in leases:\n    print(f\"{lease['FriendlyName']}: {lease['IPAddress']}\")\n\n# Configure DHCP server settings\nsuccess = api.set_home_dhcp_config(\n    gateway_ip=\"192.168.2.254\",\n    subnet_mask=24,\n    dhcp_enabled=True,\n    dhcp_min_ip=\"192.168.2.100\",\n    dhcp_max_ip=\"192.168.2.200\",\n    lease_time_seconds=14400,  # 4 hours\n    dns_servers=\"9.9.9.9,149.112.112.112\"\n)\nprint(f\"Home DHCP configured: {success}\")\n\n# Configure guest network DHCP\nsuccess = api.set_guest_dhcp_config(\n    gateway_ip=\"192.168.3.254\",\n    dhcp_min_ip=\"192.168.3.1\",\n    dhcp_max_ip=\"192.168.3.32\",\n    lease_time_seconds=3600,  # 1 hour for guests\n    dns_servers=\"9.9.9.9,149.112.112.112\"\n)\nprint(f\"Guest DHCP configured: {success}\")\n\n# Set up network isolation\nresults = api.configure_network_isolation(\n    home_subnet=\"192.168.2.0/24\",\n    guest_subnet=\"192.168.3.0/24\",\n    home_dhcp_range=(\"192.168.2.100\", \"192.168.2.200\"),\n    guest_dhcp_range=(\"192.168.3.1\", \"192.168.3.32\"),\n    dns_servers=\"9.9.9.9,149.112.112.112\"\n)\nprint(f\"Network isolation - Home: {results['home']}, Guest: {results['guest']}\")\n```\n\n### IP Reservations (Static DHCP Leases)\n\n```python\n# Add IP reservation for a printer\nsuccess = api.add_static_lease(\"50:DE:06:9A:A6:98\", \"192.168.2.118\")\nprint(f\"Printer IP reserved: {success}\")\n\n# Reserve IP for a server using device name auto-detection\nsuccess = api.reserve_device_ip(\"My NAS\", \"192.168.2.100\")\nprint(f\"NAS IP reserved: {success}\")\n\n# Get all current IP reservations\nreservations = api.list_ip_reservations()\nfor res in reservations:\n    print(f\"{res['device_name']}: {res['ip_address']} ({res['mac_address']})\")\n\n# Update existing reservation\nsuccess = api.set_static_lease(\"50:DE:06:9A:A6:98\", \"192.168.2.120\")\nprint(f\"Printer IP updated: {success}\")\n\n# Get suggested available IPs\navailable_ips = api.suggest_available_ips(count=5)\nprint(f\"Available IPs: {available_ips}\")\n\n# Comprehensive reservation management\nsuccess = api.manage_device_ip_reservation(\n    \"AA:BB:CC:DD:EE:FF\", \n    \"192.168.2.150\", \n    action=\"add\"\n)\n\n# Remove IP reservation\nsuccess = api.delete_static_lease(\"5","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fssl%2Fkpnboxapi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fssl%2Fkpnboxapi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fssl%2Fkpnboxapi/lists"}