My heating system is controlled by an UVR1611 from Technische Alternative as i have to control a wood pellets heater and solar thermal collectors on the roof in a rather unusual configuration and the UVR is a quite universal controller (hence the U in the name ;) ). The system is CANbus based and you can extend really nicely. One of the extensions i’m using is the Computer Management Interface(CMI) which allows me to access the heating control from my network.

For a long time i’ve used a python script to to import the data directly into InfluxDB. I knew when i wrote the script that i could do this with Telegraf, however i did some preprocessing in the script and some additional distribution of the data i couln’t to with Telegraf. However the addtional processing fall out of use and thus i could simplify stuff a little bit. So i migrated the mechanism to pure Telegraf.

[[inputs.http]]
  urls = [
    "http://<ip>/INCLUDE/api.cgi?jsonnode=31&jsonparam=I,O,Na"
  ]
  username = "admin"
  password = "<password>"
  data_format = "json"
  interval = "60s"
  fieldpass = [
      "Data_Network Analog_1_Value_Value",
      "Data_Network Analog_2_Value_Value",
      "Data_Inputs_4_Value_Value",
      "Data_Inputs_9_Value_Value",
      "Data_Inputs_10_Value_Value", 
      "Data_Outputs_2_Value_Value", 
      "Data_Outputs_3_Value_Value", 
      "Data_Outputs_4_Value_Value" 
  ]
 [inputs.http.tags]
   sourcedevice = "cmi"
   cminode = "node 31"

[[processors.rename]]
  order=1
  [processors.rename.tagpass]
    sourcedevice = ["cmi"]
  [[processors.rename.replace]]
    field = "Data_Network Analog_1_Value_Value"
    dest = "pufferspeicheroben"
  [[processors.rename.replace]]
    field = "Data_Network Analog_2_Value_Value"
    dest = "pufferspeicherunten"
  [[processors.rename.replace]]
    field = "Data_Inputs_4_Value_Value"
    dest = "Warmwasserspeicher"
  [[processors.rename.replace]]
    field = "Data_Inputs_9_Value_Value"
    dest = "Vorlauftemperatur"
  [[processors.rename.replace]]
    field = "Data_Inputs_10_Value_Value"
    dest = "Heizungsaussentemperatur"
  [[processors.rename.replace]]
    field = "Data_Outputs_2_Value_Value"
    dest = "Warmwasserladepumpe"
  [[processors.rename.replace]]
    field = "Data_Outputs_3_Value_Value"
    dest = "Heizkreispumpe"
  [[processors.rename.replace]]
    field = "Data_Outputs_4_Value_Value"
    dest = "Kesselanforderung"

When using this configuration, the data from the CMI will appear with fields like this.

Data_Network Analog_1_Value_Value
Data_Inputs_0_Value_Value
Data_Outputs_4_Value_Value

The number (for example the 4 in Data_Outputs_4_Value_Value) is always one less the number of the real port … so 4 is the Data Output Port 5).

If you run the configuration in test mode with --test it will translate the input into the following measurement:

http,cminode=node\ 31,host=server,sourcedevice=cmi,url=http://<ip>/INCLUDE/api.cgi?jsonnode\=31&jsonparam\=I\,O\,Na Heizkreispumpe=1,Heizungsaussentemperatur=17.5,Kesselanforderung=1,Vorlauftemperatur=51.3,Warmwasserladepumpe=0,Warmwasserspeicher=52.6,pufferspeicheroben=74.4,pufferspeicherunten=74.8 1613717063000000000

To make this a little bit more readable most of my Telegraf configuration is about renameing stuff. As Telegraf can diretly read JSON data and the CMI can deliver data in JSON getting and processing the data is really easy. I won’t explain what’s the exact meaning of the names. For owners of the UVR1611 it’s quite obvious. Otherwise you could look in the API documentation i will link below.

A number of additional remarks

  • You have to use the admin user on the cmi and itss password for this to work. This is one of the things i don’t like about the CMI.
  • An interval shorter than 1 minute is not useful. The CMI allows you not more than one access to the data per minute. I think that is more than sufficient. Heating systems are rather slow creatures.
  • Of course you have to adapt the script to your own configuration. You have to change the more speaking names in the rename part of the configuration but more important you have to change the fieldpass section as this configuration just allows to pass the data into further processing that is of interest to me … otherwise you InfluxDB will look quite messy as all datapoints are processed.
  • The documentation for the JSON interface is available here.
  • For a short time my password was in the configuration in this blog entry. I have changed it. ;)

One of my future projects is integrating the lambda sensor of the heating system into my monitoring but this is something for my next vacation.

Written by

Joerg Moellenkamp

Grey-haired, sometimes grey-bearded Windows dismissing Unix guy.