Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SDM630 with WeMoS D1 Pro can't provide Import Energy (on the WWW dashboard) #18446

Closed
9 of 12 tasks
panciunio opened this issue Apr 18, 2023 · 5 comments
Closed
9 of 12 tasks

Comments

@panciunio
Copy link

PROBLEM DESCRIPTION

A clear and concise description of what the problem is.
SDM630 Power Meter connected to WeMoS D1 Pro doesn't provide Import Active on each phase.

REQUESTED INFORMATION

Make sure your have performed every step and checked the applicable boxes before submitting your issue. Thank you!

  • Read the Contributing Guide and Policy and the Code of Conduct
  • Searched the problem in issues
  • Searched the problem in discussions
  • Searched the problem in the docs
  • [] Searched the problem in the chat
  • Device used (e.g., Sonoff Basic): _____ WeMoS D1 Pro
  • Tasmota binary firmware version number used: _____ 12.5.0.1
    • Pre-compiled
    • Self-compiled
  • [X Flashing tools used: _____ OTA
  • Provide the output of command: Backlog Template; Module; GPIO 255:
  Configuration output here:
13:05:33.622 CMD: Backlog Template; Module; GPIO 255`
13:05:33.662 MQT: stat/SDM630/RESULT = {"NAME":"WEMOS D1 PRO","GPIO":[0,0,0,0,1984,2016,0,0,0,0,0,0,0,0],"FLAG":0,"BASE":18}
13:05:33.875 MQT: stat/SDM630/RESULT = {"Module":{"0":"WEMOS D1 PRO"}}
13:05:34.081 MQT: stat/SDM630/RESULT = {"GPIO0":{"0":"None"},"GPIO1":{"0":"None"},"GPIO2":{"0":"None"},"GPIO3":{"0":"None"},"GPIO4":{"1984":"SDM630 Tx"},"GPIO5":{"2016":"SDM630 Rx"},"GPIO9":{"0":"None"},"GPIO10":{"0":"None"},"GPIO12":{"0":"None"},"GPIO13":{"0":"None"},"GPIO14":{"0":"None"},"GPIO15":{"0":"None"},"GPIO16":{"0":"None"},"GPIO17":{"0":"None"}}
  • If using rules, provide the output of this command: Backlog Rule1; Rule2; Rule3:
  Rules output here:
13:06:53.459 CMD: Backlog Rule1; Rule2; Rule3
13:06:53.496 MQT: stat/SDM630/RESULT = {"Rule1":{"State":"OFF","Once":"OFF","StopOnError":"OFF","Length":0,"Free":511,"Rules":""}}
13:06:53.724 MQT: stat/SDM630/RESULT = {"Rule2":{"State":"OFF","Once":"OFF","StopOnError":"OFF","Length":0,"Free":511,"Rules":""}}
13:06:53.925 MQT: stat/SDM630/RESULT = {"Rule3":{"State":"OFF","Once":"OFF","StopOnError":"OFF","Length":0,"Free":511,"Rules":""}}
  • Provide the output of this command: Status 0:
  STATUS 0 output here:
13:07:20.362 CMD: status 0
13:07:20.371 MQT: stat/SDM630/STATUS = {"Status":{"Module":0,"DeviceName":"SDM630","FriendlyName":["SDM630"],"Topic":"SDM630","ButtonTopic":"0","Power":0,"PowerOnState":3,"LedState":1,"LedMask":"FFFF","SaveData":0,"SaveState":1,"SwitchTopic":"0","SwitchMode":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"ButtonRetain":0,"SwitchRetain":0,"SensorRetain":0,"PowerRetain":0,"InfoRetain":0,"StateRetain":0,"StatusRetain":0}}
13:07:20.405 MQT: stat/SDM630/STATUS1 = {"StatusPRM":{"Baudrate":115200,"SerialConfig":"8N1","GroupTopic":"tasmotas","OtaUrl":"http://ota.tasmota.com/tasmota/release/tasmota.bin.gz","RestartReason":"Hardware Watchdog","Uptime":"0T00:00:45","StartupUTC":"2023-04-18T12:06:35","Sleep":50,"CfgHolder":4617,"BootCount":495,"BCResetTime":"2021-06-06T16:00:29","SaveCount":532,"SaveAddress":"FB000"}}
13:07:20.441 MQT: stat/SDM630/STATUS2 = {"StatusFWR":{"Version":"12.5.0(sensors)","BuildDateTime":"2023-04-17T08:03:55","Boot":4,"Core":"2_7_4_9","SDK":"2.2.2-dev(38a443e)","CpuFrequency":80,"Hardware":"ESP8266EX","CR":"362/699"}}
13:07:20.460 MQT: stat/SDM630/STATUS3 = {"StatusLOG":{"SerialLog":2,"WebLog":2,"MqttLog":0,"SysLog":0,"LogHost":"","LogPort":514,"SSId":["Kameleon2_MiWiFi2",""],"TelePeriod":300,"Resolution":"558180C0","SetOption":["40028009","2805C80001000600003C5A0A002800000000","00000288","00006000","00004000","00000000"]}}
13:07:20.502 MQT: stat/SDM630/STATUS4 = {"StatusMEM":{"ProgramSize":699,"Free":304,"Heap":14,"ProgramFlashSize":1024,"FlashSize":16384,"FlashChipId":"1840EF","FlashFrequency":40,"FlashMode":"DOUT","Features":["00000809","8F9A8787","0415A005","B7F7BFCF","05DA9BC4","64367CC7","00084052","20000000","54000020","0008C081"],"Drivers":"1,2,3,4,5,6,7,8,9,10,12,14,16,17,20,21,24,29,34,62,65,66","Sensors":"1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,17,18,19,20,21,22,26,31,34,37,39,40,42,43,45,51,52,55,56,58,59,62,64,66,67,74,98,103,105","I2CDriver":"7,8,9,10,11,12,13,14,15,17,18,20,24,29,31,36,41,42,44,46,48,69,76"}}
13:07:20.553 MQT: stat/SDM630/STATUS5 = {"StatusNET":{"Hostname":"SDM630","IPAddress":"192.168.200.10","Gateway":"192.168.200.254","Subnetmask":"255.255.255.0","DNSServer1":"192.168.200.2","DNSServer2":"0.0.0.0","Mac":"84:CC:A8:A6:18:1E","Webserver":2,"HTTP_API":1,"WifiConfig":0,"WifiPower":17.0}}
13:07:20.577 MQT: stat/SDM630/STATUS6 = {"StatusMQT":{"MqttHost":"192.168.200.2","MqttPort":1883,"MqttClientMask":"DVES_%06X","MqttClient":"DVES_A6181E","MqttUser":"DVES_USER","MqttCount":1,"MAX_PACKET_SIZE":1200,"KEEPALIVE":30,"SOCKET_TIMEOUT":4}}
13:07:20.600 MQT: stat/SDM630/STATUS7 = {"StatusTIM":{"UTC":"2023-04-18T12:07:20","Local":"2023-04-18T13:07:20","StartDST":"2023-03-26T02:00:00","EndDST":"2023-10-29T03:00:00","Timezone":"+01:00","Sunrise":"05:53","Sunset":"19:45"}}
13:07:20.618 MQT: stat/SDM630/STATUS9 = {"StatusPTH":{"PowerDelta":[0,0,0],"PowerLow":0,"PowerHigh":0,"VoltageLow":0,"VoltageHigh":0,"CurrentLow":0,"CurrentHigh":0}}
13:07:20.643 MQT: stat/SDM630/STATUS10 = {"StatusSNS":{"Time":"2023-04-18T13:07:20","ENERGY":{"TotalStartTime":"2021-06-06T16:00:29","Total":85.485,"Yesterday":12.352,"Today":0.106,"TodaySumImport":0.000,"TodaySumExport":0.000,"ExportActive":[2468.866,2143.309,1667.846],"Power":[166,-475,-219],"ApparentPower":[505,545,369],"ReactivePower":[-436,-225,-251],"Factor":[0.33,-0.91,-0.68],"Frequency":50,"Voltage":[235,238,236],"Current":[2.150,2.295,1.566]}}}
13:07:20.681 MQT: stat/SDM630/STATUS11 = {"StatusSTS":{"Time":"2023-04-18T13:07:20","Uptime":"0T00:00:45","UptimeSec":45,"Heap":14,"SleepMode":"Dynamic","Sleep":50,"LoadAvg":19,"MqttCount":1,"Wifi":{"AP":1,"SSId":"Kameleon2_MiWiFi2","BSSId":"18:E8:29:A1:00:07","Channel":1,"Mode":"11n","RSSI":84,"Signal":-58,"LinkCount":1,"Downtime":"0T00:00:09"}}}
  • Set weblog to 4 and then, when you experience your issue, provide the output of the Console log:
  Console output here:
13:07:55.492 CMD: weblog 4
13:07:55.498 MQT: stat/SDM630/RESULT = {"WebLog":4}
13:07:55.531 DMP: 01 04 04 46 BF C7 88 8D 7E
13:07:55.533 NRG: EnergyTotal[0] 7377.0825 kWh
13:07:55.535 NRG: EnergyTotal[1] 2926.3408 kWh
13:07:55.537 NRG: EnergyTotal[2] 7964.3130 kWh
13:07:55.755 DMP: 01 04 04 43 6B 70 8B FA 7B
13:07:56.007 DMP: 01 04 04 43 6D EC B8 33 6F
13:07:56.261 DMP: 01 04 04 43 6B D8 40 C4 2C
13:07:56.513 DMP: 01 04 04 40 04 AA 8B 91 42
13:07:56.766 DMP: 01 04 04 40 1A 8A B3 E9 56
13:07:57.018 DMP: 01 04 04 3F D5 54 6F 98 84
13:07:57.270 DMP: 01 04 04 42 EC 9C CE C6 9D
13:07:57.522 DMP: 01 04 04 C3 FC FE 91 86 3C
13:07:57.774 DMP: 01 04 04 C3 77 B2 F4 02 FD
13:07:58.026 DMP: 01 04 04 C3 D9 D2 F4 4B 1C
13:07:58.276 DMP: 01 04 04 C3 5F AB 7A 09 01
13:07:58.530 DMP: 01 04 04 C3 7D 17 0B 19 EF
13:07:58.782 DMP: 01 04 04 3E 83 FB 21 84 AC
13:07:58.985 DMP: 01 04 04 BF 69 A5 4A F4 EB
13:07:59.236 DMP: 01 04 04 BF 32 B4 9A 88 F4
13:07:59.491 DMP: 01 04 04 42 47 8E C1 FB D9
13:07:59.742 DMP: 01 04 04 45 1A 4D DB BA 44
13:07:59.993 DMP: 01 04 04 45 05 F5 06 39 DB
13:08:00.243 DMP: 01 04 04 44 D0 7B 2B 8C 62
13:08:00.494 DMP: 01 04 04 45 E6 88 A9 A9 01
13:08:00.746 DMP: 01 04 04 45 36 E5 74 44 31
13:08:00.996 DMP: 01 04 04 45 F8 E2 81 E7 B9
13:08:01.243 DMP: 01 04 04 46 BF C7 89 4C BE
13:08:01.245 NRG: EnergyTotal[0] 7377.0825 kWh
13:08:01.247 NRG: EnergyTotal[1] 2926.3408 kWh
13:08:01.249 NRG: EnergyTotal[2] 7964.3130 kWh
13:08:01.492 DMP: 01 04 04 43 6B 24 4C 85 29

TO REPRODUCE

Steps to reproduce the behavior:

EXPECTED BEHAVIOUR

A clear and concise description of what you expected to happen.
Read Import values

SCREENSHOTS

If applicable, add screenshots to help explain your problem.

ADDITIONAL CONTEXT

Add any other context about the problem here.

(Please, remember to close the issue when the problem has been addressed)

Hi All,
I my country anybody saying "Better is the enemy of good one!". It's mean if someone working properly - don't touch it!

I decided to upgrade my all Tasmota's network and of course, my Wemos D1 Pro connected to SDM630 stopped provide an information regarding Import Energy at all.

I started with official tasmota-sensors firmware and what I can see:

Screenshot from 2023-04-18 12-30-44

Okay... nothing happened... I had the same situation with Tasmota 8(9).x...

I downloaded newest development source archive and checked 'xnrg_10_sdm630.ino' file which contains section:

//#ifdef SDM630_IMPORT
  0x015A,  //  +   +   +   kWh  Phase 1 import active energy
  0x015C,  //  +   +   +   kWh  Phase 2 import active energy
  0x015E,  //  +   +   +   kWh  Phase 3 import active energy
//#endif  // SDM630_IMPORT

I assume, that's ok... I checked cases into SDM630Every250ms():

        case 19:
          Energy->import_active[0] = value;
          break;

        case 20:
          Energy->import_active[1] = value;
          break;

        case 21:
          Energy->import_active[2] = value;
          break;

look's good as well...

Compiled, flashed... result? the same...
Screenshot from 2023-04-18 12-27-20

No Import Active visible...

I tried to dig deeper... found 'configurations.md' file into 'energy_modbus_config' branch. Very interesting file which contains JSON structure for each data from energy measurement device, I founf SDM630 section and discovered that ImportActive variable is hidden into "User" section:

SDM630 {"Name":"SDM630","Baud":9600,"Config":"8N1","Address":1,"Function":4,"Voltage":[0,2,4],"Current":[6,8,10],"Power":[12,14,16],"ApparentPower":[18,20,22],"ReactivePower":[24,26,28],"Factor":[30,32,34],"Frequency":70,"Total":342,"ExportActive":[352,354,356],**"User":{"R":[346,348,350],"J":"ImportActive","G":"Import Active","U":"kWh","D":24}**}

The question is... how to check data from table "User" under Tasmota console and how to provide these information to MQTT if these are available?

Best Regards,
panciunio

@arendst
Copy link
Owner

arendst commented Apr 18, 2023

SDM630 ImportActive =Energy Total.

If you want more registers you will need to start using the new user configurable modbus driver. See #18413 (comment)

This is also more future proof where dedicated modbus drivers will be removed someday.

@panciunio
Copy link
Author

Hi. Thanks for quick reply,

Yes.. I agree but I want to see Import Active for each phase... Thanks for tip I will write my own modbus .json dedicated to SDM630 but I thought, the section:

SDM630 {"Name":"SDM630","Baud":9600,"Config":"8N1","Address":1,"Function":4,"Voltage":[0,2,4],"Current":[6,8,10],"Power":[12,14,16],"ApparentPower":[18,20,22],"ReactivePower":[24,26,28],"Factor":[30,32,34],"Frequency":70,"Total":342,"ExportActive":[352,354,356],"User":{"R":[346,348,350],"J":"ImportActive","G":"Import Active","U":"kWh","D":24}}

from configurations.md file means the same... but I'm not sure how to inform compiler that should use this particular section.

@arendst
Copy link
Owner

arendst commented Apr 18, 2023

Read the docs: SetOption129 0/1

When you use new modbus driver you do not need to tell the compiler any config data. It's entered at runtime. Again, see link above.

@panciunio
Copy link
Author

panciunio commented Apr 18, 2023

Okay, because I'm using small 8266 device I decided to use 'rule' method. So in case I added Rule3 as follow:

on file#modbus do
	{"Name":"SDM630","Baud":9600,"Config":"8N1","Address":1,"Function":4,"Voltage":[0,2,4],"Current":[6,8,10],"Power":[12,14,16],"ApparentPower":[18,20,22],"ReactivePower":[24,26,28],"Factor":[30,32,34],"Frequency":70,"Total":342,"ExportActive":[346,348,350],"User":{"R":[346,348,350],"J":"ImportActive","G":"Import Active","U":"kWh","D":24}}
endon

This is exactly the same configuration which is into 'configurations.md' file for SDM630
There is part reflecting to ImportActive for each phase and as I understood correctly - should be visible on dashboard ("G": "Import Active"). I'm sorry, I'm trying to follow documentation and do what is required but i still have lack of knowledge... Could you please explain more with more details what I'm doing wrong?

One interesting thing... when I added rule using console, the system added rule wilt escapes chars - it's normal?

[20:27:06] cmnd/SDM630/rule3 on file#modbus do {"Name":"SDM630","Baud":9600,"Config":"8N1","Address":1,"Function":4,"Voltage":[0,2,4],"Current":[6,8,10],"Power":[12,14,16],"ApparentPower":[18,20,22],"ReactivePower":[24,26,28],"Factor":[30,32,34],"Frequency":70,"Total":342,"ExportActive":[352,354,356],"User":{"R":[346,348,350],"J":"ImportActive","G":"Import Active","U":"kWh","D":24}}
endon
19:31:41.421 MQT: stat/SDM630/RESULT = {"Rule3":{"State":"ON","Once":"OFF","StopOnError":"OFF","Length":362,"Free":149,"Rules":"on file#modbus do {\"Name\":\"SDM630\",\"Baud\":9600,\"Config\":\"8N1\",\"Address\":1,\"Function\":4,\"Voltage\":[0,2,4],\"Current\":[6,8,10],\"Power\":[12,14,16],\"ApparentPower\":[18,20,22],\"ReactivePower\":[24,26,28],\"Factor\":[30,32,34],\"Frequency\":70,\"Total\":342,\"ExportActive\":[352,354,356],\"User\":{\"R\":[346,348,350],\"J\":\"ImportActive\",\"G\":\"Import Active\",\"U\":\"kWh\",\"D\":24}} endon"}}

I used official tasmota-sensors v12.5.0 for above

Edit 1:
I missed your comment according: SetOption129 0/1 - It's definitively changing situation:

Screenshot from 2023-04-18 20-50-28

but Energy Total not reflecting real state:

19:52:18.539 NRG: EnergyTotal[0] 7380.4106 kWh
19:52:18.541 NRG: EnergyTotal[1] 2926.9280 kWh
19:52:18.542 NRG: EnergyTotal[2] 7965.1777 kWh

Edit 2:
Solved!

I read deeper according to given by you SetOption129... and I foung another one which is very interesting:

**SetOption72 | Set reference used for total energy 0 = use firmware counter (default)1 = use energy monitor (e.g., PZEM-0xx, SDM120, SDM630, DDS238, DDSU666) hardware counter**
set to 1 solving problem with bad calculation :-)

Screenshot from 2023-04-18 21-06-07

Many thanks for help, I hope it will be good lesson for other!

@jeroenst
Copy link
Contributor

jeroenst commented Dec 1, 2024

Same issue for Shelly 3EM missing Import Active, does SetOption72 also work for shelly 3em?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants