KAIFA Smart Meter, Meter Extension #1 Cuculus HOWTO:

KAIFA Smart Meter, Meter Extension #1 Cuculus HOWTO:

I want to share my findings integrating the
Meter Extension #1 Cuculus for the KAIFA Smart Meter.

The KAIFA Smart Meter is used in this parts of Austria:
Netz Niederösterreich
Innsbrucker Kommunalbetriebe
Salzburg Netz
TINETZ Tiroler Netze
Vorarlberger Energienetze

I don’t know if the Meter Extension #1 Cuculus is sold by all Providers.

It was alot of hassle to get it running because of no documentation and nearly no help from the manufacturer.

NOTE: Use a fixed IP Address for your device via DHCP Mac Address.

Meter Extension #1 Cuculus


KAIFA Smart Meter

Method #1: HTTP REST API
Use this config and fill in the IP of your Device in the resource URL:

sensor:
  - platform: rest
    name: Power Meter  Load
    resource: http://YOUR-DEVICE-IP/api
    headers:
      content-type: application/json
    method: "POST"
    payload: '{"cmd": "meter_reading","id": 0}'
    unit_of_measurement: 'W'
    device_class: 'power'
    value_template: "{{ value_json['meter'].0.data.2.entry.0.val }}"
    unique_id: 300
  - platform: rest
    name: Power Meter Consumption
    resource: http://YOUR-DEVICE-IP/api
    headers:
      content-type: application/json
    method: "POST"
    payload: '{"cmd": "meter_reading","id": 0}'
    unit_of_measurement: 'Wh'
    device_class: 'energy'
    state_class: total_increasing
    value_template: "{{ value_json['meter'].0.data.4.entry.0.val }}"
    unique_id: 301

Method #2: MQTT
This method is a bit more complicated.
You have to setup a MQTT Broker with SSL/TLS.
I won’t cover a MQTT broker installation here.

But i give a quick overview what the way is:
Install mosquitto.
Create CA Certificate.
Create Server Certificate.
Convert CA Certificate CRT FIle to PEM File as mqtt.pem
Edit your mosquitto.conf file to use SSL on port 8883 and link the Certificates.

Go to http://YOUR-DEVICE-IP in a browser.
click on delete for the file mqtt.pem
choose file mqtt.pem file that you created previosly
click upload

Replace MQTTBROKER-IP/MQTTBROKER-USERNAME/MQTTBROKER-PASSWORD/YOUR-DEVICE-IP in the following curl command and then send it:

curl -i -X POST -d "{\"cmd\":\"mqtt_config\",\"host\":\"mqtts://MQTTBROKER-IP\",\"user\":\"MQTTBROKER-USERNAME\",\"password\":\"MQTTBROKER-PASSWORD\",\"port\":\"8883\"}" YOUR-DEVICE-IP/api

So now MQTT should be running and the device will log into your broker with the topic of your meter number.
If you want to see it you can use MQTT Explorer for example.

Use this config and fill in the Topic number of your Device in the state_topic and json_attributes_topic:

  sensor:
    - name: Power Meter Load
      unit_of_measurement: 'W'
      device_class: 'power'
      unique_id: 170 
      state_topic: "1KFM0100123456/MeterReading"
      json_attributes_topic: "1KFM0100123456/MeterReading"
      value_template: "{{ value_json['meter'].0.data.2.entry.0.val }}"
    - name: Power Meter Consumption
      unit_of_measurement: 'Wh'
      device_class: 'energy'
      state_class: total_increasing
      unique_id: 171
      state_topic: "1KFM0100123456/MeterReading"
      json_attributes_topic: "1KFM0100123456/MeterReading"
      value_template: "{{ value_json['meter'].0.data.4.entry.0.val }}"

Extra Notes:
REST API is at http://YOUR-DEVICE-IP/api
Known commands:

{"cmd": "meter_reading","id": 0}
{"cmd": "log_get_month","id": 1}
{"cmd": "system_status","id": 123}
{"cmd": "mqtt_config","host": "mqtts://MQTTBROKER-IP","user": "MQTTBROKER-USERNAME","password": "MQTTBROKER-PASSWORD","port": "8883"}

Thats it, hope this helps someone out there.

3 Likes

Hi sharonna51,
Thx for this discricption!
I wrote an email to tinetz if the adapter is available for tinetz customers too.
If i get any information i will write it here.
Have a nice weekend
Bergstern

Thanks for the write up, I managed to get my home assistant working with KAIFA via MBUS and a raspberry pi. Its a bit more involved than your solution but it works just the same.

For anyone interested: https://burgstaller.dev/blog/2023-08-26-reading-energy-data-from-kaifa/

Hi, thanks for sharing this. I tried it with REST-API and it works fine. It shows Total Consumption and current Load.

But wondering if can do more with it? For example, Show Price, Forecast and so on. In the App EnergyRadar wich comes with the Smart Meter Extension it should also be possible to display Efficiency Analytics

Hello

thanks for the description.
I would like to get one of these, but over the Internet i didn’t find any sources to buy one. I even tried to contact the manufacturer, but got no answer.
Do you know of any sources to get one?
I am living in DACH. My power-provider doesn’t offer these Power Meter Extension.

This is an English language forum.

Hi sharonna511

sorry i wrote everything in german and now it got hidden, sorry for that.

I got the Smartmeter Extension and maybe you can help me to set up that i can use everything in iobroker.

I am probably not really familiar with this type of transfering data.
I just got mqtt broker on ioboker from “sonoff” to get MQTT entrys from my tasmota smart plugs.

Maybe i can use this mqtt broker to get the data from cuculus?

Hi folks,
after I tried a little and a friend gave me a tip, I would like to share the result with you here:

I was able to buy the Cuculus MeterExtension #1 from my electricity provider (IKB, Tyrol).

  1. OBIS List (German language):
    https://oesterreichsenergie.at/fileadmin/user_upload/Smart_Meter-Plattform/20200201_Konzept_Kundenschnittstelle_SM.pdf

  2. Software for interface request (Postman):
    Just to see which values you could read out
    You don’t have to register - neither for the download nor after starting the program.
    It also works for this query without registration.
    https://www.postman.com/

Request:

POST

http://CUCULUS_METEREXTENSION_IP/api
(Replace CUCULUS_METEREXTENSION_IP with the IP address of your Cuculus Meter Extension #1)

Raw:

{“cmd”: “meter_reading”,“id”: 0}

Send

Result:

{
    "meter": [
        {
            "meterid": "1ELSXXXXXXXXX",
            "data": [
                {
                    "OBIS": "1-0:32.7.0.255",
                    "scale": "-1",
                    "unit": "35",
                    "entry": [
                        {
                            "ts": "1722007035",
                            "val": "2358"
                        }
                    ]
                },
                {
                    "OBIS": "1-0:52.7.0.255",
                    "scale": "-1",
                    "unit": "35",
                    "entry": [
                        {
                            "ts": "1722007035",
                            "val": "2357"
                        }
                    ]
                },
                {
                    "OBIS": "1-0:72.7.0.255",
                    "scale": "-1",
                    "unit": "35",
                    "entry": [
                        {
                            "ts": "1722007035",
                            "val": "2364"
                        }
                    ]
                },
                {
                    "OBIS": "1-0:31.7.0.255",
                    "scale": "-2",
                    "unit": "33",
                    "entry": [
                        {
                            "ts": "1722007035",
                            "val": "568"
                        }
                    ]
                },
                {
                    "OBIS": "1-0:51.7.0.255",
                    "scale": "-2",
                    "unit": "33",
                    "entry": [
                        {
                            "ts": "1722007035",
                            "val": "572"
                        }
                    ]
                },
                {
                    "OBIS": "1-0:71.7.0.255",
                    "scale": "-2",
                    "unit": "33",
                    "entry": [
                        {
                            "ts": "1722007035",
                            "val": "573"
                        }
                    ]
                },
                {
                    "OBIS": "1-0:1.7.0.255",
                    "scale": "0",
                    "unit": "27",
                    "entry": [
                        {
                            "ts": "1722007035",
                            "val": "0"
                        }
                    ]
                },
                {
                    "OBIS": "1-0:2.7.0.255",
                    "scale": "0",
                    "unit": "27",
                    "entry": [
                        {
                            "ts": "1722007035",
                            "val": "3994"
                        }
                    ]
                },
                {
                    "OBIS": "1-0:1.8.0.255",
                    "scale": "0",
                    "unit": "30",
                    "entry": [
                        {
                            "ts": "1722007035",
                            "val": "5470178"
                        }
                    ]
                },
                {
                    "OBIS": "1-0:2.8.0.255",
                    "scale": "0",
                    "unit": "30",
                    "entry": [
                        {
                            "ts": "1722007035",
                            "val": "7640299"
                        }
                    ]
                },
                {
                    "OBIS": "1-0:3.8.0.255",
                    "scale": "0",
                    "unit": "32",
                    "entry": [
                        {
                            "ts": "1722007035",
                            "val": "4743"
                        }
                    ]
                },
                {
                    "OBIS": "1-0:4.8.0.255",
                    "scale": "0",
                    "unit": "0",

                    "entry": [
                        {
                            "ts": "1722007035",
                            "val": "6291429"
                        }
                    ]
                }
            ]
        }
    ],
    "result": "OK"
}

Then you have to copy the following code - depending on which values you want to query - into the configuration.yaml:

# KAIFA Smart Meter (Honeywell DM515), Cuculus MeterExtension #1
sensor:
  # Cuculus Power Meter ID
  - platform: rest
    name: Cuculus Power Meter ID
    scan_interval: 60
    resource: http://CUCULUS_METEREXTENSION_IP/api
    headers:
      content-type: application/json
    method: "POST"
    payload: '{"cmd": "meter_reading","id": 0}'
    value_template: "{{ value_json['meter'].0.meterid }}"
    unique_id: 300
  # Cuculus Power Meter OBIS: 1-0:32.7.0.255, Spannung L1
  - platform: rest
    name: Cuculus Power Meter Voltage L1
    resource: http://CUCULUS_METEREXTENSION_IP/api
    headers:
      content-type: application/json
    method: "POST"
    payload: '{"cmd": "meter_reading","id": 0}'
    unit_of_measurement: 'V'
    device_class: 'power'
    value_template: "{{ value_json['meter'].0.data.0.entry.0.val }}"
    unique_id: 301
  # Cuculus Power Meter OBIS: 1-0:52.7.0.255, Spannung L2
  - platform: rest
    name: Cuculus Power Meter Voltage L2
    resource: http://CUCULUS_METEREXTENSION_IP/api
    headers:
      content-type: application/json
    method: "POST"
    payload: '{"cmd": "meter_reading","id": 0}'
    unit_of_measurement: 'V'
    device_class: 'power'
    value_template: "{{ value_json['meter'].0.data.1.entry.0.val }}"
    unique_id: 302
  # Cuculus Power Meter OBIS: 1-0:72.7.0.255, Spannung L3
  - platform: rest
    name: Cuculus_Power Meter Voltage L3
    resource: http://CUCULUS_METEREXTENSION_IP/api
    headers:
      content-type: application/json
    method: "POST"
    payload: '{"cmd": "meter_reading","id": 0}'
    unit_of_measurement: 'V'
    device_class: 'power'
    value_template: "{{ value_json['meter'].0.data.2.entry.0.val }}"
    unique_id: 303
  # Cuculus Power Meter OBIS: 1-0:31.7.0.255, Strom L1
  - platform: rest
    name: Cuculus Power Meter Power L1
    resource: http://CUCULUS_METEREXTENSION_IP/api
    headers:
      content-type: application/json
    method: "POST"
    payload: '{"cmd": "meter_reading","id": 0}'
    unit_of_measurement: 'A'
    device_class: 'power'
    value_template: "{{ value_json['meter'].0.data.3.entry.0.val }}"
    unique_id: 304
  # Cuculus Power Meter OBIS: 1-0:51.7.0.255, Strom L2
  - platform: rest
    name: Cuculus Power Meter Power L2
    resource: http://CUCULUS_METEREXTENSION_IP/api
    headers:
      content-type: application/json
    method: "POST"
    payload: '{"cmd": "meter_reading","id": 0}'
    unit_of_measurement: 'A'
    device_class: 'power'
    value_template: "{{ value_json['meter'].0.data.4.entry.0.val }}"
    unique_id: 305
  # Cuculus Power Meter OBIS: 1-0:71.7.0.255, Strom L3
  - platform: rest
    name: Cuculus Power Meter Power L3
    resource: http://CUCULUS_METEREXTENSION_IP/api
    headers:
      content-type: application/json
    method: "POST"
    payload: '{"cmd": "meter_reading","id": 0}'
    unit_of_measurement: 'A'
    device_class: 'power'
    value_template: "{{ value_json['meter'].0.data.5.entry.0.val }}"
    unique_id: 306
  # Cuculus Power Meter OBIS: 1-0:1.7.0.255, Wirkleistung Bezug +P (Momentanleistung +P) (W)
  - platform: rest
    name: Cuculus Power Meter 1.7.0
    resource: http://CUCULUS_METEREXTENSION_IP/api
    headers:
      content-type: application/json
    method: "POST"
    payload: '{"cmd": "meter_reading","id": 0}'
    unit_of_measurement: 'W'
    device_class: 'energy'
    state_class: total_increasing
    value_template: "{{ value_json['meter'].0.data.6.entry.0.val }}"
    unique_id: 307
  # Cuculus Power Meter OBIS: 1-0:2.7.0.255, Wirkleistung Lieferung -P (Momentanleistung -P) (W)
  - platform: rest
    name: Cuculus Power Meter 2.7.0
    resource: http://CUCULUS_METEREXTENSION_IP/api
    headers:
      content-type: application/json
    method: "POST"
    payload: '{"cmd": "meter_reading","id": 0}'
    unit_of_measurement: 'W'
    device_class: 'energy'
    state_class: total_increasing
    value_template: "{{ value_json['meter'].0.data.7.entry.0.val }}"
    unique_id: 308
  # Cuculus Power Meter OBIS: 1-0:1.8.0.255, Wirkenergie Bezug +A (Wh)
  - platform: rest
    name: Cuculus Power Meter 1.8.0
    resource: http://CUCULUS_METEREXTENSION_IP/api
    headers:
      content-type: application/json
    method: "POST"
    payload: '{"cmd": "meter_reading","id": 0}'
    unit_of_measurement: 'kWh'
    device_class: 'energy'
    state_class: total_increasing
    value_template: "{{ ( value_json['meter'].0.data.8.entry.0.val | int / 1000 )  }}"
    unique_id: 309
  # Cuculus Power Meter OBIS: 1-0:2.8.0.255, Wirkenergie Lieferung -A (Wh)
  - platform: rest
    name: Cuculus Power Meter 2.8.0
    resource: http://CUCULUS_METEREXTENSION_IP/api
    headers:
      content-type: application/json
    method: "POST"
    payload: '{"cmd": "meter_reading","id": 0}'
    unit_of_measurement: 'kWh'
    device_class: 'energy'
    state_class: total_increasing
    value_template: "{{ ( value_json['meter'].0.data.9.entry.0.val | int / 1000 )  }}"
    unique_id: 310
  # Cuculus Power Meter OBIS: 1-0:3.8.0.255, Blindenergie Bezug +R (Wh)
  - platform: rest
    name: Cuculus Power Meter 3.8.0
    resource: http://CUCULUS_METEREXTENSION_IP/api
    headers:
      content-type: application/json
    method: "POST"
    payload: '{"cmd": "meter_reading","id": 0}'
    unit_of_measurement: 'Wh'
    device_class: 'energy'
    state_class: total_increasing
    value_template: "{{ value_json['meter'].0.data.10.entry.0.val }}"
    unique_id: 311
  # Cuculus Power Meter OBIS: 1-0:4.8.0.255, Blindenergie Lieferung -R (Wh)
  - platform: rest
    name: Cuculus Power Meter 4.8.0
    resource: http://CUCULUS_METEREXTENSION_IP/api
    headers:
      content-type: application/json
    method: "POST"
    payload: '{"cmd": "meter_reading","id": 0}'
    unit_of_measurement: 'Wh'
    device_class: 'energy'
    state_class: total_increasing
    value_template: "{{ value_json['meter'].0.data.11.entry.0.val }}"
    unique_id: 312

Then restart Home Assistant.

You can then display the values as an entity in Home Assistant.

I hope this helps you a little :slight_smile:

Best regards