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, IPv4 ARP table, and IPv6 NDP 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

    • 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.2.0 (2026-10-09)

Features

Bug Fixes

  • group Dependabot GitHub Actions updates (#140) (b28f2b6)

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

  • deps: patch vulnerable multidict and urllib3 (#145) (0195d41)

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

Metadata

Release files for aiopnsense 1.2.0

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.2.0
File Size Uploaded
aiopnsense-1.2.0.tar.gz 172.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for aiopnsense 1.2.0
File Interpreter ABI Platform
aiopnsense-1.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 255.1 kB

Release files / aiopnsense-1.2.0.tar.gz

Download URL aiopnsense-1.2.0.tar.gz
Size 172.3 kB
Tags Source
SHA-256 checksum
How to use checksums
3f5a6fd04dd53d29ceffc7fc0c41fcbb02c1bb8854c7ec03bd97d7fc61a4a670
BLAKE2b-256 checksum
How to use checksums
33a1c01f80d45af66dc7396d247e63c74413c43e04b09217c9c4cf2c9479b14f
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 Oct 9, 2026.

Transparency log

Release files / aiopnsense-1.2.0-py3-none-any.whl

Download URL aiopnsense-1.2.0-py3-none-any.whl
Size 82.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
480003445919ab693f0be2a6b7461662c6c95b0c16b2f3a8d965d514ca5ac748
BLAKE2b-256 checksum
How to use checksums
87c988173ac0cacbdfc403dc460ae7579a3ca0b9acc05fa9ba5aff2853c144af
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 Oct 9, 2026.

Transparency log

Release history Release notifications | RSS feed

1.3.0

2 release files

1.2.1

2 release files

This release

1.2.0 This release

2 release files

1.1.11

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