Giter Club home page Giter Club logo

hiking-dds238-2-wifi-din-rail-energy-meter-flashing-tasmota's People

Contributors

krikk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

hiking-dds238-2-wifi-din-rail-energy-meter-flashing-tasmota's Issues

Wiring Diagram

Hey, thank you for the guide, it really helped a lot. I was new to flashing the ESP this way, so struggled a bit. I found a youtube video that had a good diagram to use. After getting things wired up like this, I had no issues flashing the device with tasmota.
Screenshot 2021-12-02 at 06 40 12

Reference:
https://www.youtube.com/watch?v=JE3vWB-rhFM

Not switching with Tasmota

I have the firmware flashed with Tasmota 9.2.0. Followed the procedures Hiking DDS238-2 WIFI Module
Tasmota. Seems the relay is not switching.

data points and how to add them for -kWh

Hi,
In one of the issues it was pointed out that esphome can display reverse energy on the DDS238-2, and that the settings are:

  - platform: "tuya"
    name: "${friendly_name} kWh +"
    sensor_datapoint: 101
    unit_of_measurement: "kWh"
    accuracy_decimals: 3
    icon: "mdi:flash"
    filters:
      - multiply: 0.01

  - platform: "tuya"
    name: "${friendly_name} kWh -"
    sensor_datapoint: 9
    unit_of_measurement: "kWh"
    accuracy_decimals: 3
    icon: "mdi:flash"
    filters:
      - multiply: 0.01

sensor_datapoint: 101 is what tasmota and esphome uses for positive energy, and sensor_datapoint: 9 is what esphome uses for reverse energy.

I have been looking at this as I want to monitor the export of solar energy to grid.

I have installed the tuyaMCU helper bookmarklet:
https://github.com/sillyfrog/Tasmota-Tuya-Helper

And it shows datapoint 9, which is used in esphome for reverse energy as shown in below screen shot
Capture

The curious thing is that it doesnt show dpID 101. So I am wondering where that came from for the backlog setting TuyaMCU 37,101; ?
Can functionID be used for more than one datapoint, eg TuyaMCU 37,101; TuyaMCU 37,9;

EDIT:
I just checked another DDS-238 that is connected to my hotwater cylinder, and is shows both dpID 101 and 9, they both have tasmota 11 on and have exactly same config.
Capture2

How to get the exact value of the Counter at the exact Number of Wh ??

Hello, I just flashed tasmota on my dds238-2.
Everything works well except for an inaccurate count. Indeed, the value of the counter that we receive "TuyaReceived#DpType2Id101" must be multiplied by 10 to obtain a value in Wh.
For the record, a flashing LED = 1 Wh.
The incrementation of the counter received by the variable TuyaReceived#DpType2Id101 is done every 10 Wh ... There would be no other way to get the exact value of the meter at the exact number of Wh??
Besides, I can't understand how tasmota can give us a consumption value of 1 Wh??
If anyone has an idea...

Other datatypes ?

I wonder if the line frequency is available from the TuyaMCU itself.
How about dpId=9, what does it mean?

DDS238-2 / Tasmota / Domoticz

I've been using DDS238-2s with tasmota for several years and the counting data is sent directly to my domoticz (domoticz configuration and Idx10 P1 Smartmeter sensor configuration). Everything works fine under normal circumstances, except when there's a power cut, and as soon as the DDS238-2 reboots, the first data sent to my domoticz is no good at all! Someone else has the same problem (clearly a bug generated by TASMOTA) ?

EnergyToday EnergyTotal Problem

Thank you very much for this guide!

I've got an issue. On restart, the daily and total energy get very high values from somewhere. I used the Tasmota energyreset to zero them out, but when I restart the device, they get overwritten with ~5000 KWh or so.

The voltage, power and current energy seems about right, it's just on restart that the total energy gets a bad value.

wrong gateway ip and time

Hello,

I have followed the flashing method some time ago and managed to integrate this meter into HA. It works fine except for two issues, one which I noticed just now:

  1. from the very beginning I noticed that that the loop for measuring the energy each day starts at 2 am instead of 00:00. I cannot change this from anywhere! In HA this is the only device that does this! I have several Sonoff POW R2 and they all start at 00:00. Is there a way to maybe change the date time and set it to my current location in Bucharest, Romania?
  2. I just noticed this while trying to change the time: the gateway ip is wrong.
Hiking DDS238-2 WIFI power-meter

Program Version | 12.0.2(tasmota)

2022-06-20T12:41:03
2_7_4_9/2.2.2-dev(38a443e)
8T06:15:32
2391 at 0xF4000
37
Software/System restart
power-meter
 
wifi network name (64%, -68 dBm) 11n
tasmota-DCACAA-3242
C4:5B:BE:DC:AC:AA
192.168.1.220
192.168.1.249 <-- wrong gateway ip!! it should be 1 not 249!
255.255.255.0
192.168.1.249   <-- here it should be 6 instead of 249
192.168.1.4
 
Enabled
 
192.168.1.67
1883
homeassistant
DVES_DCACAA
tasmota_%06X
cmnd/tasmotas/
cmnd/tasmota_DCACAA/
cmnd/DVES_DCACAA_fb/
Disabled
 
None
 
14462122 (ESP8266EX)
0x1540C8
2048 KB
1024 KB
619 KB
384 KB
26.0 KB

I am not very familiar with tasmota and I see no obvious way to change the time or modify the gateway ip.

Can anyone help me out with this?

Option, add a buzzer

Connect a buzzer (3V active type) to GPIO15 and GND. Better to use a mosfet (BS170) to ensure the ESP is not overloaded.

Use this template:
{"NAME":"Hiking DDS238-2 WIFI","GPIO":[0,2272,0,2304,0,0,0,0,0,0,320,480,32,0],"FLAG":0,"BASE":54}

Configure the buzzer as needed.

Examples:
Beep when current > 20 A:

Rule3
ON energy#current>20 DO buzzer -1,3,20 ENDON
ON energy#current<20 DO buzzer 3,1,1 ENDON

Beep on wifi connect / disconnect:
Rule 4
ON Wifi#Connected DO backlog buzzer 2,1,1; ENDON
ON Wifi#Disconnected DO backlog buzzer 1,3,1; ENDON

image

Unable to flash the dds-238-2

Dear all

This is not the first product that i flash with tasmota, but for this one impossible.
I could pair with smartlife without issue, so it means this is not an issue with hardware.

I have soulded connector to RX TX VCC and GPI00, put GPI00 on ground when starting (used tasmotizer) but it not works.

has anyone had the same problem ? or an idea ?

Thanks in advance

High level overview if what is achieved and what is possible using thins mod

Good day @krikk,
As a total newb to this world could you please include a high level of what can be achieved by this mod and what you are achieving please?
I pretty excited to see that this readily available device from AliExpress has an open source firmware that allows us to play 8)
I am looking to modify to include data logging to internal memory which can then be downloaded later. Do you know if this is possible with the Tasmota FW?

Sorry if this is the wrong place to ask - only just dipped my toes in 8)

Cheers,
Jasper

It's working ?

Hello,

I see that you are using TASMOTA configuration for Tuya connect. Tuya software is written on the ESP module and not in the Power meter IC, into the one you just flashed!

Can you confirm if this setup is working?
... does TASMOTA support direct communication with G80F923?

Silk Screen

@krikk thanks a lot for this repo, helps a lot.

The new version has the silk screen on top, thought I might share.

The red labels show how to connect the serial flasher.

hiking

Flashing without bench power supply

Hi, @krikk - Thanks for all the info in your guide.

I have flashed 3 DDS238-2 energy meters. For anyone who doesn't have a bench power supply and doesn't want to buy one, but does have access to a 3D printer, this is what I have done/used.

Installed Tasmota 11.0.0
Downloaded tasmota.bin - at top of list of downloads
http://ota.tasmota.com/tasmota/release

Used a bread board power supply for the 3,3V DC power.
https://www.amazon.com.au/Breadboard-Supply-Module-DC7-12V-Arduino/dp/B074H5V51V/ref=sr_1_17?keywords=breadboard+power&qid=1648080742&sr=8-17

Can be had off aliexpress for US$1

Wall plug USB power supply needs to be at least 1A. I used a 3A one.

I had 16mm pogo pins already so printed the below jig for it:
16mm pogp pins jig
https://www.thingiverse.com/thing:4554950

18mm pogo pins jig
https://www.thingiverse.com/thing:4099748

Put pogo pins in each corner of jig as well in RX and IO0 positions so the jig sits on the ESP8266 properly. I used pointed pins as that's what I had, however I think cup end pins would work better.

USB TTL programmer I used is a CP2102, I did try 2 others, that either didn't work or stopped 1/2 way through - lost communication with ESP module, so if you can't get it to flash try a CP2102.

https://www.amazon.com.au/HiLetgo-Cp2102-Module-Serial-Converter/dp/B00LODGRV8/ref=sr_1_11?keywords=cp2102+usb+ttl&linkCode=gs3&linkId=424feaad13a82d1725a0c33de5bd01fe&qid=1648093094&sr=8-11

Again can be had off aliexpress for around US$1

breadboard

Instructions broken - Latest Tasmota include some additional support

Just to advice that on latest Tasmota dev brach there is native support for DpId=101 data type.

Use this instead:
Backlog TuyaMCU 33,20; TuyaMCU 32,18; TuyaMCU 31,19; TuyaMCU 37,101;
Backlog SetOption72 1; VoltRes 1; WattRes 1;

Also rule 2 is not needed as energy total will be available on ENERGY message.

Additionally see arendst/Tasmota#11837 requesting native support for this DDS238-2 WIFI devices all together.

Tasmota: missing frequency and reverse power flow

i dont know if this is a general tasmota or setting thing or simply gets not pushed.

but the device can show the frequency on the display and it would be nice to have it in tasmota, too!
also i see its a 2 way power meter so it would also nice to have to see the forward and reverse power flow. this is very handy eg. when use the meter for a solar planel inverter(s) where the power flows forward in the nighttime and reverse on daytime. or vice versa when used on solar powered battey inverters or on USVs on power outages.

can we get this working?

sash

No issue only question

Hi,

Is it possible that you will sell one flashed device?
My knowledge with soldering are not so fine for this.

Regards

disconnected from wifi how to reconnect?

Hello,

I have followed the guide and all was well with the meter so I went ahead and installed it to measure the power for the entire house. Two days after I installed it I lost contact with it (I was monitoring it through homeassistant integration). I still have power in the house but I just cant reconnect it to wifi.

What should I do? I have read that normally you would do the 6 on off cycles and get back to the wifi connection settings or something but this is not possible becuase I would destroy stuff in the house buy doing 6 fast on off cycles.

Is there something I can do to get it back online?

Upon inspection of the network, it appears as one of the clients in the router list but I cannot ping it!

Suppressing mqtt messages

Hi,
I have installed tasmota 11.0.0 on my 3x DDS238, and just from the one I have connected up I am getting mqtt messages continually, so with all 3 connected I am thinking they will block out all other mqtt messages.

Is the a way to suppress the amount of mqtt messages from TuyaReceived ?

I have read the documentation on TuyaMCU here https://tasmota.github.io/docs/TuyaMCU/ but not sure what I am doing and don't want to stuff it up.

What I would like is to get a message at boot and then one every 60 seconds about power usage, and when the device is turned off an on, and the state of the device (on/off) every minute.

At the moment my pi is getting so many mqtt messages from the one DDS238 that I am not get all messages from other sensors,

I have tried with:
Rule1 on System#Boot do RuleTimer1 5 endon on Rules#Timer=1 do backlog TuyaSend8; RuleTimer1 60 endon
and this
Rule1 on System#Boot do RuleTimer1 60 endon on Rules#Timer=1 do backlog TuyaSend8; RuleTimer1 60 endon
Both the above didn't seem to do anything.

Below is a snapshot of what I get in less than 2 seconds.

08:35:01 - tele/tasmota_09C676/RESULT {"TuyaReceived":{"Data":"55AA030000010104","Cmnd":0,"CmndData":"01"}}
08:35:08 - tele/tasmota_09C676/RESULT {"TuyaReceived":{"Data":"55AA03070008120200040000000029","Cmnd":7,"CmndData":"1202000400000000","DpType2Id18":0,"18":{"DpId":18,"DpIdType":2,"DpIdData":"00000000"}}}
08:35:09 - tele/tasmota_09C676/RESULT {"TuyaReceived":{"Data":"55AA0307000813020004000000002A","Cmnd":7,"CmndData":"1302000400000000","DpType2Id19":0,"19":{"DpId":19,"DpIdType":2,"DpIdData":"00000000"}}}
08:35:10 - tele/tasmota_09C676/RESULT {"TuyaReceived":{"Data":"55AA0307000814020004000009A5D9","Cmnd":7,"CmndData":"14020004000009A5","DpType2Id20":2469,"20":{"DpId":20,"DpIdType":2,"DpIdData":"000009A5"}}}
08:35:11 - tele/tasmota_09C676/RESULT {"TuyaReceived":{"Data":"55AA03070008650200040000000A86","Cmnd":7,"CmndData":"650200040000000A","DpType2Id101":10,"101":{"DpId":101,"DpIdType":2,"DpIdData":"0000000A"}}}
08:35:12 - tele/tasmota_09C676/RESULT {"TuyaReceived":{"Data":"55AA030000010104","Cmnd":0,"CmndData":"01"}}
08:35:23 - tele/tasmota_09C676/RESULT {"TuyaReceived":{"Data":"55AA030000010104","Cmnd":0,"CmndData":"01"}}
08:35:34 - tele/tasmota_09C676/RESULT {"TuyaReceived":{"Data":"55AA030000010104","Cmnd":0,"CmndData":"01"}}
08:35:38 - tele/tasmota_09C676/RESULT {"TuyaReceived":{"Data":"55AA03070008120200040000000029","Cmnd":7,"CmndData":"1202000400000000","DpType2Id18":0,"18":{"DpId":18,"DpIdType":2,"DpIdData":"00000000"}}}
08:35:39 - tele/tasmota_09C676/RESULT {"TuyaReceived":{"Data":"55AA0307000813020004000000002A","Cmnd":7,"CmndData":"1302000400000000","DpType2Id19":0,"19":{"DpId":19,"DpIdType":2,"DpIdData":"00000000"}}}
08:35:40 - tele/tasmota_09C676/RESULT {"TuyaReceived":{"Data":"55AA0307000814020004000009A5D9","Cmnd":7,"CmndData":"14020004000009A5","DpType2Id20":2469,"20":{"DpId":20,"DpIdType":2,"DpIdData":"000009A5"}}}
08:35:41 - tele/tasmota_09C676/RESULT {"TuyaReceived":{"Data":"55AA03070008650200040000000A86","Cmnd":7,"CmndData":"650200040000000A","DpType2Id101":10,"101":{"DpId":101,"DpIdType":2,"DpIdData":"0000000A"}}}
08:35:45 - tele/tasmota_09C676/RESULT {"TuyaReceived":{"Data":"55AA030000010104","Cmnd":0,"CmndData":"01"}}
08:35:56 - tele/tasmota_09C676/RESULT {"TuyaReceived":{"Data":"55AA030000010104","Cmnd":0,"CmndData":"01"}}
08:36:07 - tele/tasmota_09C676/RESULT {"TuyaReceived":{"Data":"55AA030000010104","Cmnd":0,"CmndData":"01"}}
08:36:08 - tele/tasmota_09C676/RESULT {"TuyaReceived":{"Data":"55AA03070008120200040000000029","Cmnd":7,"CmndData":"1202000400000000","DpType2Id18":0,"18":{"DpId":18,"DpIdType":2,"DpIdData":"00000000"}}}
08:36:09 - tele/tasmota_09C676/RESULT {"TuyaReceived":{"Data":"55AA0307000813020004000000002A","Cmnd":7,"CmndData":"1302000400000000","DpType2Id19":0,"19":{"DpId":19,"DpIdType":2,"DpIdData":"00000000"}}}
08:36:10 - tele/tasmota_09C676/RESULT {"TuyaReceived":{"Data":"55AA0307000814020004000009A5D9","Cmnd":7,"CmndData":"14020004000009A5","DpType2Id20":2469,"20":{"DpId":20,"DpIdType":2,"DpIdData":"000009A5"}}}
08:36:11 - tele/tasmota_09C676/RESULT {"TuyaReceived":{"Data":"55AA03070008650200040000000A86","Cmnd":7,"CmndData":"650200040000000A","DpType2Id101":10,"101":{"DpId":101,"DpIdType":2,"DpIdData":"0000000A"}}}
08:36:18 - tele/tasmota_09C676/RESULT {"TuyaReceived":{"Data":"55AA030000010104","Cmnd":0,"CmndData":"01"}}
08:36:29 - tele/tasmota_09C676/RESULT {"TuyaReceived":{"Data":"55AA030000010104","Cmnd":0,"CmndData":"01"}}
08:36:38 - tele/tasmota_09C676/RESULT {"TuyaReceived":{"Data":"55AA03070008120200040000000029","Cmnd":7,"CmndData":"1202000400000000","DpType2Id18":0,"18":{"DpId":18,"DpIdType":2,"DpIdData":"00000000"}}}
08:36:39 - tele/tasmota_09C676/RESULT {"TuyaReceived":{"Data":"55AA0307000813020004000000002A","Cmnd":7,"CmndData":"1302000400000000","DpType2Id19":0,"19":{"DpId":19,"DpIdType":2,"DpIdData":"00000000"}}}
08:36:40 - tele/tasmota_09C676/RESULT {"TuyaReceived":{"Data":"55AA030000010104","Cmnd":0,"CmndData":"01"}}
08:36:40 - tele/tasmota_09C676/RESULT {"TuyaReceived":{"Data":"55AA0307000814020004000009A4D8","Cmnd":7,"CmndData":"14020004000009A4","DpType2Id20":2468,"20":{"DpId":20,"DpIdType":2,"DpIdData":"000009A4"}}}
08:36:41 - tele/tasmota_09C676/RESULT {"TuyaReceived":{"Data":"55AA03070008650200040000000A86","Cmnd":7,"CmndData":" 650200040000000A","DpType2Id101":10,"101":{"DpId":101,"DpIdType":2,"DpIdData":"0000000A"}}}
08:36:51 - tele/tasmota_09C676/RESULT {"TuyaReceived":{"Data":"55AA030000010104","Cmnd":0,"CmndData":"01"}}

cannot flash the meter

Hello I have just purchased this meter and wanted to flash tasmota to it so I can integrate it into homeassistant. However, whatever I try I cannot get it to flash.

I am using windows 11 and followed all the guides to the letter. But no matter what I do is I get a timeout in the tasmotizer like so:

image

What is it that I am doing wrong?

I tried to pinout from here: https://user-images.githubusercontent.com/4527135/124747294-b04dd780-df19-11eb-962f-7e01ce873563.png

I have a feeling that there is something missing and I can't figure it out.

Cheers

Option, Save and Restore original firmware

Save bakup of original firmware:
python esptool.py --port COM15 --baud 115200 read_flash 0x00000 0x100000 backup1.img

Restore original firmware:
python esptool.py --port COM15 --baud 234000 write_flash -fm qio -fs 1MB 0x00000 backup1.img

(Adjust the port)

6 pins connector pinout (question)

Hi @krikk
Very nice job, I ordered some to do some testing, I got some ideas to deal with that piece of hardware.

Would you mind (if ou know) tell me on the 6 pins connector from ESP board to main board how are wired the 2 pins in the middle. I think it should be GPIO14 and GPIO16 but I would like to know (I don't have hardware yet) how it's wired.

6 pin connector is as follow (tell me if I'm wrong) :

  • Pin 1 is 3.3V
  • Pin 2 is GND
  • Pin 3 is ?
  • Pin 4 is ?
  • Pin 5 is RXD (RX Data from ESP or from main board? (I guess from ESP)
  • Pin 6 is TXD (TX Data from ESP or from main board? (I guess from ESP)

which of pin 3 and 4 are LED (inverted) or Button ? Is button is active Low or High when idle?

Thank you very much for your help

Option, no need to disolder the module

I've been programing the modules without disordering.
Just remove from the LCD board from the power module, connect the programing pins, gnd and 3.3V, ensure a good power supply able to supply 200mA or more, and that is enough.
With the lcd module floating on the air the tuya mcu is usually stuck in reset so it does not interfere with the programming.

image

Change time zone

Thank you for this page. I wasn't able to flash it without desoldering the wifi module but finally everything works.
Does anyone know if i can change the timezone in which the Today kWh consumption resets? In midnight UTC it starts from 0 but im wondering if this is configurable.

Reading energy export and frequency

Hi, Do you know if its possible to read the export and frequency values and send via mqtt. I have a DDS238 wifi connected to my grid feed, it shows all power going across the DDS238, however it doesn't indicate what direction, as in negative/reverse energy, but on the LCD display of the DDS238 it does show the reverse energy.

I have read that the registers that hold the export data are 21,22,23,24
In the modbus version of the DDS238 it gets this data out, the tasmota code ( file xnrg_09_dds2382.ino) it has:

Energy.export_active = (float)((buffer[19] << 24) + (buffer[20] << 16) + (buffer[21] << 8) + buffer[22]) / 100.0; // 429496729.0 W
float import_active = (float)((buffer[23] << 24) + (buffer[24] << 16) + (buffer[25] << 8) + buffer[26]) / 100.0; // 429496729.0 W

Is it possible to access these registers on the wifi version ?

I have searched and there seemed to be alot of people interested and looking at it but never found any answers.

In the pic below is what I can graph from the mqtt data. On the LCD it says -23 for reverse/export energy, and I would like to get this into home assistant.

Thanks for any help.

energy usage

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.