How golles/ha-knmi works
Project type and purpose
• This is a Home Assistant “custom component” (plugin) named KNMI.
• Purpose: fetch weather data from the KNMI API and expose it as Home Assistant entities (sensors, binary_sensors, a weather entity, diagnostics).
File structure
• Top‐level directories and files related to development (CI, devcontainer, scripts, tests) can be set aside when drawing the runtime architecture.
• The runtime code lives under custom_components/knmi/:
• manifest.json – metadata used by HA and HACS
• config_flow.py – sets up the integration via the UI and stores a ConfigEntry
• api.py – REST client for the external KNMI API
• coordinator.py – DataUpdateCoordinator that polls api.py on a schedule
• sensor.py, binary_sensor.py, weather.py, diagnostics.py – entity platforms that read from the Coordinator and push states into HA
• const.py – shared constants
• translations/ – language files (en, nl) for UI labels
Key insights from the README
• Configuration is done via the HA UI (config_flow).
• The integration registers multiple entity types (binary_sensors, sensors, a weather entity, diagnostics).
• Data flows: KNMI API → Coordinator → Entities → HA frontend.