IMGW-PIB
The IMGW-PIB integrationIntegrations connect and integrate Home Assistant with your devices, services, and more. [Learn more] uses hydrological data from the Institute of Meteorology and Water Management - National Research Institute to present information about rivers and water reservoirs in Poland.
Use case: Monitor hydrological alerts to protect your family and property from floods, or track river water levels to gain long-term insight into climate change in your area.
Configuration
To add the IMGW-PIB service to your Home Assistant instance, use this My button:
Manual configuration steps
If the above My button doesn’t work, you can also perform the following steps manually:
-
Browse to your Home Assistant instance.
-
In the bottom right corner, select the
Add Integration button. -
From the list, select IMGW-PIB.
-
Follow the instructions on screen to complete the setup.
Supported functionality
The IMGW-PIB integration provides the following entities.
Sensors
-
Water level
- Description: Water level in the river or reservoir at the measurement point
-
Water flow
- Description: River water flow at the measurement point
- Remarks: Not available for all hydrological stations
-
Water temperature
- Description: Water temperature in the river or reservoir at the measurement point
- Remarks: Not available for all hydrological stations
-
Hydrological alert
- Description: Provides information on hydrological alerts for a given river or reservoir
-
Ice phenomena
- Description: Ice phenomena sensor shows how much of the river surface is affected by ice, such as slush, ice floes, or a frozen cover
- Remarks: Not available for all hydrological stations
-
Emergent vegetation cover
- Description: Emergent vegetation cover indicates how much of the river cross-section is occupied by plants that grow above the water surface
- Remarks: Not available for all hydrological stations, disabled by default
-
Floating vegetation cover
- Description: Floating vegetation cover indicates how much of the river cross-section is covered by plants floating on the water surface
- Remarks: Not available for all hydrological stations, disabled by default
-
Submerged vegetation cover
- Description: Submerged vegetation cover indicates how much of the river cross-section is occupied by plants growing under the water surface
- Remarks: Not available for all hydrological stations, disabled by default
IMGW-PIB automation examples
The Hydrological alert sensor lets you react when a hydrological alert is detected for your river or reservoir. Here is an idea to get you started.
You don’t need to edit YAML to use these examples. Copy a YAML snippet from this page, open the visual automation editor in Home Assistant, and press Ctrl+V (or Cmd+V on Mac). Home Assistant automatically converts the pasted YAML into the visual editor format, whether it’s a full automation, a single trigger, a condition, or an action.
Automation: Create a hydrological alert notification
Use the Hydrological alert sensor to create a persistent notification with the content and probability of a hydrological alert. Replace the entity ID in the example with the entity ID of your station’s Hydrological alert sensor.
-
Trigger: State: Hydrological alert changes from No alert
- Target: Your station’s Hydrological alert sensor
- Action: Create persistent notification
YAML example for creating a hydrological alert notification
alias: "Hydrological alert"
triggers:
- trigger: state
entity_id: sensor.warta_oborniki_hydrological_alert
from: no_alert
actions:
- action: persistent_notification.create
data:
title: "Hydrological alert!"
message: >
{{ trigger.to_state.state }},
probability {{ trigger.to_state.attributes.probability }}%
Data updates
The IMGW-PIB integration pollsData polling is the process of querying a device or service at regular intervals to check for updates or retrieve data. By defining a custom polling interval, you can control how frequently your system checks for new data, which can help optimize performance and reduce unnecessary network traffic. [Learn more] data from the IMGW-PIB API every 30 minutes by default.
Known limitations
- The integration provides data for hydrological stations available through the public IMGW-PIB API. Some hydrological stations are not available in this data and therefore the integration does not support them.
- Not all hydrological stations provide all data, so the set of entities for individual stations may differ.
Troubleshooting
The entities are unavailable
Symptom: The entities of the hydrological station become unavailable
The entities of the hydrological station show as unavailable, or Settings > System > Logs contains messages about connecting to the IMGW-PIB API or retrieving data from it.
Description
Home Assistant cannot reach the IMGW-PIB API, or the API does not return data for the selected hydrological station.
Resolution
- Check that Home Assistant has a working internet connection.
- Wait for the next data update. The integration retries automatically every 30 minutes, and the entities become available again when the IMGW-PIB API returns data.
Removing the integration
This integration follows standard integration removal. No extra steps are required.
To remove an integration instance from Home Assistant
- Go to Settings > Devices & services and select the integration card.
- From the list of devices, select the integration instance you want to remove.
- Next to the entry, select the three dots
menu. Then, select Delete.