Hi All, I would like to report the
successfull outcome of my experimentation with the meter. As previously mentioned, it is the HiKing DDS238-4 W, which comes from factory paired with the Wisen App, which is pure crap.
I would like to thank rodgon81, without his help I would have been unable to complete the task.
Also, he has eagerly helped debug and sole several issues that appeared during testing.
Thank you very much rodgon81!!
In the past, there was some integration to make it work, but it was unreliable, did not remove the cloud connection, and did not allow for fiddling.
After @rodgon81 post, I got in contact with him better understand the required steps, and to debug and troubleshoot the installation.
There were some hiccups, as apparently there are different versions of the meter, but with his great contribution we were able to get it to work.
So, first, with geat power comes great responsibility.
The meter consists of two separate entities that can be described as:
- The meter chip, which is responsible of the control, calculations and display of the information. It may or may not have communication capabilities (some meters only display, some interface using pulse or RS485 protocol, or some can communicate internally with a communications module. As per my understanding, there are currently two protocols such chips could use: Tuya or Hekr.
- The communication module. Usually such module is an ESP8266 (cheaper) or ESP32S (more expensive and with more capabilites).
This module is responsile of communicating vía WiFi with the outside world, and can have different firmware installed.
Fiddling with the former chip is more difficult, challenging and risky, so the solution is based on reprogramming th communication module with a proper defined firmware.
In order to do so, it is necesasary to open the meter, and get access to the ESP module.
Initial step is to disassemble the meter in order to get access to the ESP8266 module. This is fairly easy, there are 4 screws on the bottom part, and the you can remove the cover.
The module is on the left.
To program, you will need to carefully desolder it (I have not tried to program it soldered, and it may work).
Now the "Difficult part", program the module. You need to get two things:
- A 3.3V power source (I have used a module prepared for breadboards that can output 5V and 3.3V).
- A UART programmer. The one I have used is based on CH340 chip and it worked just fine.
Then you will need to connect the module:
- VCC <--> 3.3V from power module
- GND <--> GND from power module
- RX <--> TX from programmer
- TX <--> RX from programmer
See my setup ( I have used a breadboard):
So far, we are ready.
Be aware that after the following steps, you will have a new firmware. It is strongly suggested that you do backup your module firmware. I will not cover the details here, as there are many pages with instructions.
Some of them:
https://www.instructables.com/How-to-Ba ... Esp8266EX/
https://cyberblogspot.com/how-to-save-a ... -firmware/
There are two solution to install in the ESP8266 module to connect to Home Assistant: Tasmota or ESPHome. This development is for ESPHome. Any user could take advantage of the instructions and make the propoer adjustments for Domoticz.
Now the software part. First you will need to prepare your module to accept the program.
You will need to enable programming mode in the ESP8266 module by connecting the shown pin of the controller to ground:
Then you can proceed with the inital programming that can be done with an online tool found at
https://web.esphome.io/
As you press connect you will be taken to a device selection process. And afterwards it will initialize and flash the module.
Once the installation of the first firmware is done, ensure that you remove the short pin installed, as otherwise it will not work properly.
If you set the Wifi config properly, you should be able to program the module OTA, but I suggest that you program the initial configuration connected to the programmer.
Afterwards you will need to use either the ESPHome integration in Home Assistant, or a standalone installation.
Please note that even though you can install ESPHome in Windows, it will not work properly to compile the code to upload. I have learned this the hard way. Use a Virtual Machine with Linux, or a Home Assitant OS Installation. I have used a Home Assistant VM image initially, and then swithed to a Raspberry Pi.
When finished, you can disconnect the USB programmer and test the module connection to your WiFi network.
You are now ready to go on on Home Assistant ESPHome Addon. Your device should appear in the ESPHome manager, and you should be able then to edit its configuration.
After editing , you install it so it is transferred to the module. Test it a couple of times until you make sure it works flawlessly before resoldering into the meter.
The configuration for the yaml file is listed in the rodgon81 github readme:
https://github.com/rodgon81/esphome/tre ... s/dxs238xw
You are now ready to resolder ans start playing with your "unlocked" meter.
I am sure some of the steps may be confusing, bu do investigate, test and post back your findings. I will try to help to the best of my knowledge.
Best regards