We’ve had district heating for about five years in our house, and I’ve long thought it would be interesting to get the consumption data into Home Assistant alongside the rest of the house’s electricity and heating control.
District heating supplies the heat to the house’s radiators, where regulation happens on a room-by-room basis using Danfoss Ally radiator thermostats, integrated directly into Home Assistant via ZHA without Danfoss’ own gateway or cloud service. The thermostats are battery-powered and controlled locally, while Home Assistant handles the overall coordination.
Recently I acquired a new version of the Kamst-IR Gateway from Smart Gateways – a small WiFi device that reads Kamstrup heat meters optically – and got started.
Placement of the optical eye
My electronic calculator and energy meter on the district heating system is a Kamstrup Multical 602. On my meter, the IR reader sits at the bottom left corner of the front panel, level with the Kamstrup logo. Once the right placement of the gateway is found, a magnet holds it automatically in place.

The polystyrene insulation around the meter was a bit in the way, so I temporarily removed the casing around the unit to test the placement, before cutting a permanent small opening with a hobby knife.
WiFi and MQTT
On first startup, the gateway creates its own temporary WiFi network, which you log into with the default code 12345678. From there you reach the gateway’s configuration page.
MQTT is the actual communication protocol the gateway sends its data through, but it requires a central “post office” – a broker – that receives the messages and forwards them to Home Assistant. The Mosquitto broker add-on is the software that fills that role, and which I installed in Home Assistant for the purpose.
Filling in the gateway’s configuration page and setting up MQTT wasn’t exactly “plug and play”, so I worked through the settings in “dialogue” with an AI (Anthropic Claude). (The configuration page can be accessed via http://[gateway-ip]:82 with user admin and password smartgateways)
An error in the numbers
Once data started flowing in, I noticed that “Power” only showed around 8 W when I turned on the hot water – unrealistically low for heating domestic hot water. The fix was a small template sensor that multiplies the value by 1000 and corrects the unit so the reading comes out in kW.
The sensors in the default dashboard
The gateway automatically creates a number of sensors in Home Assistant via MQTT Discovery. Here’s a selection of the most important ones:
- Heat Energy
- Volume
- Power
- Flow Rate
- Temperature 1 (Supply)
- Temperature 2 (Return)
- Temperature Difference (cooling delta)
- Avg Temperature 1 and 2 (Month/Year)
- Max Flow and Min Flow (Month/Year)
- Cooling Energy
- Leak/Burst Status