Skip to main content
Evert's website

Connecting a Kamst-IR Gateway to Home Assistant via REST

Today I received the Kamst-IR Gateway I recently ordered. This device can be used to read data from Kamstrup MULTICAL meters, which are often used for measuring heat network (Dutch: stadsverwarming) usage. This device gathers data from the meter through an infrared link and can expose this data via MQTT and/or a REST API.

The Home Assistant setup instructions linked by the seller instruct you to do all of the following:

While the MQTT way probably works fine once you've set it up, there are several reasons I'd prefer a REST-based setup:

Why not use the DSMR P1 port? #

The Dutch Smart Meter Requirements mandate that smart meters have a P1 port that provides consumers with live data from the meter. I have a Raspberry Pi connected to the P1 port of my smart electricity meter to monitor power usage, and would have liked to connect it to the heating meter too. While the Eneco ECM-01 module (a device that uploads the Kamstrup meter values to Eneco via LTE) has an RJ-12 port labeled 'P1', it is not operational. Reports online suggest that the new ECM-02 module does output to its P1 port, but I don't expect Eneco will replace my ECM-01 as it was only installed in 2023; furthermore, the Kamst-IR unlocks more data (most notably the water usage in liters, which allows me to split cold and warm water usage as soon as I add water usage monitoring to my setup).

RESTful setup #

The actual setup is pretty easy:

  1. Connect the Kamst-IR Gateway to your Kamstrup meter as instructed by the seller.
  2. Find the IP address of the device. I configured a static IP through my UniFi setup, but if you have working mDNS you can also use the local domain name: http://connectix_kamstir.local:82.
  3. Add an include of rest.yaml to your Home Assistant configuration.yaml: rest: !include rest.yaml
  4. Create a file rest.yaml next to configuration.yaml and add the sensors you want to use in Home Assistant:
- resource: http://[IP]/kamst-ir/api/read # Replace '[IP]' with the IP address or domain name of your device
  scan_interval: 60 # Ensure this matches the 'Current IR Read Interval' as configured on your device
  sensor:
  # The below example adds sensors for heat consumption in GJ and hot water consumption in m³.
  # You can inspect the REST API (http://[IP]/kamst-ir/api/read) through your browser to see
  # other fields that can be used in `value_template`.
    - name: "Heat consumption"
      value_template: "{{ value_json.heat_energy }}"
      unit_of_measurement: "GJ"
      device_class: energy
      state_class: total_increasing
      unique_id: heat_consumption
    - name: "Hot water consumption"
      value_template: "{{ value_json.volume }}"
      unit_of_measurement: "m³"
      device_class: water
      state_class: total_increasing
      unique_id: hot_water_consumption
  1. Check and reload your YAML configuration (or restart your Home Assistant instance).
  2. Go to the Energy dashboard, click 'Edit dashboard' (the pencil icon) in the top right, and add the sensors to their respective sections ('Gas consumption' -> 'Add gas source' for heat consumption, 'Individual water devices' -> 'Add device' for hot water consumption).

After returning to the Energy dashboard the 'Gas' entry should be visible in the 'Energy distribution' and 'Sources' cards, and the 'Gas consumption' card should show up. Come back in a few hours, and these fields should be populated!

The Home Assistant Energy dashboard with heat consumption working
The Home Assistant Energy dashboard with heat consumption working

Unfortunately, as of Home Asistant 2026.1.0 there is no option to rename 'Gas' to 'Heating' or to change the unit on the Energy dashboard from kWh to GJ.

Remarks #

1: The HACS maintainers themselves even state as such multiple times:

  Before you start using HACS, make sure the following requirements are met:
     You know how to access the Home Assistant log file.
     You know how to enable debug logging.

  If you don't know what type of Home Assistant installation you are running, you should not use HACS (or any other custom integration).

2: In fact, the REST API can neither be disabled nor secured with a password - I'd expected the REST endpoint to be at least secured with the credentials used for the configuration menu, but alas.