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, IPv4 ARP table, IPv6 NDP table, and timestamped host-observation 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, DNS query statistics, and query log search
- OpenVPN and WireGuard status plus VPN instance toggling
- IPsec phase 1 (IKE) connection status plus connection toggling, and phase 2 (child SA) status
- 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.6.2 (2026-12-01)
Bug Fixes
Dependencies
- bump the github-actions group with 2 updates (#274) (aa07a45)
- bump the python-dependencies group with 6 updates (#275) (790af5f)
- update prek hooks (#276) (42331ec)
1.6.1 (2026-11-27)
Bug Fixes
1.6.0 (2026-11-26)
Features
- add Unbound Query Stats and Query Log reads (#243) (22762f4)
- report CARP access level (#253) (17af0fc)
- report DHCP lease access level (#252) (4b97653)
- report VPN status and configuration access (#245) (6ac2aa9)
Bug Fixes
- distinguish failed Speedtest reads from a missing plugin (#261) (52e65cb)
- distinguish unavailable speedtest reads from missing plugin (52e65cb)
- keep observing firmware install through an empty lock state (#267) (bf7cf6f)
- make shared-key WireGuard status order-independent (#247) (5e6597c)
- preserve NUT inventory when status reads fail (#260) (299709d)
- preserve readable DHCP lease inventory (#270) (bfa524e)
- preserve Unbound switches when inventory reads fail (#255) (d1a59a1)
- preserve unknown gateway inventory on read failure (#257) (3764a05)
- preserve unknown interface inventories on read failure (#254) (8d2a152)
- preserve unknown service inventories (#256) (4dab499)
- preserve unknown SMART results on read failure (#259) (cea1406)
- preserve unknown vnStat inventories on read failure (#263) (d38a6ce)
- preserve unreadable telemetry inventories (#258) (af11106)
- preserve VPN status after configuration denial (#246) (b3d1565)
- report an unreadable firewall rule group as unknown (#251) (d67dc1a)
- report malformed service inventories as unknown (#268) (9c4be29)
Documentation
- agents: allow read-only network lookups without asking (#266) (ec33a4c)
- align documentation with ADR 0004 (#265) (5f2d1b3)
- align glossary terms with hass-opnsense (#250) (d991331)
- define Status Access and Configuration Access (#244) (2ec54ed)
- extend ADR 0004 to unknown inventories (#262) (97f8b72)
Code Refactoring
- centralize WireGuard link assembly (#269) (75e0a22)
- share inventory read policy for Services and SMART (#271) (5cdf37b)
Continuous Integration
1.5.0 (2026-11-24)
Features
Bug Fixes
- block forbidden firmware requests at the HTTP boundary (#212) (3205b7a)
- close the client when validation fails in aenter (#190) (ecdc6f3)
- compare beta firmware builds and test real version shapes (#209) (334434c)
- give firmware gating one policy for unknown firmware (#195) (91769ad)
- guard legacy Unbound writes against incomplete settings (#199) (0925dbd)
- keep validation’s error mode local (#240) (ebfb771)
- limit automatic firmware checks to one per hour (#205) (e5f92d5)
- name public methods in request failure logs and give dispatch one home (#227) (9eac267)
- raise Unbound blocklist errors when throw_errors is on (#194) (1cb9b51)
- read the system time endpoint of the firmware's Endpoint Style (#238) (360e01a)
- report every HTTP request failure through one shared classification (#196) (c26612f)
- reset endpoint state after verified firmware install (#242) (a1c46de)
- run every Toggle through one Toggle module and stop reporting unsaved changes as success (#197) (a4226f3)
- skip queued POSTs cancelled before dispatch (#200) (36cb432)
- support explicit VPN toggle target states (#185) (e52757c)
- treat empty WireGuard inventory lists as empty (#229) (85bdb4c)
- treat trailing zero version components as equal in firmware_is_at_least (#189) (13e7244)
Dependencies
- bump astral-sh/setup-uv from 10.3.2 to 10.3.3 in the github-actions group (#177) (2f33a4e)
- bump py-cov-action/python-coverage-comment-action from 4.5 to 4.6 in the github-actions group (#183) (ceb59d0)
- bump the python-dependencies group with 10 updates (#178) (048cab5)
- bump the python-dependencies group with 10 updates (#181) (ac34f6c)
- bump the python-dependencies group with 6 updates (#184) (dd33af2)
- update prek hooks (#179) (f091275)
- update prek hooks (#182) (f39ff84)
- update prek hooks (#226) (64a6b40)
Documentation
- document worktree imports and test conventions for agents (#192) (6d8cb6c)
- note that pydoclint runs through prek (#211) (ab7c9dc)
- record read-only tests and endpoint tracing (#223) (3a35a3b)
- require tracing Router failure paths before trusting responses (#207) (d61bb11)
- say how to find the main checkout venv (#230) (919b4d5)
- show how to run live Router scripts from worktrees (#206) (0a6aec1)
- specify public behavior in refactor specs (#203) (badd29b)
Miscellaneous Chores
- add domain glossary, coding standards, Toggle ADR, and rename recommended firmware constant (#187) (fe1fba2)
- document API placement and add a manual docs build hook (#191) (4b88e41)
- set up mattpocock agent skills config (#186) (4a261f2)
Code Refactoring
- add endpoint outcome reads beside the probe path (#213) (14df796)
- decode server-sent events in one pure module (#235) (c2d2892)
- give the endpoint availability cache one home (#234) (e9b2b9a)
- give the transport one request body (#236) (adb02c8)
- match each WireGuard link once (#239) (6bb6565)
- read DHCP and SMART endpoints in one request (#215) (0fd5dc0)
- read firewall, unbound, vouchers, vnstat, traffic and speedtest in one request (#217) (abd84d0)
- read firmware status in one request (#218) (18f30d6)
- read telemetry and system endpoints in one request (#216) (b3ed5b9)
- read VPN inventories in one request (#214) (e4209b1)
- remove the legacy endpoint probe path (#219) (aa82631)
- resolve Endpoint Style inside the fetch (#237) (6491bd2)
- share DHCP Lease normalization across backends (#193) (933c40b)
Tests
- count only validation error logs (#241) (7df252f)
- cover queued failures from the PR #194 retrospective (#201) (9ec3ae3)
- enforce private names in private modules (#202) (a385763)
- enforce the firmware endpoint rule from ADR 0002 (#208) (5bec4d4)
- fail fast on unanswered queued requests (#222) (8ca65c2)
- guard request logs against URL credential leaks (#204) (0837c63)
- make the aiohttp session the one test seam (#228) (bd8a460)
- pin endpoint paths as literals in every test module (#233) (e9b8f38)
- pin firmware endpoint paths as literals (#232) (cfe686f)
Continuous Integration
1.4.1 (2026-11-06)
Bug Fixes
- POST to unbound/service/dnsbl so blocklist toggles apply on OPNsense >= 26.1.6 (#176) (b6d98ef)
- POST to unbound/service/dnsbl so extended blocklist toggles apply (b6d98ef)
Dependencies
1.4.0 (2026-11-01)
Features
Dependencies
- bump astral-sh/setup-uv from 10.3.0 to 10.3.2 in the github-actions group (#170) (8484c75)
- bump the python-dependencies group with 6 updates (#171) (3dc27f8)
1.3.3 (2026-10-30)
Bug Fixes
- deps: update certifi to remove compromised CA trust (#165) (6b37b1d)
- migrate pydoclint configuration for updated hooks (#167) (8c909a9)
- verify firmware installation lifecycle (#169) (cd9884d)
Dependencies
- bump the python-dependencies group with 3 updates (#164) (16c1c0c)
- bump uv from 0.13.0 to 0.13.4 (#163) (b2ae207)
- update prek hooks (#162) (84de3d2)
- update prek hooks (#168) (3029184)
1.3.2 (2026-10-18)
Bug Fixes
1.3.1 (2026-10-17)
Features
- add IPsec child (phase 2) status to get_ipsec (#153) (f1df285)
- add IPsec connection enabled state and toggling (#151) (bba8894)
Bug Fixes
- distinguish unavailable VPN status from empty sessions (#159) (87beec3)
- suppress repeated request outage logs until recovery (#152) (a16d90f)
Dependencies
- bump astral-sh/setup-uv from 10.2.0 to 10.3.0 in the github-actions group (#157) (bd59948)
- bump the python-dependencies group with 5 updates (#158) (bb2de9d)
Miscellaneous Chores
Tests
1.3.0 (2026-10-16)
Features
- add IPsec phase 1 connection status via get_ipsec (#149) (97902cd)
- expose timestamped MAC host observations (#148) (0480523)
1.2.1 (2026-10-12)
Bug Fixes
1.2.0 (2026-10-09)
Features
Bug Fixes
Dependencies
- bump astral-sh/setup-uv from 10.0.1 to 10.1.0 (#134) (19a184b)
- bump astral-sh/setup-uv from 10.1.0 to 10.2.0 (#138) (0f5ce2c)
- bump py-cov-action/python-coverage-comment-action from 4.3 to 4.5 (#137) (0092a0f)
- bump the python-dependencies group with 4 updates (#135) (310fbe9)
- bump the python-dependencies group with 4 updates (#136) (853b217)
- bump the python-dependencies group with 4 updates (#139) (c4ce98b)
- bump the python-dependencies group with 4 updates (#142) (ec4e056)
Miscellaneous Chores
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
Metadata
Release files for aiopnsense 1.6.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| aiopnsense-1.6.2.tar.gz | 342.5 kB | With provenance | Details for aiopnsense-1.6.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| aiopnsense-1.6.2-py3-none-any.whl | Python 3 | none | any | Details for aiopnsense-1.6.2-py3-none-any.whl |
Total release size: 490.8 kB
Release files / aiopnsense-1.6.2.tar.gz
| Download URL | aiopnsense-1.6.2.tar.gz |
|---|---|
| Size | 342.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
730270644de4c746a23b0f56800420258352e5d702ce0f2ca919b8f0b5d1e2ae
|
|
BLAKE2b-256 checksum How to use checksums |
ac558a645903fabd876f25d81eebcadb11c4c74036cb56b8cde8b6c7e6b4140c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Dec 1, 2026.
Transparency logRelease files / aiopnsense-1.6.2-py3-none-any.whl
| Download URL | aiopnsense-1.6.2-py3-none-any.whl |
|---|---|
| Size | 148.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
77a113627bd721f3594d7dd295b09cce13f0f7b2054a65bea2e16c4fbe7dcb9f
|
|
BLAKE2b-256 checksum How to use checksums |
3afb67ea3cfd9b9fa6a6930a5c85c690388203e9142628db7fbf93f83e4ddb64
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Dec 1, 2026.
Transparency logSecurity for aiopnsense 1.6.2
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.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for aiopnsense-1.6.2.tar.gz
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 Dec 1, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.