aiopnsense
aiopnsense is an async Python client library for OPNsense.
What this library does
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
- diagnostics traffic snapshots and live interface traffic stream samples
- DHCP lease and ARP table access
- firewall rules, NAT rules, alias toggling, and state killing
- service status lookup and service start/stop/restart operations
- SMART device listing and per-device SMART detail queries
- Unbound blocklist management
- OpenVPN and WireGuard status plus VPN instance toggling
- vnStat metrics, captive portal vouchers, and speed test data
Requirements
-
Requires OPNsense Firmware >= 25.1
-
Recommended OPNsense Firmware >= 26.1.1
- For firmware < 26.1.1, the
Firewall and NATmethods will return empty data.
- For firmware < 26.1.1, the
Documentation
- Read the Docs: https://aiopnsense.readthedocs.io
Live test scripts
The scripts/ directory includes live diagnostic helpers for maintainers:
aiopnsense_dump.pyruns supportedaiopnsenseclient endpoints and prints the raw data returned by the library.opnsense_api_call.pycalls an arbitrary OPNsense API endpoint with a specified method and optional POST payload.
Both scripts read credentials from scripts/aiopnsense.env by default. Copy scripts/aiopnsense.env.example to create your local env file; it is ignored by git. Full CLI reference is in the Read the Docs script documentation.
Origin and Purpose
aiopnsense was extracted from the hass-opnsense integration. It is primarily used as an external dependency by hass-opnsense and Home Assistant for its OPNsense Integration.
Changelog
1.1.11 (2026-09-13)
Bug Fixes
- accept release commit SHA as publish target (#131) (869f88f)
- distinguish failed ARP lookups from empty tables (#133) (8c1b5c1)
1.1.10 (2026-09-13)
Bug Fixes
- include all Release Please changelog types (#128) (3317a8b)
- instance service control paths (#111) (daa6feb)
- recognize releasable dependency updates (#126) (a5e4a22)
Dependencies
- bump actions/download-artifact from 7 to 8 (fc2e871)
- bump the python-dependencies group with 3 updates (#130) (b86a46c)
Miscellaneous Chores
- deps: bump the python-dependencies group with 2 updates (#125) (433148a)
- update prek hooks (#118) (73a9985)
Continuous Integration
- bump Release Please action to v5 (#122) (6e629ba)
- enforce semantic pull request titles (#123) (4c4285e)
- harden release workflow execution (#129) (2bcd02f)
v1.1.9 (2026-09-04)
Bug Fixes
Code Quality
- Add OpenVPN toggle response logging #113 (Snuffy2)
- Modernize CI and release automation with uv #106 (Snuffy2)
Maintenance
- Fix protected release promotion statuses #114 (Snuffy2)
- Migrate release workflow to published releases #112 (Snuffy2)
- Fix GitHub release repository detection #110 (Snuffy2)
- Update pytest coverage workflows for action v4 #109 (Snuffy2)
- Skip coverage comments for prek autoupdate bot #104 (Snuffy2)
- Add prek-autoupdate bot auto-merge workflow #102 (Snuffy2)
Other Changes
v1.1.8 (2026-08-30)
v1.1.7 (2026-08-08)
Documentation
Code Quality
- Reuse parsed vnStat period labels #99 (Snuffy2)
- Optimize and harden DHCP lease collection #98 (Snuffy2)
- Defer caught-error log rendering #97 (Snuffy2)
- Avoid expensive caller stack inspection #96 (Snuffy2)
v1.1.6 (2026-08-01)
Bug Fixes
Maintenance
v1.1.5 (2026-07-21)
Bug Fixes
v1.1.4 (2026-07-20)
Enhancements
Bug Fixes
v1.1.3 (2026-07-16)
Bug Fixes
v1.1.2 (2026-07-15)
Enhancements
v1.1.1 (2026-07-12)
Enhancements
Documentation
Code Quality
Maintenance
v1.1.0 (2026-07-03)
New Features
- Add Kea DHCPv6 lease support #64 (Snuffy2)
- Add NUT UPS status endpoint #63 (Snuffy2)
- Add live OPNsense test scripts #62 (Snuffy2)
- Add diagnostics traffic stream support #61 (Snuffy2)
Enhancements
- Handle OPNsense 26.1.11 API changes #69 (Snuffy2)
- Normalize OPNsense NAT and DHCP payloads #68 (Snuffy2)
Code Quality
Maintenance
v1.0.15 (2026-06-28)
Bug Fixes
v1.0.14 (2026-06-21)
Enhancements
Bug Fixes
v1.0.13 (2026-06-21)
Bug Fixes
v1.0.12 (2026-06-20)
Bug Fixes
Code Quality
v1.0.11 (2026-06-20)
New Features
Documentation
Code Quality
Maintenance
v1.0.10 (2026-05-29)
Enhancements
Documentation
v1.0.9 (2026-05-29)
Bug Fixes
- Map validation endpoint probe errors #39 (Snuffy2)
- Fix for kea lease state change in OPNsense 26.1.8 #38 (Snuffy2)
- Raise SSL errors during validate call #37 (HarlemSquirrel)
Code Quality
v1.0.8 (2026-04-06)
Maintenance
v1.0.7 (2026-04-05)
Bug Fixes
Documentation
v1.0.6 (2026-04-05)
Enhancements
- Add back legacy unbound blocklist support #26 (Snuffy2)
- Add back legacy camelCase support #25 (Snuffy2)
- Add validate method #23 (Snuffy2)
- Add endpoint checks to prevent errors #22 (Snuffy2)
- Firewall endpoints to GET and don't fail if unavailable #21 (Snuffy2)
Bug Fixes
Documentation
- Clarify opts documentation #30 (Snuffy2)
- Introduce GitHub Actions changelog workflow and reorganize docs #28 (Snuffy2)
- Add documentation #27 (Snuffy2)
Code Quality
v1.0.5 (2026-04-03)
Enhancements
v1.0.4 (2026-03-29)
Enhancements
Bug Fixes
Maintenance
v1.0.3 (2026-03-26)
Bug Fixes
Code Quality
v1.0.2 (2026-03-23)
Enhancements
Code Quality
v1.0.1 (2026-03-23)
Documentation
v1.0.0 (2026-03-22)
v0.0.3 (2026-03-22)
Enhancements
- Improve pytest coverage and Refactor test infrastructure with reusable HTTP response mocking #8 (Snuffy2)
Bug Fixes
Documentation
Other Changes
v0.0.2 (2026-03-22)
Other Changes
v0.0.1 (2026-03-22)
Other Changes
* This Changelog was automatically generated by github_changelog_generator
Release files for aiopnsense 1.1.11
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| aiopnsense-1.1.11.tar.gz | 164.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| aiopnsense-1.1.11-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 244.3 kB
Release files / aiopnsense-1.1.11.tar.gz
| Download URL | aiopnsense-1.1.11.tar.gz |
|---|---|
| Size | 164.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d5bfa91722517e29f6107c4790bbd6ac26fe663872fa3f48056624535ae57e10
|
|
BLAKE2b-256 checksum How to use checksums |
ef06ad1355d4c933a81c988318934738c0a126e9ad3940accfee5dc1bacc79cc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 13, 2026.
Transparency logRelease files / aiopnsense-1.1.11-py3-none-any.whl
| Download URL | aiopnsense-1.1.11-py3-none-any.whl |
|---|---|
| Size | 80.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a94d7b1dd492cc89a641e1767dafaa67d01d92033e95b7c4d87439a53979027d
|
|
BLAKE2b-256 checksum How to use checksums |
c721827ccf80761d5cbb00156da18332dff2be3b58463f9f7eaf966d3b56c051
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 13, 2026.
Transparency log