Smart-me Kamstrup HAN

GitHub: hostrup/homeassistant-smartme-han

Hi everyone! :waving_hand:

I’ve built a custom integration for monitoring and logging data from Kamstrup electricity meters via the Smart-me HAN module.

While the module provides a cloud API, I wanted a robust, local solution that respects the hardware's strict polling limitations and integrates directly with the Home Assistant Energy Dashboard.

:battery: Key Features

1. :high_voltage: Dual Connection (Local Modbus TCP & Cloud API) You can choose between the Smart-me Cloud API or Local Modbus TCP. Local Modbus is highly recommended for lightning-fast, private updates entirely independent of the cloud.

2. :hammer_and_wrench: Intelligent Config Flow & Auto-Recovery The setup is 100% UI-based. Many Smart-me modules ship with the local Modbus port (502) disabled. If the local connection test fails during setup, the integration catches the error and allows you to input your API key. It then sends an asynchronous command via the cloud to enable Modbus TCP on the meter remotely, before seamlessly falling back to the local connection.

3. :gear: Stability & Optimized Polling Kamstrup meters have a strict technical requirement of a minimum 2.5-second delay between Modbus requests to avoid packet drops. Fetching all required registers takes up to 25 seconds. The integration handles this in the background via thread-pool delegation (hass.async_add_executor_job) and a DataUpdateCoordinator, ensuring your Home Assistant event loop never freezes. (Note: Phase-specific active power (W) is intentionally ignored to keep the polling loop as short and stable as possible).

:package: Installation

  1. Add https://github.com/hostrup/homeassistant-smartme-han as a Custom Repository in HACS.
  2. Search for "Smart-me Kamstrup HAN" and install.
  3. Restart Home Assistant and add it via the Integrations page.

I'm running this locally, but I would love feedback, testing, or PRs from anyone with a similar Kamstrup/Smart-me setup. Let me know if you run into issues!