Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ko_fi: fmainz
28 changes: 24 additions & 4 deletions README-de.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[![hacs_badge](https://img.shields.io/badge/HACS-Custom-41BDF5.svg)](https://github.com/hacs/integration)
[![marketplace_badge](https://img.shields.io/badge/Marketplace-Custom-41BDF5.svg)](https://www.home-assistant.io/integrations/marketplace)
[![GitHub release](https://img.shields.io/github/release/fmainz/ha-ipfire?include_prereleases=&sort=semver&color=blue)](https://github.com/fmainz/ha-ipfire/releases/)
![last commit](https://img.shields.io/github/last-commit/fmainz/ha-ipfire)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
Expand Down Expand Up @@ -41,6 +41,14 @@ Diese Dokumentation ist auch in 🇬🇧 [englischer Sprache](README.md) verfüg

## Neues in dieser Version

### v0.3.7

* Datenschutzbewussten Diagnosebericht mit Integrations- und Verbindungsstatus, Verfügbarkeit der API-Daten, Update-Status, Entitätsanzahlen, UTC-Zeitangaben und bereinigten Fehlerinformationen hinzugefügt. Der normale Zustand `unknown` von Button-Entitäten wird bei der Anzahl nicht verfügbarer oder unbekannter Entitäten nicht mitgezählt. Zugangsdaten, IP-Adressen, Hostnamen und DHCP-Clientdaten werden im Bericht nicht ausgegeben. Die API-Revision erscheint, wenn IPFire-API v0.2.1 oder neuer sie bereitstellt.
* Netzwerkhersteller (`mac_vendor`) zu den DHCP-Lease-Attributen hinzugefügt. Die Zuordnung erfolgt lokal anhand der MAC-Adresse des Lease.
* Native Home-Assistant-Update-Entität hinzugefügt, die verfügbare IPFire-Core- und Paket-Updates anzeigt und das vollständige Pakfire-Upgrade starten kann.
* Statusmeldung für den Update-Vorgang sowie eine native Home-Assistant-Update-Aktion zum Starten eines erforderlichen IPFire-Neustarts hinzugefügt. Die Update- und Neustartfunktionen benötigen eine kompatible `api.cgi`; für den Neustart ist IPFire-API v0.2.5 oder neuer erforderlich.
* Versionsanforderung für `aiooui` angepasst, sodass kompatible Versionen ab 0.1.9 verwendet werden können.

### v0.3.6

* DHCP-Lease-Anzahl und Clientdaten als Sensorattribute hinzugefügt (benötigt api.cgi).
Expand Down Expand Up @@ -87,6 +95,9 @@ HA-IPFire bietet folgende Funktionen:
* DHCP-Lease-Sensor mit Clientdaten¹
* Trafficzähler für einzelne Netzwerkzonen¹
* Neustartstatus und Gesamtzahl verfügbarer Updates¹
* Verfügbare IPFire-Updates anzeigen und das vollständige Pakfire-Upgrade in Home Assistant installieren¹
* Einen erforderlichen IPFire-Neustart über die native HA-Update-Ansicht bestätigen und starten¹
* Einen datensparsamen Diagnosebericht in den HA-Benachrichtigungen erstellen

¹Benötigt api.cgi aus [IPFire-API](https://github.com/FMainz/IPFire-API)

Expand Down Expand Up @@ -181,12 +192,15 @@ Sensoren werden nur für interne Schnittstellen angelegt, die auf der IPFire-Fir

### DHCP-Leases

* **Aktive DHCP-Leases** – Anzahl aktiver DHCP-Leases. Das Attribut `leases` enthält die von IPFire gemeldeten Clientdaten mit IP-Adresse, MAC-Adresse, Hostname, Ablaufzeit und Status. Du findest sie in Home Assistant in der Detailansicht des Sensors unter den Attributen.
* **Aktive DHCP-Leases** – Anzahl aktiver DHCP-Leases. Das Attribut `leases` enthält die von IPFire gemeldeten Clientdaten mit IP-Adresse, MAC-Adresse, Hostname, Ablaufzeit und Status. HA-IPFire ergänzt außerdem `mac_vendor`, ermittelt anhand des MAC-Adresspräfixes aus einer lokalen Zuordnungstabelle. Bei privaten oder nicht registrierten MAC-Adressen kann der Wert fehlen oder unzutreffend sein. Die Lease-Details findest du in Home Assistant in der Detailansicht des Sensors unter den Attributen.

### Systemstatus

* **Neustart erforderlich** – zeigt an, wenn IPFire nach einem Update einen Neustart verlangt. Benötigt eine aktuelle Version von `api.cgi`; bei älteren Versionen bleibt der Sensor unbekannt.
* **Updates verfügbar** – Gesamtzahl der verfügbaren Updates, einschließlich Core- und Paket-Updates.
* **Updates verfügbar** – Gesamtzahl der verfügbaren Updates, einschließlich Core- und Paket-Updates. Das Attribut `updates` listet die einzelnen Core- und Paket-Updates mit ihren Versionen auf.
* **IPFire-Systemupdates** – native Home-Assistant-Update-Entität. Sie erscheint im Update-Bereich von Home Assistant, wenn Updates verfügbar sind; die Release-Zusammenfassung listet Core- und Paket-Updates auf. Mit „Installieren“ wird das vollständige Pakfire-Upgrade gestartet, da IPFire keine Auswahl einzelner Updates unterstützt.
* **Update-Vorgang** – zeigt an, ob ein über die API gestartetes Update inaktiv ist, läuft, abgeschlossen ist oder fehlgeschlagen ist.
* **Router neu starten** – erscheint als native Home-Assistant-Update-Aktion, wenn `api.cgi` ab Revision 0.2.5 einen erforderlichen Neustart meldet. Über die Update-Ansicht kannst du den Router-Neustart nach Bestätigung starten.

### Internetverbindung

Expand Down Expand Up @@ -396,10 +410,16 @@ Die aktuellen Übertragungsraten werden aus den Trafficzählern berechnet und al

## Support

Wenn du einen Fehler findest oder einen Verbesserungsvorschlag hast, kannst du ein Issue im GitHub-Repository erstellen:
Wenn du einen Fehler findest, betätige **Bericht für Fehlermeldungen** im Bereich Diagnose des Geräts. Die Benachrichtigung enthält einen kopierbaren Bericht mit den Versionen von HA-IPFire und Home Assistant, dem eingestellten Abfrageintervall, der Anzahl aktivierter und deaktivierter Entitäten, der Anzahl aktivierter Entitäten mit dem Status `unavailable` oder `unknown` (der normale `unknown`-Status von Buttons wird ausgelassen), UTC-Zeitpunkten der letzten erfolgreichen Abfrage und des letzten Fehlers (sekundengenau), einer bereinigten Fehlermeldung, der Anzahl der DHCP-Leases, der Verfügbarkeit von API-Funktionen und dem Update-Status. Die API-Revision wird ab IPFire-API v0.2.1 ausgegeben. Prüfe den Bericht vor dem Teilen; Zugangsdaten, IP-Adressen, Hostnamen und DHCP-Clientdaten werden ausgelassen.

Du kannst auch ein Issue erstellen oder einen Verbesserungsvorschlag im GitHub-Repository einreichen:

https://github.com/FMainz/HA-IPFire/issues

Wenn dir HA-IPFire weiterhilft, kannst du die Weiterentwicklung auf Ko-fi unterstützen:

[![FMainz auf Ko-fi unterstützen](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/fmainz)

## Repository

https://github.com/FMainz/HA-IPFire
Expand Down
28 changes: 24 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[![hacs_badge](https://img.shields.io/badge/HACS-Custom-41BDF5.svg)](https://github.com/hacs/integration)
[![marketplace_badge](https://img.shields.io/badge/Marketplace-Custom-41BDF5.svg)](https://www.home-assistant.io/integrations/marketplace)
[![GitHub release](https://img.shields.io/github/release/fmainz/ha-ipfire?include_prereleases=&sort=semver&color=blue)](https://github.com/fmainz/ha-ipfire/releases/)
![last commit](https://img.shields.io/github/last-commit/fmainz/ha-ipfire)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
Expand Down Expand Up @@ -41,6 +41,14 @@ This documentation is also available in 🇩🇪 [German](README-de.md).

## What’s New in This Version

### v0.3.7

* Added a privacy-conscious diagnostic report with integration and connection status, API data availability, update status, entity counts, UTC timestamps and sanitized error details. Button entities in their normal `unknown` state are excluded from the unavailable/unknown count; the report omits credentials, IP addresses, hostnames and DHCP client details. API revision is included when supported by IPFire-API v0.2.1 or later.
* Added the network-card vendor (`mac_vendor`) to DHCP lease attributes, looked up locally from the lease MAC address.
* Added a native Home Assistant update entity that shows available IPFire core and package updates and can start the full Pakfire upgrade.
* Added update-operation status reporting and a native Home Assistant update action for starting a required IPFire reboot. These update and reboot features require a compatible `api.cgi`; reboot requires IPFire-API v0.2.5 or later.
* Updated the `aiooui` dependency requirement to accept compatible versions from 0.1.9 onward.

### v0.3.6

* Added DHCP lease count and client details as sensor attributes (requires `api.cgi`).
Expand Down Expand Up @@ -87,6 +95,9 @@ HA-IPFire provides the following features:
* DHCP lease sensor with client details¹
* Traffic counters for individual network zones¹
* Reboot-required status and total available update count¹
* Review available IPFire updates and install the full Pakfire upgrade from Home Assistant¹
* Confirm and start a required IPFire reboot through Home Assistant's native Updates interface¹
* Generate a privacy-conscious diagnostic report in Home Assistant notifications

¹Requires `api.cgi` from [IPFire-API](https://github.com/FMainz/IPFire-API).

Expand Down Expand Up @@ -183,12 +194,15 @@ Sensors are created only for internal interfaces configured on the IPFire firewa

### DHCP leases

* **Active DHCP Leases** – number of active DHCP leases. The `leases` attribute contains the client records reported by IPFire, including IP address, MAC address, hostname, expiry, and status. To view them, open the sensor's more-info panel in Home Assistant and inspect its attributes.
* **Active DHCP Leases** – number of active DHCP leases. The `leases` attribute contains the client records reported by IPFire, including IP address, MAC address, hostname, expiry, and status. HA-IPFire also adds `mac_vendor`, looked up locally from the MAC address prefix. This may be unavailable or inaccurate for private or unregistered MAC addresses. To view the lease details, open the sensor's more-info panel in Home Assistant and inspect its attributes.

### System status

* **Reboot Required** – indicates when IPFire requires a reboot after an update. Requires a current version of `api.cgi`; older versions leave the sensor unknown.
* **Updates Available** – total number of available updates, including core and package updates.
* **Updates Available** – total number of available updates, including core and package updates. Its `updates` attribute lists the exact core/package updates and versions.
* **IPFire System Updates** – native Home Assistant update entity. It appears in Home Assistant's Updates section when updates are available; its release summary lists the included core and package updates. Installing it starts the full Pakfire upgrade, because IPFire does not support selecting individual updates.
* **Update Operation** – reports whether an API-started update is idle, running, completed, or failed.
* **Restart router** – appears as a native Home Assistant update action when `api.cgi` revision 0.2.5 or newer reports that a reboot is required. Start the router reboot from the Updates interface after confirmation.

### Internet connection

Expand Down Expand Up @@ -393,10 +407,16 @@ Current transfer rates are calculated from the traffic counters and are provided

## Support

If you encounter a problem or have a suggestion, please open an issue in the GitHub repository:
If you encounter a problem, press **Error Report** in the device's Diagnostics section. The generated notification contains a copyable report with integration and Home Assistant versions, the configured scan interval, enabled and disabled entity counts, counts of enabled entities in `unavailable` or `unknown` state (the normal `unknown` state of buttons is excluded), UTC timestamps for the last successful update and last error (to the second), a sanitized last error, the DHCP lease count, API feature availability, and update status. The API revision is included starting with IPFire-API v0.2.1. Review the report before sharing; it excludes credentials, IP addresses, hostnames, and DHCP client details.

You can also open an issue or suggest an improvement in the GitHub repository:

https://github.com/FMainz/HA-IPFire/issues

If you find HA-IPFire useful, you can support its ongoing development on Ko-fi:

[![Support FMainz on Ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/fmainz)

## Repository

https://github.com/FMainz/HA-IPFire
Expand Down
9 changes: 7 additions & 2 deletions custom_components/ipfire/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
from dataclasses import dataclass
from datetime import timedelta

import aiooui

from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant
from homeassistant.helpers import config_validation as cv
Expand All @@ -20,7 +22,7 @@
from .coordinator import IPFireCoordinator


PLATFORMS: list[str] = ["binary_sensor", "button", "sensor"]
PLATFORMS: list[str] = ["binary_sensor", "button", "sensor", "update"]

CONFIG_SCHEMA = cv.config_entry_only_config_schema(DOMAIN)

Expand Down Expand Up @@ -58,6 +60,9 @@ async def async_setup_entry(
) -> bool:
"""Set up HA-IPFire from a config entry."""

if not aiooui.is_loaded():
await aiooui.async_load()

session = async_get_clientsession(hass)

scan_interval = entry.options.get(
Expand Down Expand Up @@ -100,4 +105,4 @@ async def async_unload_entry(
return await hass.config_entries.async_unload_platforms(
entry,
PLATFORMS,
)
)
Loading
Loading