aiopnsense is an async Python client library for OPNsense.
aiopnsense wraps supported OPNsense REST endpoints behind a single async client,
OPNsenseClient. It is designed for applications that need to query router state or trigger supported OPNsense actions without manually building HTTP requests.
The client currently includes helpers for:
- system information, notices, certificates, CARP, Wake-on-LAN, reboot, and interface reloads
- firmware version checks, update status, and upgrade actions
- interface, gateway, CPU, memory, filesystem, and temperature telemetry
- DHCP lease and ARP table access
- firewall rules, NAT rules, alias toggling, and state killing
- service status lookup and service start/stop/restart operations
- Unbound blocklist management
- OpenVPN and WireGuard status plus VPN instance toggling
- vnStat metrics, captive portal vouchers, and speed test data
-
- For firmware < 26.1.1, the
Firewall and NATmethods will return empty data.
- For firmware < 26.1.1, the
- Read the Docs: https://aiopnsense.readthedocs.io
aiopnsense was initially extracted from the hass-opnsense integration. It is primarily for use as an external dependency by Home Assistant for its OPNsense Integration.