Integration of Aerosmart m fresh air heating system into homeassistant

Hi everyone,

today I managed to integrate my Aerosmart m fresh air heating system into hassio. Here is a picture of the device that takes care of pretty much every task required to keep my house up and running, like providing warm water, warm air in the winter to keep us comfy and cool air during summertime.

Unfortunately, the heating system is not capable of providing its various system variables through either a cloud environment or any other webservice based apis. This is particularily bad when you want to be notified of situations when it is not functioning properly or I did some mistake when switching the air filtering system for summer or winter.

So i started to investigate on the internet to possibly find a workaround for this issue. Please keep in mind, i have zero knowledge of serial interfaces and such. I did find some pages on Github itself that gave me some insight on how the communication with the heating system could be established. For example here, describing an implementation for FHEM.

The manufacturer, Drexel and Weiss, makes some documents available in their download center explaining various technical aspects and also what values can be extracted from their modbus interface.
Funny thing, they provide an addon hardware for Loxone home automation based on a RS232 Adapter. :slight_smile:

Overall, everything was too complicated for me and i do not plan to invest into Loxone either. So i made a plan, without knowing whether it would work out or not.

So I had the following parts at home:

Next step was to setup the pi zero with the newest buster image (light version).

I then connected the USB-A cable with the serial port of the heating system and gave it a spin. The zero booted without an issue and i now had the possibility to access via SSH.

Coming back to the python 2 code i found on Github, i played around for quite a while to make these scripts work for my purposes. However, i did not succeed and thought about another alternative. At this stage i was already a bit frustrated. :slight_smile: My advise to everyone, stay on it!

A few days before i added a few air quality sensors to hassio that use the MQTT broker and Node-Red addon to distribute the data to hassio and an influx database, running on my synology nas.

By looking through the node red capabilities in the configuration ui, i noticed that there was also a serial in module available. That looked interesting. :slight_smile:
serial_in

So would it be possible to install node red on the pi zero and access the serial interface from there? This would be awesome, then i would just need to post the values through MQTT to hassio. Guess what!? Of course you can. There is even a nice script available that does it for you. You can find it here:
https://nodered.org/docs/getting-started/raspberrypi So i ran the script and in very short time i had a running node red client running on my zero.

I dragged the serial in module into the config canvas and specified the properties.

By attaching a debug node, i was then able to see what values the heating system actually transmits.
Awesome! First step was done. Some of the values where a bit cryptical and i had to look up the official documentation (pdf specified above) to make some sense of them. After all, now the flows look like this, forwarding the extracted, and sometimes formed values to hassio mqtt addon.

Here is an example of some JS code that transforms a temperature value coming through the serial port. Please dont judge me on my code. It’s freestyle, quick and dirty to make it work.

var array = msg.payload;

var type = array[0];
var modbusID = array [1];
var value = array[2];

var jsonString = {};

//Aktuelle Innentemperatur 
if (type == 120 && modbusID == 200) {
    
    var measurementObject = {};
    measurementObject.measurement = "temperature";
    measurementObject.type = type.trim();
    
    var temperatureValue = value.trim();
    temperatureValue = temperatureValue.slice(0,2) + "." + temperatureValue.slice(2)
    temperatureValue = parseFloat(temperatureValue);
    
    measurementObject.value  = temperatureValue;

    jsonString= JSON.stringify(measurementObject);

    var newMsg = { payload: jsonString };
    node.send(newMsg);
}

It is by far not all of them, but i still need some investigation time. For now i focused on the values i was able to make sense of and that i would be interested in, like temperatur and rotational speed of the circulation fans etc.

Using an MQTT out node was also very simple, by just specifying the hassio mqtt broker and the topic that should be used for that value.
mqtt-out-node

I have a little helper tool, MQTT Explorer for Mac, that i use to see which measurements are actually received by the hassio mqtt broker. As you can see, they have arrived there nicely.

Now i can make use of these values with the capabilities hassio gives me. Either create a mqtt sensor or store the values (sometimes in addition to the sensor) in my influx database.

Creating a sensor is fairly easy and looks like this. How creating sensors and the use of templates work can be found here. Mine looks like this:

- platform: mqtt
  state_topic: "Home/Aerosmart/AktuelleInnenTemperatur"
  name: "AerosmartPi Innentemperatur"
  unit_of_measurement: "°C"
  value_template: "{{ value_json.value }}"

Once the sensor is up and running, you can use it in Lovelace UI or in automations etc.

To store the values in my influxdb, i use the node-red addon available for hassio. Here is a flow that illustrates how this can be done.


There is an influxdb-out node available to take care of this task.
influxdb-out-node

Grafana looks nice with the values from my heating system. :slight_smile:

I hope this can be useful for somebody in a similar context. Because I’m very happy achieving this by using tools that you guys make available to us, being not so fluent with writing code, i thought I share my experience.

Now comes the fun part, tweaking and tuning it. Please let know know if you have any ideas to improve the setup. :slight_smile:

Thanks. Ike.

2 Likes

Cool. I have an Aerosmart M in my now 12 year old passivehouse in Belgium. About time I integrate it into HomeAssistant. You work certainly is a good start. Have you uploaded the code somewhere?

All the documentation seems to be in German, not great but not the biggest obstacle. Greater issue is that none of your links to the documentation work. Drexel und Weiss seem to have updated their website since 2020. Any chance you can share your copies or have updated links? Especially the modbus parameter document is critical.

Please check also this discussion here: Node Red on RaspberryPi Zero - How to enable MQTT Autodiscover for Sensors - #11 by ikewestbrook
Maybe this gets you started, check also the links. I have experienced the D&W support and service as catastrophic, as they do not even reply to emails, even though i pay for a 10 years service contract. The fact that they recently reworked their website and broke all the links, speaks for itself. Feel free to contribute to an english documentation of your findings. Good luck.

Here is the control circuitry of my Aerosmart M R (same as yours, except mirrored).
As you can see there are 2 USB-B ports: one for the air (LU) and the other for the heat pump (WP)

Which one did you connect your Pi to? Or perhaps both or a completely different connection altogether?

I found copies of the documentation on github through a link you posted.

I used the bottom one. Would be great to test also the top one, whatever comes out of there.

The are the same. One seems to forward the messages from the other. Sometimes the order is a bit different.

$ tio -b 115200 -t -l bottom.log /dev/ttyUSB1 
[tio 20:30:17] tio v1.32
[tio 20:30:17] Press ctrl-t q to quit
[tio 20:30:17] Connected
[20:30:35] 130 5212 203700
[20:30:46] 140 210 -457
[20:30:47] 140 210 -347
[20:31:02] 140 210 -237
[20:31:02] 140 210 -347
[20:31:25] 140 210 -457
[20:31:26] 140 210 -347
[20:31:28] 130 1040 0
[20:31:28] 130 1042 0
[20:31:28] 130 800 0
[20:31:28] 130 5304 1
[20:31:28] 130 5002 4
[20:31:28] 130 5008 2
[20:31:28] 130 1066 0
[20:31:28] 130 5004 2
[20:31:28] 130 5006 0
[20:31:28] 130 1174 3
[20:31:28] 130 5212 203753
[20:31:28] 130 5210 14122022
[20:31:28] 130 1032 1
[20:31:28] 130 1034 1
[20:31:28] 130 5168 0
[20:31:28] 130 5282 15
[20:31:28] 130 5284 15
[20:31:28] 130 5060 230
[20:31:28] 130 5026 0
[20:31:28] 130 5038 60
[20:31:28] 130 5014 21000
[20:31:28] 130 1198 0
[20:31:28] 130 5054 0
[20:31:28] 130 226 1
[20:31:28] 130 1192 0
[20:31:28] 130 1158 130001807
[20:31:28] 130 202 -2528
[20:31:28] 130 226 1
[20:31:28] 130 228 0
[20:31:28] 130 238 1
[20:31:28] 130 234 0
[20:31:28] 130 236 0
[20:31:28] 130 216 -2743
[20:31:31] 140 210 -457
[20:31:31] 140 210 -347
[20:31:35] 130 5212 203800
[20:32:11] 140 210 -457
[20:32:12] 140 210 -347
[20:32:15] 140 800 0
[20:32:15] 140 1032 1
[20:32:15] 140 1034 1
[20:32:15] 140 5126 0
[20:32:15] 140 1044 0
[20:32:15] 140 1142 0
[20:32:15] 140 5036 0
[20:32:15] 140 1196 0
[20:32:15] 140 1204 0
[20:32:15] 140 5004 2
[20:32:15] 140 1158 140000792
[20:32:16] 140 212 45176
[20:32:16] 140 214 19274
[20:32:16] 130 840 1
[20:32:16] 140 210 -347
[20:32:16] 140 222 0
[20:32:16] 140 224 0
[20:32:16] 140 232 0
[20:32:25] 140 210 -457
[20:32:26] 140 210 -347
[20:32:35] 130 5212 203900
[20:32:37] 140 210 -457
[20:32:37] 140 210 -347
[20:32:39] 140 210 -457
[20:32:39] 140 210 -347
[20:33:32] 140 210 -457
[20:33:32] 140 210 -347
[20:33:35] 130 5212 204000
[20:33:35] 120 1066 1

[tio 20:33:42] Disconnected
$ tio -b 115200 -t -l top.log /dev/ttyUSB0 
[tio 20:30:22] tio v1.32
[tio 20:30:22] Press ctrl-t q to quit
[tio 20:30:22] Connected
[20:30:35] 130 5212 203700
[20:30:46] 140 210 -457
[20:30:47] 140 210 -347
[20:31:02] 140 210 -237
[20:31:02] 140 210 -347
[20:31:25] 140 210 -457
[20:31:26] 140 210 -347
[20:31:28] 130 1040 0
[20:31:28] 130 1042 0
[20:31:28] 130 800 0
[20:31:28] 130 5304 1
[20:31:28] 130 5002 4
[20:31:28] 130 5008 2
[20:31:28] 130 1066 0
[20:31:28] 130 5004 2
[20:31:28] 130 5006 0
[20:31:28] 130 1174 3
[20:31:28] 130 5212 203753
[20:31:29] 130 5210 14122022
[20:31:29] 130 1032 1
[20:31:29] 130 1034 1
[20:31:29] 130 5168 0
[20:31:29] 130 5282 15
[20:31:29] 130 5284 15
[20:31:29] 130 5060 230
[20:31:29] 130 5026 0
[20:31:29] 130 5038 60
[20:31:29] 130 5014 21000
[20:31:29] 130 1198 0
[20:31:29] 130 5054 0
[20:31:29] 130 226 1
[20:31:29] 130 1192 0
[20:31:29] 130 1158 130001807
[20:31:29] 140 840 1
[20:31:29] 130 202 -2528
[20:31:30] 130 226 1
[20:31:30] 130 228 0
[20:31:30] 130 238 1
[20:31:30] 130 234 0
[20:31:30] 130 236 0
[20:31:30] 130 216 -2743
[20:31:31] 140 210 -457
[20:31:31] 140 210 -347
[20:31:35] 130 5212 203800
[20:32:11] 140 210 -457
[20:32:12] 140 210 -347
[20:32:15] 140 800 0
[20:32:15] 140 1034 1
[20:32:15] 140 1044 0
[20:32:16] 140 5036 0
[20:32:16] 140 5004 2
[20:32:16] 140 1204 0
[20:32:16] 140 1158 140000792
[20:32:16] 140 214 19274
[20:32:16] 140 210 -347
[20:32:16] 140 232 0
[20:32:16] 140 224 0
[20:32:16] 140 222 0
[20:32:16] 140 212 45176
[20:32:16] 140 1196 0
[20:32:16] 140 1142 0
[20:32:16] 140 5126 0
[20:32:16] 140 1032 1
[20:32:25] 140 210 -457
[20:32:26] 140 210 -347
[20:32:35] 130 5212 203900
[20:32:37] 140 210 -457
[20:32:37] 140 210 -347
[20:32:39] 140 210 -457
[20:32:39] 140 210 -347
[20:33:32] 140 210 -457
[20:33:32] 140 210 -347
[20:33:35] 130 5212 204000
[20:33:35] 120 1066 1

[tio 20:33:41] Disconnected