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

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.9

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.9
File Size Uploaded
aiopnsense-1.1.9.tar.gz 161.8 kB Details

Built distribution (wheel)

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

Total release size: 241.2 kB

Release files / aiopnsense-1.1.9.tar.gz

Download URL aiopnsense-1.1.9.tar.gz
Size 161.8 kB
Tags Source
SHA-256 checksum
How to use checksums
3861256dd9485b8c93fbf9f26e2864a4f3e6d1efeb432029018a849ca79f5553
BLAKE2b-256 checksum
How to use checksums
7b8989f3c6fdcdd36c00062653f8a4747c1d1b9e418a70c98d665a627093d6fb
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 4, 2026.

Transparency log

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

Download URL aiopnsense-1.1.9-py3-none-any.whl
Size 79.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a4fe75d2a14e238a0ce760a1ea2c9609cdd46b3bd5ebdf1e03b675b0918d6f3e
BLAKE2b-256 checksum
How to use checksums
55e87824bfd5212fe8679792a8007d768bc679b8f5154af6a68b1582e82cd461
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 4, 2026.

Transparency log

Release history Release notifications | RSS feed

1.1.11

2 release files

This release

1.1.9 This release

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