- Features
- IPFire
- Sensors
- Internet connection control
- Polling interval
- SSL certificates
- Authentication
- Installation
- Configuration
- IPFire data
- Device
- Connection control
- Home Assistant
- Support
- Repository
- License
Home Assistant integration for monitoring traffic statistics from an IPFire firewall.
HA-IPFire provides the following features:
- Download traffic counter
- Upload traffic counter
- Current download speed
- Current upload speed
- Internet connection state
- Internet connection duration
- Connect and Disconnect controls
- Configurable polling interval
- Polling interval from 5 to 60 seconds
- Optional SSL certificate verification
- Username/password authentication
- HACS compatible
- German and English translations
The integration retrieves traffic information from the IPFire endpoint:
/cgi-bin/speed.cgi
The default URL is:
https://ipfire.local:444
The hostname or IP address can be changed during configuration.
HA-IPFire uses the cumulative traffic counters provided by IPFire to calculate the current transfer rates.
The integration provides six sensors:
- Download
- Upload
- Download Speed
- Upload Speed
- Connection Duration
- Connection State
Connection Duration reports the duration of the current internet connection in seconds.
Connection State reports the current IPFire connection state, such as connected, connecting, or disconnected.
The cumulative traffic counters are provided in bytes.
The current transfer rates are calculated from the difference between two consecutive counter readings and are internally provided in bytes per second.
Home Assistant handles unit conversion and display formatting.
HA-IPFire provides two buttons to control the IPFire internet connection:
- Connect starts the IPFire internet connection.
- Disconnect stops the IPFire internet connection.
The buttons use the dedicated api.cgi endpoint on the IPFire firewall. The CGI uses IPFire's native connection control and authentication.
The CGI script is included in this repository at:
ipfire/api.cgi
The CGI must be installed manually on the IPFire firewall. HACS installs only the Home Assistant integration and cannot copy files to the separate IPFire system.
Copy the CGI to:
/srv/web/ipfire/cgi-bin/api.cgi
Then set the correct ownership and permissions:
chown root:root /srv/web/ipfire/cgi-bin/api.cgi
chmod 755 /srv/web/ipfire/cgi-bin/api.cgiThe CGI uses the existing IPFire web interface authentication. No additional CGI credentials are required.
Security: The CGI should only be accessible through the trusted IPFire web interface and must not be exposed to untrusted networks.
The polling interval can be configured between:
- Minimum: 5 seconds
- Default: 30 seconds
- Maximum: 60 seconds
A shorter interval provides more frequent updates but also results in more requests to the IPFire firewall.
SSL certificate verification can be enabled or disabled during configuration.
Because IPFire installations commonly use self-signed certificates, certificate verification is disabled by default.
If your IPFire installation uses a certificate signed by a trusted certificate authority, SSL verification can be enabled.
The IPFire speed.cgi endpoint requires authentication.
HA-IPFire therefore supports:
- Username
- Password
The credentials are configured when adding the integration to Home Assistant.
Directly via this button:
HA-IPFire can be installed directly through HACS.
- Open HACS.
- Select Integrations.
- Search for
HA-IPFire. - Install the integration.
- Restart Home Assistant.
If HA-IPFire is not available in the standard HACS search, the repository can alternatively be added as a custom repository:
https://github.com/FMainz/HA-IPFire
Select Integration as the repository type.
After installation, add the integration through:
Settings → Devices & services → Add integration
Search for:
HA-IPFire
Copy the following directory:
custom_components/ipfire
into:
config/custom_components/ipfire
Restart Home Assistant and add IPFire through:
Settings → Devices & services → Add integration
During setup, HA-IPFire asks for the following information:
- IPFire URL
- Username
- Password
- SSL certificate verification
- Polling interval
The default IPFire URL is:
https://ipfire.local:444
HA-IPFire automatically uses the following endpoint for traffic data:
/cgi-bin/speed.cgi
The following endpoint is used for internet connection control:
/cgi-bin/api.cgi
The polling interval can be configured between 5 and 60 seconds.
The data is read directly from IPFire. Traffic statistics are provided by
speed.cgi. Additional system, network, service, and update information is
provided through the optional api.cgi. Technical system information is
obtained from Fireinfo.
HA-IPFire creates a single IPFire device in Home Assistant.
If api.cgi is not available, only the following sensors are provided:
- Download
- Upload
- Download Speed
- Upload Speed
If api.cgi is available, additional information about the IPFire system
as well as control of the Internet connection through the Connect and
Disconnect actions is available.
HA-IPFire can control the Internet connection of the IPFire firewall directly from Home Assistant.
The following actions are available through the provided buttons:
- Connect – establishes the Internet connection.
- Disconnect – disconnects the Internet connection.
If Connect is pressed while a connection is already active, the current connection is disconnected and re-established.
HA-IPFire is designed for current Home Assistant versions and uses Home Assistant's native sensor units and statistics support.
The integration provides cumulative traffic counters as increasing values, allowing Home Assistant to use them for statistics and history.
If you encounter a problem or have a suggestion, please open an issue in the GitHub repository:
https://github.com/FMainz/HA-IPFire/issues
https://github.com/FMainz/HA-IPFire
HA-IPFire is released under the MIT License.