SkillAgentSearch skills...

Inetbox2mqtt

communicate over mqtt protocol to simulate a truma inetbox

Install / Use

/learn @mc0110/Inetbox2mqtt
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

inetbox2mqtt

Control your TRUMA heater and/or Aventa aircon over a MQTT broker

Version for different ESP32-HW and RP pico w (latest release: 2.6.4)

<br/>

Badge License: MIT   Stand With Ukraine

</div> <br>
  • Communicate over MQTT protocol to simulate a TRUMA INETBOX
  • new: Full control of TRUMA Combi-heater and TRUMA Aventa air conditioning modes.
  • new: Support of different hw constellations via pin configuration tables
  • new: Support of different mqtt ports and static IP-configuration
  • new: Support of LAN-connections
  • Input credentials over web-frontend
  • Test mqtt-connectivity and lin-interface in web-frontend
  • OTA-updating support with releasing
  • Tested in different hw constellations (with ESP32 or RP2 pico w 2040)
  • Include add-on: Optional Truma DuoControl over GPIO-connections
  • Include add-on: Optional MPU6050 Sensor for spiritlevel-feature
  • The requirements are a CPplus with a version number > C4.00.00 (see disclaimer-section)

Motivation and background

The possibilities opened up by controlling the RV heating or the air condition via an mqtt-broker are manifold. The limits set by a simple SMS technology from the manufacturer are falling.

To establish communication between CPplus and the chip (e.g. ESP32 or RP2 pico), a LIN-UART converter is required. If you want to realise this, please refer to Electrics. However, there are now several suppliers who already have the converter on the board e.g. WoMoLin lin-interface, WoMoLin lin-controller.

It is very important to me to show here an out of the box solution that opens up these possibilities to everyone simply and easily - without special electrical and without programming knowledge. If you don't have the confidence to assemble the few components yourself, you can also ask me for ready-made modules.

Flexible debugging and the possibility to write log-files to solve problems is implemented.

The current version opens flexibility to use different hardware cofigurations.

The development of this software and also just the maintenance in the different variants has already cost many hours of time. This is only possible with your support. Many thanks for this in advance.

The software works on all ESP32 models and probably, with small adjustments (UART address, pins), also on other hardware. It also runs on a Raspberry Pi Pico W. I will not always mention the RP2 pico w explicitly in the following. The variations are bundled in tools.py and you can find the explanation under Run on different devices for details.

Disclaimer

I have tested my solution for the ESP32/RP2 pico in different environments so far, including my own TRUMA/CPplus version. Most of the tests ran straight out of the box.

Please note that older versions of CPplus (e.g. C3.xx.xx) use a different protocol for communication with the inetbox. See the INIT menu <example given> on the CPplus to find the version numbers. Therefore, the data can be read but no commands can be set. If you still want to use the inetbox2mqtt, you can replace the CPplus with a newer one (e.g. C4.03.00). New CPplus can also control older TRUMA heaters (e.g. H5.xx.xx). Please note that other device types of the manufacturer use other control sequences. These are not currently supported. Several users have successfully taken this step, so the procedure can be recommended.

Please ensure that your tests are carried out with a clean electrical setup, preferably already in the proof of concept phase in a stable housing, in order to prevent short circuits or bad connections. Since the LIN connection has a plug, it is advisable to also realise the power supply via a plug. Most problems during realisation can be traced back to defective components due to short circuits or missing ground connections

Please note that this simulation only works on a CPplus to which NO Inetbox is connected. In particular, communication with a TRUMA INet X is not supported. TRUMA INet X is the successor of CPplus and contains inetbox functionalities

The LIN module for the ESP32/RP2 pico in the current version for the ESP32/RP2 pico w have proven to be very stable and CPplus-compatible. It's been going on for months now in various constellations.

Nevertheless, it should be mentioned here that I do not assume any liability or guarantee for its use.

Installation instructions

MicroPython

The software is developed in micropython. After the first tests, I was amazed of how good and powerful the microPython.org platform is.

However, the software did not run with the latest stable kernel from July 2022 (among other things, the bytearray.hex was not implemented there yet). The latest kernels for various ports can be found in the download section. It is quite possible that the software can also run on other ports. If you have had this experience, please let us know. We can then amend the readme accordingly.

Alternative 1: OTA-Installation with mip

If you just want to get the inetbox2mqtt running on the RP2 pico w, this is the way to go.

For the simple 4M types of the ESP32-S this way does not work anymore. Here I ask you to use alternative 2.

The entire installation process should not take longer than 10 minutes. The installation does not have to take place in the final WLAN in which the inetbox2mqtt is to run later.

To do this, you first have to install an up to date microPython version, to be found at micropython/download. My tests were done with upython-version > 19.1-608.

You must enter the commands from the console line by line in the REPL interface. The last import command reloads the entire installation.

import network
st = network.WLAN(network.STA_IF)
st.active(True)
st.connect('<yourSSID>','<YourWifiPW>')
import mip
mip.install('github:mc0110/inetbox2mqtt/bootloader/main.py','/')
import main

Alternative 2: With esptool - only works with the ESP32

The ESP32 with 4M memory does not have enough main storage in the standard micropython firmware to have all the software in memory. For this reason, some of the python modules have been precompiled and are already included in the firmware. Therefore, it is recommended to use the .bin file. Of course, all source files of the project are included, so that anyone can create the micropython firmware himself.

The .bin file contains both the python and the .py files. This allows the whole project to be flashed onto the ESP32 in one go. For this, you can use the esptool. In my case, it finds the serial port of the ESP32 automatically, but the port can also be specified. The ESP32 must be in programming mode (GPIO0 to GND at startup). The command to flash the complete .bin file to the ESP32 is:

esptool.py write_flash 0 flash_esp32_inetbox2mqtt_v265_4M.bin

Alternatively, you can also use the Adafruit online tool (of course only running with Chrome or Edge):

https://adafruit.github.io/Adafruit_WebSerial_ESPTool/

The offset 0x0 must then be entered here.

This is not a partition but the full image for the ESP32. The address 0x0 is not a typo.

Releasing and updating

There are two release numbers that must match, one in main.py and one in release.py. The update process looks at this and if the numbers are different, then the software is updated during the update.

We are very keen to support the application in the best possible way. Most of the changes were necessary to enable the realisation of a web frontend and the initial installation, the entry of the login data for Wifi connection and mqtt-broker and to test this connection and, from version 2.1.x, also to be able to test the LIN connection to CPplus. It is recommended as best practice to reinstall the application in the process if updating is also possible.

Web frontend

After rebooting the port (ESP32, RP2 pico w), an access point (ESP or PICO) is opened first. For the RP2 pico w, the password "password" is required. Please first establish a Wifi connection with the access point. Then you can access the chip in the browser at http://192.168.4.1 and enter the credentials. For details of the Wifimanager, please refer to mc0110/wifimanager.

We call this the OS mode -> i.e. an operating mode that is not the normal run mode but is necessary for tests and for entering the login data.

<div align = center>

grafik

</div>

You have access to the entire file system with up, download and delete functions via a simple file manager.

You can also test the connectivity to the MQTT broker.

As of version 2.1.x, the LIN module - responsible for the TRUMA communication - is already fully executable in this mode. This is very helpful for debugging the electrical connection or for any adjustments.

In this mode, the TRUMA status elements can be queried about the overall status (see button STATUS) and the set command for the water heater (ON / OFF) can be set via buttons.

You can now also carry out the INIT process in this mode. Details are described below.

Credentials formular

<div align = center>

grafik

</div>

Switching to Normal-Run mode

Aft

View on GitHub
GitHub Stars121
CategoryDevelopment
Updated6d ago
Forks32

Languages

Python

Security Score

95/100

Audited on Mar 26, 2026

No findings