Git Product home page Git Product logo

itho-esp's Introduction

itho-esp

Itho diag port controller

WTF is this?

This is an ESP32 firmware that connects to the dianostic port of an Itho device in order to communicate with it and let it do things it couldn't before.

Originally designed for controlling the Itho HRU ecofan 350 ventilation unit via MQTT, but can be used to play with the I2C bus of many other Itho products.

Some key features are:

  • I2C bus sniffing - dumps messages to/from the Itho CPU. On products that have peripherals like an RFT receiver, will dump traffic between the peripheral and the CPU.
  • Send and receive dianostic messages to the CPU.
  • Query the device status and parse parameter values.
  • Control the device via Wi-Fi/MQTT.
  • Monitor temperature and humidity via DHT22 or SHT4x, publish results via MQTT.
  • (HRU-specific) Control ventilation level setting (low, med., high) via MQTT.
  • (HRU-specific) Automatically set ventilation to high when humidity exceeds a threshold value.

Prerequisites

Hardware:

  • An Itho ecofan HRU 350 WTW unit (or another Itho product that has an RJ45 diagnostic port)
  • ESP32 Dev Kit (or a raw ESP32 unit + power supply + a USB COM dongle + some SMD work)
  • a logic level shifter for converting 5V <-> 3,3V logic levels (or 2 small N-channel MOSFETs)
  • DHT22 or SHT4x (optional, to measure humidity)
  • DC-DC buck converter (optional, to power ESP32 directly from the Itho diag port's +15V)

Software:

Building

  • Make sure the ESP Dev Kit can be connected to USB and a COM port is functional
  • Install ESP-IDF framework, make sure it works and has access to the COM port (see connect your device)
  • Build the firmware: idf.py build
  • Flash the firmware: idf.py -b 921600 flash (will also invoke build if needed)
  • Attach to the console: idf.py monitor (can combine with the flash command)

Console interface

  • config : Configure Wi-Fi, MQTT and humidity sensor GPIO
  • p : Pullup OFF
  • P : Pullup ON
  • s : Sniffer OFF
  • S : Sniffer ON
  • h : Hex reporting OFF
  • H : Hex reporting ON
  • Or any of MQTT command below

MQTT commands

  • set1 - set ventilation level to low
  • set2 - set ventilation level to medium
  • set3 - set ventilation level to high for 30 min (then back to low)
  • hum - request DHT22 temp/humidity values
  • status - request device status
  • ping - request pong
  • high_hum_threshold - get current high humidity threshold (output goes to esp-data-dht)
  • high_hum_threshold N - set high humidity threshold to N * 0.1% (e.g. for 75% use 750)
  • Hex bytes - send these bytes to the bus

MQTT topics

esp - The topic for MQTT requests.

esp-data - The topic for MQTT replies. In addition, Itho status data + DHT data are published here as a JSON array every 5 seconds.

esp-data-dht - DHT data (humidity, temp, status) is published here when hum is requested.

esp-data-hex - when hex reporting is enabled, all Itho response messages are published here in hex format.

Tech specs

For technical details and other research notes refer to Specs.md

License

The unlicense:

The software is provided AS-IS without any warranty.

You can do whatever you want with it to the extent permitted by law.

I will deny any involvement with this project, should any questions arise.

itho-esp's People

Contributors

arjenhiemstra avatar rustyx avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

itho-esp's Issues

Build failed

Hi,
the build fails on the WIFI part.

../main/wifi.cpp: In function 'void wifi_init_softap()':
../main/wifi.cpp:25:120: warning: missing initializer for member 'wifi_ap_config_t::pairwise_cipher' [-Wmissing-field-initializers]

In file included from /home/brakero1/esp/esp-idf/components/esp_event/include/esp_event.h:18,
                 from ../main/wifi.h:5,
                 from ../main/wifi.cpp:1:
../main/wifi.cpp:29:69: error: cannot convert 'esp_interface_t' to 'wifi_interface_t'
     ESP_ERROR_CHECK(esp_wifi_set_config(ESP_IF_WIFI_AP, &wifi_config));

Any idea? Using ESP-IDF v4.4-dev-479-g1067b2870

Build fails on undeclared constant ESP_MAC_WIFI_STA

$ idf.py build
../main/Config.cpp: In member function 'bool Config::Read()':
../main/Config.cpp:39:32: error: 'ESP_MAC_WIFI_STA' was not declared in this scope; did you mean 'ESP_IF_WIFI_STA'?
   39 |     int rc = esp_read_mac(mac, ESP_MAC_WIFI_STA);
      |                                ^~~~~~~~~~~~~~~~
      |                                ESP_IF_WIFI_STA
../main/Config.cpp:39:14: error: 'esp_read_mac' was not declared in this scope
   39 |     int rc = esp_read_mac(mac, ESP_MAC_WIFI_STA);
      |              ^~~~~~~~~~~~
../main/Config.cpp:47:17: error: 'struct mqtt_config_t' has no member named 'client_id'
   47 |     mqtt_config.client_id = mqttId.c_str();
      |                 ^~~~~~~~~
../main/Config.cpp:48:17: error: 'struct mqtt_config_t' has no member named 'uri'
   48 |     mqtt_config.uri = mqtturi.c_str();
      |                 ^~~
../main/Config.cpp:49:17: error: 'struct mqtt_config_t' has no member named 'cert_pem'
   49 |     mqtt_config.cert_pem = trimToNull(mqttServerCert.c_str());
      |                 ^~~~~~~~
../main/Config.cpp:50:17: error: 'struct mqtt_config_t' has no member named 'client_key_pem'
   50 |     mqtt_config.client_key_pem = trimToNull(mqttClientKey.c_str());
      |                 ^~~~~~~~~~~~~~
../main/Config.cpp:51:17: error: 'struct mqtt_config_t' has no member named 'client_cert_pem'
   51 |     mqtt_config.client_cert_pem = trimToNull(mqttClientCert.c_str());
      |                 ^~~~~~~~~~~~~~~

Environment:

  • Ubuntu 20.04 (amd64)
  • ESP-IDF v5.1-dev-3066-g236fa5e669

Datamessage explained a little further

Can you explain the data messages a little further? Trying to understand their meanings.

Data format return of an Itho Eco Fan CVS silent: (1B)

80 82 A4 00 01
0C
80 10 10 10 00 10 20 10 10 00 92 92 29
12 datatypes. (0C) with their formats.
29 is checksum. So far so good.

But then it gets a little blurry.
Status query return:

80 82 A4 01 01

17 64 01 C2 01 C6 00 10 04 02 01 00 00 28 22 00 00 82 00 EF 82 00 82 00 7D

Am I correct that there are 12 size definitions and 12 payloads according to data format and observations?
7d is checksum.

17 64....
64 is payload.
Translates to 100 in decimals.
That would read 10. Is that correct?
10000000 is format, signed, 1 byte, 10^0.

How do the data labels correlate with these?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.