tech-controllers icon indicating copy to clipboard operation
tech-controllers copied to clipboard

Question: Direct communication

Open Wingsofcourage opened this issue 2 years ago • 24 comments

Hi

I know that the current solution is based on the API of the web frontend. Did anyone tried a direct communication via the RS port and a communication via RS485 or modbus ?

All details are appreciated.

Wingsofcourage avatar Dec 04 '22 14:12 Wingsofcourage

I think it's need make or get library like https://github.com/denpamusic/PyPlumIO then we can make integration with HA like https://github.com/denpamusic/homeassistant-plum-ecomax

jontofront avatar Dec 04 '22 20:12 jontofront

At the moment i'm struggling even with the wiring. The only thing that is known, that the RS port seems to be a RJ12 port.

Wingsofcourage avatar Dec 05 '22 07:12 Wingsofcourage

At the moment i'm struggling even with the wiring. The only thing that is known, that the RS port seems to be a RJ12 port.

about connection: https://github.com/denpamusic/homeassistant-plum-ecomax/issues/9#issuecomment-1336140374

jontofront avatar Dec 07 '22 12:12 jontofront

Just want to publish my experience so far. The Master DE.100 use an AMTEL 128A micro controller. The Communication is simple. The micro controller included UART and can be received with a simple FTDI board with the Jumper setting to 5V. Use the right port for "RS-Modul" And the received data must be inverted.

Connection properties: Screenshot 2023-12-24 at 11 02 45

Pin3 - RX Pin2&4 - GND

This project was very useful. https://github.com/TomasWallflower/Tech-CS-505/blob/master/CODES.txt

Every 5 sec a data package is sent by the controller.

The format seems to be 2 bytes for the code followed by 2 bytes for the value.

Just for reference : 0x0298 stands for the current hour.

name type start_time duration data Async Serial data 7.63810500 0.000989583333 0x02 Async Serial data 7.64147742 0.000989583333 0x26 Async Serial data 7.64475213 0.000989583333 0xFF Async Serial data 7.64804642 0.000989583333 0xFA Async Serial data 7.65140583 0.000989583333 0x15 Async Serial data 7.65468708 0.000989583333 0xA7 Async Serial data 7.65799438 0.000989583333 0x00 Async Serial data 7.66136029 0.000989583333 0x0B Async Serial data 7.66465454 0.000989583333 0x16 Async Serial data 7.66794883 0.000989583333 0xEF Async Serial data 7.67132775 0.000989583333 0x00 Async Serial data 7.67462854 0.000989583333 0x01 Async Serial data 7.67792283 0.000989583333 0x16 Async Serial data 7.68128875 0.000989583333 0xC2 Async Serial data 7.68458950 0.000989583333 0x00 Async Serial data 7.68790333 0.000989583333 0x01 Async Serial data 7.69126271 0.000989583333 0x16 Async Serial data 7.69445933 0.000989583333 0xC3 Async Serial data 7.69773408 0.000989583333 0x63 Async Serial data 7.70110650 0.000989583333 0x0A Async Serial data 7.70439429 0.000989583333 0x16 Async Serial data 7.70770158 0.000989583333 0x14 Async Serial data 7.71105446 0.000989583333 0x00 Async Serial data 7.71432921 0.000989583333 0xE6 Async Serial data 7.71762350 0.000989583333 0x16 Async Serial data 7.72093079 0.000989583333 0x7F Async Serial data 7.72429017 0.000989583333 0x00 Async Serial data 7.72757146 0.000989583333 0x28 Async Serial data 7.73085271 0.000989583333 0x16 Async Serial data 7.73459621 0.000989583333 0x24 Async Serial data 7.73778633 0.000989583333 0x00 Async Serial data 7.74107408 0.000989583333 0x01 Async Serial data 7.74443346 0.000989583333 0x15 Async Serial data 7.74774079 0.000989583333 0xAC Async Serial data 7.75104158 0.000989583333 0x00 Async Serial data 7.75440746 0.000989583333 0x64 Async Serial data 7.75769525 0.000989583333 0x16 Async Serial data 7.76098300 0.000989583333 0x80 Async Serial data 7.76435542 0.000989583333 0x00 Async Serial data 7.76765621 0.000989583333 0x01 Async Serial data 7.77094400 0.000989583333 0x16 Async Serial data 7.77430337 0.000989583333 0xB9 Async Serial data 7.77761717 0.000989583333 0x00 Async Serial data 7.78092450 0.000989583333 0x01 Async Serial data 7.78425133 0.000989583333 0x17 Async Serial data 7.78751954 0.000989583333 0x3A Async Serial data 7.79082033 0.000989583333 0x00 Async Serial data 7.79420579 0.000989583333 0x00 Async Serial data 7.79749354 0.000989583333 0x16 Async Serial data 7.80080088 0.000989583333 0x81 Async Serial data 7.80414071 0.000989583333 0xF9 Async Serial data 7.80744150 0.000989583333 0x3E Async Serial data 7.81073579 0.000989583333 0x16 Async Serial data 7.81410821 0.000989583333 0xC1 Async Serial data 7.81738946 0.000989583333 0x00 Async Serial data 7.82067071 0.000989583333 0xF0 Async Serial data 7.82403008 0.000989583333 0x15 Async Serial data 7.82734392 0.000989583333 0x7D Async Serial data 7.83063167 0.000989583333 0x00 Async Serial data 7.83388692 0.000989583333 0xDC Async Serial data 7.83752625 0.000989583333 0x15 Async Serial data 7.84084658 0.000989583333 0xCD Async Serial data 7.84414083 0.000989583333 0x00 Async Serial data 7.84750025 0.000989583333 0x00 Async Serial data 7.85078800 0.000989583333 0x16 Async Serial data 7.85409529 0.000989583333 0x10 Async Serial data 7.85746121 0.000989583333 0x00 Async Serial data 7.86076200 0.000989583333 0x00 Async Serial data 7.86404975 0.000989583333 0x16 Async Serial data 7.86740263 0.000989583333 0x20 Async Serial data 7.87070342 0.000989583333 0x14 Async Serial data 7.87401075 0.000989583333 0x1D Async Serial data 7.87736363 0.000989583333 0x16 Async Serial data 7.88065792 0.000989583333 0x21 Async Serial data 7.88397171 0.000989583333 0x00 Async Serial data 7.88734413 0.000989583333 0x05 Async Serial data 7.89063842 0.000989583333 0x03 Async Serial data 7.89393267 0.000989583333 0x12 Async Serial data 7.89730508 0.000989583333 0x00 Async Serial data 7.90061237 0.000989583333 0x00 Async Serial data 7.90388063 0.000989583333 0x03 Async Serial data 7.90727908 0.000989583333 0x11 Async Serial data 7.91052779 0.000989583333 0x00 Async Serial data 7.91382858 0.000989583333 0x00 Async Serial data 7.91718796 0.000989583333 0x01 Async Serial data 7.92049529 0.000989583333 0xF9 Async Serial data 7.92377654 0.000989583333 0x00 Async Serial data 7.92712292 0.000989583333 0x00 Async Serial data 7.93041717 0.000989583333 0x02 Async Serial data 7.93373100 0.000989583333 0xF7 Async Serial data 7.93737033 0.000989583333 0x00 Async Serial data 7.94065158 0.000989583333 0x00 Async Serial data 7.94394587 0.000989583333 0x02 Async Serial data 7.94723362 0.000989583333 0x98 Async Serial data 7.95062558 0.000989583333 0x00 Async Serial data 7.95388729 0.000989583333 0x00 Async Serial data 7.95718158 0.000989583333 0x02 Async Serial data 7.96055400 0.000989583333 0x99 Async Serial data 7.96385479 0.000989583333 0x00 Async Serial data 7.96714908 0.000989583333 0x00 Async Serial data 7.97050846 0.000989583333 0x15 Async Serial data 7.97378971 0.000989583333 0x7C Async Serial data 7.97709704 0.000989583333 0x00 Async Serial data 7.98046942 0.000989583333 0x00 Async Serial data 7.98374417 0.000989583333 0x02 Async Serial data 7.98703196 0.000989583333 0x18 Async Serial data 7.99038483 0.000989583333 0xE5 Async Serial data 7.99369212 0.000989583333 0x9F

Wingsofcourage avatar Dec 27 '22 21:12 Wingsofcourage

I am trying to connect EU-L-X wifi controller to pc via RS485 to USB cable. The pc recognizes the USB serial converter but couldn't establish communication with the controller. In windows 10 device manager I set baud rate to 115200, data bits: 8, Parity: None, stop bits: 1. I've tried to connect via Putty and also using PyPlumIO. Should I register the pc as mixing valve? It asks for device address.

vargai avatar Jan 05 '23 12:01 vargai

I don't understand why. The EU-L-X has already wifi included and you can use the app or the web api to get the data. That should be easier. And UART and RS485 is something different.

I forgot to mention, that the connection speed for the DE.100 is 9600 baud, which may differ for newer controllers.

Wingsofcourage avatar Jan 10 '23 09:01 Wingsofcourage

I used a Wemos D1 mini to read the UART signal and ended up with the following result for DE.100 - Mixing Valve controller

Key: 550 Value: 65530 Key: 5543 Value: 11 Key: 5871 Value: 1 Key: 5826 Value: 1 Key: 5827 Value: 25354 Key: 5652 Value: 240 Key: 5759 Value: 40 Key: 5668 Value: 1 Key: 5548 Value: 100 Key: 5760 Value: 1 Key: 5817 Value: 1 Key: 5946 Value: 0 Key: 5761 Value: 63806 Key: 5825 Value: 190 Key: 5501 Value: 180 Key: 5581 Value: 0 Key: 5648 Value: 0 Key: 5664 Value: 4892 Key: 5665 Value: 2 Key: 786 Value: 0 Key: 785 Value: 0 Key: 505 Value: 0 Key: 759 Value: 0 Key: 664 Value: 0 Key: 665 Value: 0 Key: 5500 Value: 0 Key: 536 Value: 5537

Where : 5759 is Input temperature 5548 is Mixing value open percentage

The list i mentioned earlier seems to be incomplete. https://github.com/TomasWallflower/Tech-CS-505/blob/master/CODES.txt

For Reference here my very primitive Arduino prog. wemosD1mini.ino.txt

Wingsofcourage avatar Dec 26 '23 18:12 Wingsofcourage

Here the complete intermediate code. Feel free to use it.

It receive all messages from the controller and send it over WIFI as MQTT messages to my ioBroker.

wemosD1mini.zip

Wingsofcourage avatar Dec 28 '23 18:12 Wingsofcourage

Screenshot 2023-12-28 at 19 32 09

Wingsofcourage avatar Dec 28 '23 18:12 Wingsofcourage

Please look here: https://dzien.net/tech/index.php?baza=slownik Someone made a great job for translate frames. Maybe this will be helpful.

skapron avatar Dec 28 '23 20:12 skapron

Please look here: https://dzien.net/tech/index.php?baza=slownik Someone made a great job for translate frames. Maybe this will be helpful.

AWESOME !! @skapron Thanks for the link.

Wingsofcourage avatar Dec 29 '23 06:12 Wingsofcourage

My final code with all the updates of states: wemosD1mini.zip

How the solution works ?

  • Tech controllers send their status every couple of seconds to the RS port
  • The Wemos D1 mini will receive those signals from the tech controllers
  • Convert the signals to an internal key-value-store
  • After a timeout (default 10s) the last received values are send to a customisable MQTT Server (ioBroker, home assistant, ... )

What do you need ?

  • Wemos D1 mini
  • 5V step down regulator e.g. AMS 1117 5V
  • Some wire.

Cableing : If you look on the RS port female: Right pin1.

PIN 2+4 GND PIN 6 VCC 12V PIN 3 RX

  1. Connect GND and VCC to the voltage regulator and RX to D1 of your Wemos D1 mini.
  2. Customise the settings.h
  3. In Arduino Studio download ArduinoMqttClient and ESP8266WiFi libs.
  4. Choose 160 Mhz as CPU speed for the Wemos D1 mini board from the tools menu
  5. Increase the buffer size in SoftwareSerial.h from 64 to 256
  6. Flash the code to the Wemos D1 mini with Arduino Studio.
  7. Connect the Wemos D1 Mini to your tech controller.
  8. Have fun.

Notes: Support read only.

Can look like: 1703870269186

Any questions ? Just ask.

Wingsofcourage avatar Dec 29 '23 17:12 Wingsofcourage

Nice work, i'm glad this was helpful. Can anybody convert this code into ESPHome? This will be great to maintain and OTA update.

skapron avatar Dec 30 '23 20:12 skapron

You should consider: https://esphome.io/components/uart.html And i think it needs a custom UART part https://esphome.io/custom/uart.html

Wingsofcourage avatar Jan 03 '24 22:01 Wingsofcourage