Skip to main content

aiopnsense

GitHub Release GitHub Release Date GitHub Activity Coverage Documentation License

PyPI

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 NAT methods will return empty data.

Documentation

Live test scripts

The scripts/ directory includes live diagnostic helpers for maintainers:

  • aiopnsense_dump.py runs supported aiopnsense client endpoints and prints the raw data returned by the library.
  • opnsense_api_call.py calls 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

Continuous Integration

v1.1.9 (2026-09-04)

Full Changelog

Bug Fixes

  • Fix empty Dnsmasq lease interface discovery #108 (Snuffy2)

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

  • test: optimize and de-brittle test suite #100 (Snuffy2)

v1.1.8 (2026-08-30)

Full Changelog

v1.1.7 (2026-08-08)

Full Changelog

Documentation

  • Add pydoclint documentation checks #95 (Snuffy2)

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)

Full Changelog

Bug Fixes

  • Cache endpoint permission failures #91 (Snuffy2)

Maintenance

v1.1.5 (2026-07-21)

Full Changelog

Bug Fixes

v1.1.4 (2026-07-20)

Full Changelog

Enhancements

  • Support alternate Speedtest plugins #80 (Snuffy2)

Bug Fixes

  • Parse raw NUT UPS status responses #79 (Snuffy2)

v1.1.3 (2026-07-16)

Full Changelog

Bug Fixes

  • Switch firewall rule retrieval to CSV downloads #77 (Snuffy2)

v1.1.2 (2026-07-15)

Full Changelog

Enhancements

  • Raise public OPNsense exceptions consistently #76 (Snuffy2)

v1.1.1 (2026-07-12)

Full Changelog

Enhancements

  • Allow validation without device identity #75 (Snuffy2)

Documentation

Code Quality

Maintenance

v1.1.0 (2026-07-03)

Full Changelog

New Features

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)

Full Changelog

Bug Fixes

v1.0.14 (2026-06-21)

Full Changelog

Enhancements

  • Raise missing device unique ID during validation #56 (Snuffy2)

Bug Fixes

  • Preserve deprecated set_use_snake_case compatibility #55 (Snuffy2)

v1.0.13 (2026-06-21)

Full Changelog

Bug Fixes

v1.0.12 (2026-06-20)

Full Changelog

Bug Fixes

Code Quality

  • Move OPNsense endpoints to module constants #53 (Snuffy2)

v1.0.11 (2026-06-20)

Full Changelog

New Features

Documentation

  • Add Documentation link to pyproject #44 (Snuffy2)

Code Quality

  • Refactor method-aware endpoint availability #48 (Snuffy2)

Maintenance

v1.0.10 (2026-05-29)

Full Changelog

Enhancements

Documentation

v1.0.9 (2026-05-29)

Full Changelog

Bug Fixes

Code Quality

v1.0.8 (2026-04-06)

Full Changelog

Maintenance

  • Merge changelog and release actions #35 (Snuffy2)

v1.0.7 (2026-04-05)

Full Changelog

Bug Fixes

Documentation

v1.0.6 (2026-04-05)

Full Changelog

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

  • Fix showing docstrings in documentation #29 (Snuffy2)

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)

Full Changelog

Enhancements

  • In OPNsenseClient, change from initial to throw_errors #19 (Snuffy2)

v1.0.4 (2026-03-29)

Full Changelog

Enhancements

  • Add CARP status summary and improve VIP interface matching #16 (Snuffy2)

Bug Fixes

Maintenance

v1.0.3 (2026-03-26)

Full Changelog

Bug Fixes

  • Handle 26.1.5+ changes in dnsmasq leases API #14 (Snuffy2)

Code Quality

v1.0.2 (2026-03-23)

Full Changelog

Enhancements

Code Quality

v1.0.1 (2026-03-23)

Full Changelog

Documentation

v1.0.0 (2026-03-22)

Full Changelog

v0.0.3 (2026-03-22)

Full Changelog

Enhancements

  • Improve pytest coverage and Refactor test infrastructure with reusable HTTP response mocking #8 (Snuffy2)

Bug Fixes

  • Fix some endpoints from POST to GET #6 (Snuffy2)
  • Fix GitHub release Workflow #4 (Snuffy2)

Documentation

  • Standardize docstring formatting across codebase #7 (Snuffy2)

Other Changes

v0.0.2 (2026-03-22)

Full Changelog

Other Changes

  • Update version in const.py on release #3 (Snuffy2)

v0.0.1 (2026-03-22)

Full Changelog

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)

Source distribution for aiopnsense 1.1.11
File Size Uploaded
aiopnsense-1.1.11.tar.gz 164.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for aiopnsense 1.1.11
File Interpreter ABI Platform
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 log

Release 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

Release history Release notifications | RSS feed

This release

1.1.11 This release

2 release files

1.1.9

2 release files

1.1.8

2 release files

1.1.7

2 release files

1.1.6

2 release files

1.1.5

2 release files

1.1.4

2 release files

1.1.3

2 release files

1.1.2

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.15

2 release files

1.0.14

2 release files

1.0.13

2 release files

1.0.12

2 release files

1.0.10

2 release files

1.0.9

2 release files

1.0.8

2 release files

1.0.7

2 release files

1.0.6

2 release files

1.0.5

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page