HeishaMon icon indicating copy to clipboard operation
HeishaMon copied to clipboard

Further protocol

Open ariep opened this issue 5 years ago • 256 comments

Thanks for this project! I don't have an Aquarea yet, but am considering it, and one of the factors is the possibility to control it programmatically.

Do you happen to have done more reverse engineering of the protocol? Do you know what features the UART connection supports? I would be particularly interested in:

  • controlling basic functions (on/off, heating/cooling mode);
  • modifying the setpoint of the leaving temperature;
  • reading various sensors (temperatures, flow, etc.).

BTW, your README.md is not really formatted as markdown, and so some of the newlines are lost in the github rendering. You might want to either use actual markdown syntax, or rename it to README.txt.

ariep avatar Sep 25 '19 20:09 ariep

@ariep I have decoded basic functions like changing set point from -5 to +5 (setting fixed one isnt possible without powering off), changing heating/cooling,reading all possible sensor values.

I will upload my file later today, problem that I'am not a good code writer and dont have free time to develop futher. Maybe during winter will have more time. Idea is to use ESP8266 and MQTT protocol to integrate with home automation or use as standalone controller.

Egyras avatar Oct 01 '19 06:10 Egyras

Nice! That sounds really useful.

setting fixed one isnt possible without powering off

Does that mean that it's not possible to set an absolute setpoint via the serial interface at all? Or will it indeed change the setpoint given the right instruction, and restart the heat pump?

It's no problem for me that the protocol information isn't polished or put into proper code, anything you can provide is a great help!

ariep avatar Oct 01 '19 20:10 ariep

@ariep all settings which needs powering off heat pump via button on controller could be changed via serial, because with Aquarea Cloud for engineers/installers these settings can be changed. I just didnt had enough time to check other bits in protocol yet :) It needs just a proper sequence - power off via controller, change desired setting, power on. So same steps could be done via serial commands.

Egyras avatar Oct 02 '19 03:10 Egyras

I would like to help. Have some ESP8266 skills. Can you start a project in your github so we can have a go on it?

IgorYbema avatar Nov 03 '19 06:11 IgorYbema

I would like to help. Have some ESP8266 skills. Can you start a project in your github so we can have a go on it?

@IgorYbema I have ESP8266 skills, just need more skills with C++ to develop code. Will try to write a few lines this month.

Egyras avatar Nov 03 '19 18:11 Egyras

I have started on a Prometheus.io exporter on top of the NodeMCU firmware for ESP8266, based on the information in this repo.

maertsen avatar Nov 10 '19 22:11 maertsen

@maertsen did you tried to connect NodeMCU? I have tried NodeMCU and wemos d1 mini with small luck only. I believe signal level shifter is requered as Panasonic uses 5V Tx and Rx. As I get only one way communcation.

Egyras avatar Nov 11 '19 04:11 Egyras

I'm still waiting for my aliexpress shipping for the connectors so didn't start yet. However can you share your wemos code already egyras? A levelshifting should not be that complex.

IgorYbema avatar Nov 11 '19 06:11 IgorYbema

@IgorYbema I have only test sketch, will post when get my Wemos D1 mini working. It post data to mqtt, it would be better to format all as json as we have multiple values. So it needs more re-work at the moment.

Egyras avatar Nov 11 '19 06:11 Egyras

Every babystep is welcome :-)

IgorYbema avatar Nov 11 '19 07:11 IgorYbema

What direction was working for you? From Wemos to Panasonic? Or the other way? Wondering if the wemos is 5v tolerant or the panasonic is 3.3v tolerant.

IgorYbema avatar Nov 11 '19 15:11 IgorYbema

@IgorYbema wemos and all othe esp8266 modules tolerates 3.3V signal level and Panasonic gives 5V signal, so signal shifter should be used according me. Tx accord me was working on wemos, will check later today.

Egyras avatar Nov 11 '19 18:11 Egyras

@IgorYbema @maertsen did you guys tried to connect wemos D1 or other ESP8266 controller ? I have uploaded my test sketch which made today, no luck even using logic converter from 5V to 3.3V with Wemos D1 mini. If I emulate sketch uploaded to wemos D1 on Laptop with IO Ninja all works, with Panasonic no luck yet.... I use simple USB to TTL converter connected to Panasonic and can query with Laptop and get answers.

Egyras avatar Nov 11 '19 20:11 Egyras

No connectors yet. Will take a while from aliexpress.

IgorYbema avatar Nov 11 '19 20:11 IgorYbema

Ok, found my spare board https://learn.adafruit.com/adafruit-huzzah-esp8266-breakout/overview and all works using logic level shifter 5V-3.3V on TX as RX on this board already tolerates 5V signal. Testing sketch gives heat shift value :) Who wants to improve code ? :)

Egyras avatar Nov 12 '19 16:11 Egyras

Great news to read that you had you first communication on a esp8266 board! In the PDF of that board I read that only the RX (to the board) is level shifting from 5v. The TX on that board is 3.3v and that means that the panasonic is 3.3v tolerant if that works for you. Anyway, I ordered an extra 4-chan bidirectional level shifter (https://nl.aliexpress.com/item/32309390020.html?spm=a2g0s.9042311.0.0.77894c4d7lrla8) which should help.

IgorYbema avatar Nov 12 '19 21:11 IgorYbema

@IgorYbema I used level shifter on TX pin only, I believe that latest original Wemos D1 mini could have some issues with TX pin. Didnt compared newer ver. with older as other my Wemos boars are fake ones. I will try simple ESP8266 ESP-01 module when get it from friend. I dont have proper tools to meassure signal level on Panasonic TX and RX pins, just found somwhere that these are 0-5 V. Next steps to include all most interesting values in the code, implement wifimanager library and maybe some "fancy" web page on ESP8266 for value lookup and some minimal control. If somone could "iron" code a little bit would be great help. You can emulate heat pump work with such software as IO ninja or simillar - just send Panasonic answer to connected ESP module via USB to ttl adaper.

Egyras avatar Nov 12 '19 21:11 Egyras

I can have a go with that. But first need to find out how to use IO ninja :-)

IgorYbema avatar Nov 12 '19 21:11 IgorYbema

A little progress, testing my latest code in Openhab. Need to doublecheck some decrypted values, water flow can be wrong. Also need to find out other bytes.

Screenshot_20191114-100535

Egyras avatar Nov 14 '19 08:11 Egyras

Wow nice! I whish I had my connectors already. Playing with IO ninja is not my cup of tea (and don't have a license also). Could you push your latest code?

IgorYbema avatar Nov 14 '19 08:11 IgorYbema

@IgorYbema IO ninja gives free trial and its easy to launch serial port with a few clicks :) Latest code will be tonight.

Egyras avatar Nov 14 '19 09:11 Egyras

Yesterday I focused on the HTML part (config wifi and mqtt settings instead of hard coded). That is almost done. I hope to add a status page also showing some basic values and log dumps. I find working with IO ninja not that user friendly (or i'm doing something wrong). But then again the backend code you are doing is already going on fine. On what kind of h-series are your working with? I'm not seeing tank status/on/off/temps in your protocol decodes so I assume you are not using an attached watertank?

IgorYbema avatar Nov 16 '19 07:11 IgorYbema

@IgorYbema I have tank connected, its not all-in-one unit. For tank data currently I found current tank temperature and set temperature, there is other parameter like Delta which tells pump when to start heat tank. So for tank to start heating we will calulate manually set temperature - Delta :) And tank off heating will be set temperature which we already know. Also we know 3 way valve status, room or tank. Could to know that you are doing some code improvements. I will try to figure out other commands and some values from protocol.

Egyras avatar Nov 16 '19 07:11 Egyras

But I am missing the the tank off and tank on command. How did you decode? Also using IO ninja?

IgorYbema avatar Nov 16 '19 14:11 IgorYbema

@IgorYbema I will decode these commands, basically it will be heat pump modes like Auto, heat+dhw, dhw only and etc. Currently have only heat pump mode responses. I use my PC with IO ninja in between heat pump and Panasonic Cloud module to capture commands. Issue command via cloud module and capture it.

Egyras avatar Nov 16 '19 14:11 Egyras

@maertsen did you tried to connect NodeMCU? I have tried NodeMCU and wemos d1 mini with small luck only. I believe signal level shifter is requered as Panasonic uses 5V Tx and Rx. As I get only one way communcation.

Like just reported in #4, I have wired up a wemos d1 mini using the NodeMCU firmware and a Lua implementation very similar to your Arduino code. I use a 4-channel I2C-safe Bi-directional Logic Level Converter - BSS138 by Adafruit on both TX and RX.

So far, no response though, so I'm still missing something. :-(

maertsen avatar Nov 17 '19 21:11 maertsen

Mine original new wemos d1 doest work with logic level converter, tested.... I believe that resistors used on rx and tx line can be issue, what I found in forums "On the original wemos D1 mini pro boards they placed 470 ohm resistors on the TX and RX between the cp2104 and the esp8266. On de latest fake boards they replaced this resistors with 2 ohm resistors. An external serial signal won't be strong enough to drive the RX of the ESP because the cp2104 keeps de pin high. If you replace the resistors on the cp2104 TX line, an external serial signal will override the cp2104."

Egyras avatar Nov 17 '19 21:11 Egyras

Can't you just use serial.swap to remap the serial pins to gpio15 and gpio13? The usb-uart isnt connect to these pins.

IgorYbema avatar Nov 17 '19 21:11 IgorYbema

Can't you just use serial.swap to remap the serial pins to gpio15 and gpio13? The usb-uart isnt connect to these pins.

Then I seem to run into https://forum.micropython.org/posting.php?mode=quote&f=16&p=20690&sid=090ca03eb97f96ca45de00a1fe79b89e If these are really hardware problems I should just solve them on my end; they could well be unrelated to this effort. Thanks for thinking along though!

maertsen avatar Nov 17 '19 22:11 maertsen

Can't read that post without login in. But then you can also use software serial libraries. Fast enough for the 9600 baud that is required. Can't wait to receive my connectors so I can join on the hardware side :-) edit: the viewtopic is https://forum.micropython.org/viewtopic.php?f=16&p=20690

IgorYbema avatar Nov 18 '19 06:11 IgorYbema