Eastron SDM 630 Energy

Moderators: grovkillen, Stuntteam, TD-er

Message
Author
TD-er
Core team member
Posts: 8756
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Eastron SDM 630 Energy

#51 Post by TD-er » 31 Jul 2023, 17:16

When you switch the combobox in the task configuration for this Eastron task to another serial port, you also should see a Software Serial option.
When this is selected, a few more input fields will become visible allowing you to set a GPIO pin for RX and TX.

I meant the "Checksum (pass/fail)" as this shows at least that some data is being seen.

I'm not sure if the device will send out data without being asked for, so I'm a bit curious to what data the Eastron task is then claiming to receive.
So the fact you're seeing at least some "failed" messages, would suggest the meter is receiving some commands...
Or the ESP is receiving a lot of garbage from somewhere.

About the MAX485's ability to operate on 3V3...
Most MAX485 chips being sold are not the ones made specific for lower voltages. The 3V3 is then slightly below the lowest acceptable voltage. However the chip will probably work just fine on 3V3, but some might not be so tolerant.
Anyway, the 3V3 is below the specs mentioned in the datasheet.

PieterS
Normal user
Posts: 87
Joined: 27 Mar 2018, 17:18
Location: NL

Re: Eastron SDM 630 Energy

#52 Post by PieterS » 31 Jul 2023, 17:38

In the mean time you answered:

I tried to select D1 for RX and D2 for TX.. But even when I try with my keyboard, the cursor skips those choices. :?

Image

Whats wrong that I cannot select the value I need? Sorry, I marked the wrong choice. Should be D1 :oops:

About the MAX485's ability to operate on 3V3...

PostNL mailed me this afternoon that the new nodeMCU's will arrive tomorrow. I suppose they will have 5V on Vin.

frank
Normal user
Posts: 116
Joined: 15 Oct 2016, 20:17
Location: Nederland

Re: Eastron SDM 630 Energy

#53 Post by frank » 31 Jul 2023, 17:44

Dear

I have tried the newer versions of the bin's. Non of them are working for mee. In wat version are we working?

PieterS
Normal user
Posts: 87
Joined: 27 Mar 2018, 17:18
Location: NL

Re: Eastron SDM 630 Energy

#54 Post by PieterS » 31 Jul 2023, 17:53

frank wrote: 31 Jul 2023, 17:44 Dear

I have tried the newer versions of the bin's. Non of them are working for mee. In wat version are we working?
I try at this moment: Build: ESP_Easy_mega_20230728_energy_ESP8266_4M1M Jul 28 2023

Let me know if you succeed

TD-er
Core team member
Posts: 8756
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Eastron SDM 630 Energy

#55 Post by TD-er » 31 Jul 2023, 18:52

PieterS wrote: 31 Jul 2023, 17:38 In the mean time you answered:

I tried to select D1 for RX and D2 for TX.. But even when I try with my keyboard, the cursor skips those choices. :?

Image

Whats wrong that I cannot select the value I need? Sorry, I marked the wrong choice. Should be D1 :oops:
Those options with extra text behind them (like "SDA") are disabled when they are configured elsewhere.
As I mentioned, the GPIO-4 and -5 are by default configured for I2C as SDA/SCL and thus if you want to use them, you need to remove those GPIO configurations first from the I2C configuration on the Hardware tab.

PieterS
Normal user
Posts: 87
Joined: 27 Mar 2018, 17:18
Location: NL

Re: Eastron SDM 630 Energy

#56 Post by PieterS » 31 Jul 2023, 19:53

Ok. I changed to software serial.

Wiring:
DI (groen)-> RX -> D2
RO (wit) -> TX -> D1

Image

This is the log:

Code: Select all

WiFiStatus 3 ESPeasy internal wifi status: Conn. IP Init
254840: EASTRON: (1,4) Voltage (V) Phase 1: nan
256374: EASTRON: (1,4) Voltage (V) Phase 2: nan
259561: EVENT: SDM630#Voltage_L1=nan
259564: EVENT: SDM630#Voltage_L2=nan
259566: EVENT: SDM630#Voltage_L3=nan
259568: EVENT: SDM630#Amperes_L1=nan
269840: EASTRON: (1,4) Voltage (V) Phase 1: nan
271374: EASTRON: (1,4) Voltage (V) Phase 2: nan
274559: EVENT: SDM630#Voltage_L1=nan
274562: EVENT: SDM630#Voltage_L2=nan
274565: EVENT: Clock#Time=Mon,19:35
274567: EVENT: SDM630#Voltage_L3=nan
274568: EVENT: SDM630#Amperes_L1=nan
274620: WD   : Uptime 5 ConnectFailures 0 FreeMem 22128 WiFiStatus 3 ESPeasy internal wifi status: Conn. IP Init
" to clipboard!
I changed D2 en D1 in the software but same results.

Image

:(

frank
Normal user
Posts: 116
Joined: 15 Oct 2016, 20:17
Location: Nederland

Re: Eastron SDM 630 Energy

#57 Post by frank » 31 Jul 2023, 20:05

PieterS wrote: 31 Jul 2023, 17:53
frank wrote: 31 Jul 2023, 17:44 Dear

I have tried the newer versions of the bin's. Non of them are working for mee. In wat version are we working?
I try at this moment: Build: ESP_Easy_mega_20230728_energy_ESP8266_4M1M Jul 28 2023

Let me know if you succeed
I have that one installed. But when i activate the task for the meter it chrashes. Even when the meter is not connected

frank
Normal user
Posts: 116
Joined: 15 Oct 2016, 20:17
Location: Nederland

Re: Eastron SDM 630 Energy

#58 Post by frank » 31 Jul 2023, 20:20

frank wrote: 31 Jul 2023, 20:05
PieterS wrote: 31 Jul 2023, 17:53
frank wrote: 31 Jul 2023, 17:44 Dear

I have tried the newer versions of the bin's. Non of them are working for mee. In wat version are we working?
I try at this moment: Build: ESP_Easy_mega_20230728_energy_ESP8266_4M1M Jul 28 2023

Let me know if you succeed
I have that one installed. But when i activate the task for the meter it chrashes. Even when the meter is not connected
Tried the setup with the SW serial. Now it doesn't crash but the same result. Know measurements.

I was to happy too soon. Load went to 100% and the esp crashes

PieterS
Normal user
Posts: 87
Joined: 27 Mar 2018, 17:18
Location: NL

Re: Eastron SDM 630 Energy

#59 Post by PieterS » 31 Jul 2023, 21:52

I was to happy too soon. Load went to 100% and the esp crashes

Different experience. No crashes.

Image

But no results from measurements... :cry:

TD-er
Core team member
Posts: 8756
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Eastron SDM 630 Energy

#60 Post by TD-er » 31 Jul 2023, 23:29

OK, I guess something either is wrong with the plugin, or we're missing something small which is hard to diagnose remote like this.

I think I have to recreate a setup here.
Only thing is, I don't have the 630, but only the 220 (I think...)
I will try to make such a setup tomorrow.

N.B. I have also ordered a "scheidingstrafo" so I can work on mains voltage without risking damage to my PC or myself.
Hopefully that one will be delivered tomorrow.

PieterS
Normal user
Posts: 87
Joined: 27 Mar 2018, 17:18
Location: NL

Re: Eastron SDM 630 Energy

#61 Post by PieterS » 01 Aug 2023, 11:00

Sounds great! If I can test something, let me know.

At the moment my alternative to read the meter is a Python-script on a Pi 4, developed for the older version of the SDM630 and a 1F model SDM120. I changed the value of registers according to the documentation of the SDM630 from https://www.google.com/url?sa=t&rct=j&q ... i=89978449. That works quite ok.The real part starts at page 29..

But I am not satisfied about the way Domoticz displays the data. That's the reason to go for ESP Easy.

Tnx for all your effort, good luck and looking forward to your results.
mvg
Pieter

frank
Normal user
Posts: 116
Joined: 15 Oct 2016, 20:17
Location: Nederland

Re: Eastron SDM 630 Energy

#62 Post by frank » 10 Aug 2023, 21:36

Bij mij werkt de SDM630 nu :D :D :D :D :D :D

bedankt TD-er voor je werk :D :D

PieterS
Normal user
Posts: 87
Joined: 27 Mar 2018, 17:18
Location: NL

Re: Eastron SDM 630 Energy

#63 Post by PieterS » 11 Aug 2023, 09:04

frank wrote: 10 Aug 2023, 21:36 Bij mij werkt de SDM630 nu :D :D :D :D :D :D

bedankt TD-er voor je werk :D :D
Mooi nieuws! Fijn!

Zou je kunnen uitleggen hoe je dat voor elkaar hebt gekregen? Ik zou daar zeer mee geholpen zijn.

Met dank en vriendelijke groet

Pieter

TD-er
Core team member
Posts: 8756
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Eastron SDM 630 Energy

#64 Post by TD-er » 11 Aug 2023, 15:18

Well... if you have a moment :)

In the old code, the modbus call was made and the code was waiting for a reply.
This was done for all 4 registers needed per Eastron task and thus could take upto 2.5 seconds (!!) per call to PLUGIN_READ (run at "Interval" nr of seconds)
This was 'blocking' code, like nothing else could be done on the ESP during this.
Things would run behind schedule, buffers may fill up as they aren't dealt with and things may timeout.

So now I made this all asynchronous.
Every Eastron task will add its requested registers (+ modbus address) to a list and this list is queried 10x per second.
If you have your module set to 9600 baud, you can get an answer from the module in just under 100 msec, so essentially upto 10 registers per second can be read.
In every PLUGIN_TEN_PER_SECOND call this is being done:
- If not waiting: Send out request for register in the first entry of the list.
- else: See if answer is ready, if not, you're done for now.
- If there is an answer, pop the first entry from the list and push it to the back of the list.
- Send out request for register in the first entry of the list.

This way the call to PLUGIN_TEN_PER_SECOND only takes a few msec and thus does not block execution of the rest of the code.

When you need to change a setting on the module, this list handling must be stopped, so that's why you need to call "Eastron,pause" first.

The PLUGIN_READ (which does send out events and sends data to the controllers) just picks the last read registers of its task and sends them.

Since we do read the registers much more frequently, the logged peaks when using 'stats' is updated every time registers are being read. So the peak values may be values you have never seen in the data sent to the controllers.

PieterS
Normal user
Posts: 87
Joined: 27 Mar 2018, 17:18
Location: NL

Re: Eastron SDM 630 Energy

#65 Post by PieterS » 11 Aug 2023, 16:15

Of course I have time! Thanks for all your time, effort and explanation.

This morning I read a bit about this problem. I tried to download your latest or best beta-version of the energy-plugin in https://github.com/letscontrolit/ESPEasy/issues/4745. And from your home-site.. But I was not sure about how to connect the wires between MAX485 to RS485 and the ESP8266.. So I guessed..

I made progress... Now I get a value. But too low. And checksum is bad.. My meter is up and connected to the MAX485.
This are my settings:

Image
имг

Image
имг

Oeps: In a screenshot I discover the wiring you used... I will give that a try! :oops: :oops:

I realise that maybe I am bit early to test. But I was hopefull because @Frank was happy with your solution.

Wondering what could be the cause. Maybe wrong wiring? Different version of the SDM630. I use a Modbus V3.

I hope you can me info where to load the right software and how to configure it.

TD-er
Core team member
Posts: 8756
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Eastron SDM 630 Energy

#66 Post by TD-er » 11 Aug 2023, 16:40

Have you looked at the documentation?

https://espeasy.readthedocs.io/en/lates ... #p078-page

Are both DE/RE pins connected to GPIO-12?
RX connected to RO?
TX connected to DI?

Is the baud rate correct? And Modbus address?

Did you disable "ESPEasy Serial Console" on the tools->Advanced page?

PieterS
Normal user
Posts: 87
Joined: 27 Mar 2018, 17:18
Location: NL

Re: Eastron SDM 630 Energy

#67 Post by PieterS » 11 Aug 2023, 18:06

Thanks Gijs!

To be honest! I made a mistake :o . Swapped TX and RX :oops:

Thank you very much for your suggestion! That made the difference! Very glad with it.

Image

Now configuring the other tasks. Very glad with it.

Best regards

TD-er
Core team member
Posts: 8756
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Eastron SDM 630 Energy

#68 Post by TD-er » 11 Aug 2023, 18:17

PieterS wrote: 11 Aug 2023, 18:06 [...]
To be honest! I made a mistake :o . Swapped TX and RX :oops:
[...]
Why did you think I did mention it so explicitly?
Happened to me also quite a few more times than I would dare to admit :)

PieterS
Normal user
Posts: 87
Joined: 27 Mar 2018, 17:18
Location: NL

Re: Eastron SDM 630 Energy

#69 Post by PieterS » 11 Aug 2023, 21:31

That's why there is a market for a "scheidingstrafo". :mrgreen: For the better feeling.

TD-er
Core team member
Posts: 8756
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Eastron SDM 630 Energy

#70 Post by TD-er » 11 Aug 2023, 21:35

PieterS wrote: 11 Aug 2023, 21:31 That's why there is a market for a "scheidingstrafo". :mrgreen: For the better feeling.
Yep, I have ordered this one a week ago: https://www.amazon.de/gp/product/B07JM5 ... UTF8&psc=1
Very very nice unit.
It even has a soft start, so you're not likely to trigger any leak current protection.
But I guess that will be less likely at 500VA, still nice to have feature.

PieterS
Normal user
Posts: 87
Joined: 27 Mar 2018, 17:18
Location: NL

Re: Eastron SDM 630 Energy

#71 Post by PieterS » 13 Aug 2023, 16:30

Tested the software by loading the car and monitoring the meter.

Image

A minor value like the sum of all current stays empty. Not that important

Image

Thanks for all your good work

TD-er
Core team member
Posts: 8756
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Eastron SDM 630 Energy

#72 Post by TD-er » 13 Aug 2023, 16:33

You have way too many read errors on the serial bus.
Have you tried to set it to SW Serial using the same GPIO pins as I also suggested in the other topic?

PieterS
Normal user
Posts: 87
Joined: 27 Mar 2018, 17:18
Location: NL

Re: Eastron SDM 630 Energy

#73 Post by PieterS » 13 Aug 2023, 17:19

Sorry Gijs, not yet. Too many steps together for me. I will try that in a while.

Yes: chesum (pass/fail) is bad.. :o

And let you know it here. Of course.

PieterS
Normal user
Posts: 87
Joined: 27 Mar 2018, 17:18
Location: NL

Re: Eastron SDM 630 Energy

#74 Post by PieterS » 14 Aug 2023, 17:24

Gijs,

You pointed out the bad checksum values ​​to me. And asked to change the Serial Port to SW Serial.

I am not an expert. So I think about what and how to change. But maybe I forgot something or made a mistake. Sorry for that.

I Enabled Serial Port Console:
Image

I changed every task:
Image

This is the wiring:
Image

This are the results.. :cry:

frank
Normal user
Posts: 116
Joined: 15 Oct 2016, 20:17
Location: Nederland

Re: Eastron SDM 630 Energy

#75 Post by frank » 14 Aug 2023, 18:05

which version of espeasy are you using?

User avatar
Ath
Normal user
Posts: 3522
Joined: 10 Jun 2018, 12:06
Location: NL

Re: Eastron SDM 630 Energy

#76 Post by Ath » 14 Aug 2023, 18:28

PieterS wrote: 14 Aug 2023, 17:24 I Enabled Serial Port Console
...
This are the results.. :cry:
1) Serial console should be disabled when using the port/pins for serial communication on a device/task. (Uncheck that checkbox, please)

2) No results visible here...?
/Ton (PayPal.me)

PieterS
Normal user
Posts: 87
Joined: 27 Mar 2018, 17:18
Location: NL

Re: Eastron SDM 630 Energy

#77 Post by PieterS » 14 Aug 2023, 20:00

I unchecked the checkbox of Serial console.

This are the results..
The meter is on. At least Voltage should be there..

Image

The ESP reacts slow in this config.

PieterS
Normal user
Posts: 87
Joined: 27 Mar 2018, 17:18
Location: NL

Re: Eastron SDM 630 Energy

#78 Post by PieterS » 14 Aug 2023, 20:01

frank wrote: 14 Aug 2023, 18:05 which version of espeasy are you using?
Build: ESP_Easy_mega_20230808_energy_ESP8266_4M1M Aug 8 2023

frank
Normal user
Posts: 116
Joined: 15 Oct 2016, 20:17
Location: Nederland

Re: Eastron SDM 630 Energy

#79 Post by frank » 14 Aug 2023, 20:49


User avatar
Ath
Normal user
Posts: 3522
Joined: 10 Jun 2018, 12:06
Location: NL

Re: Eastron SDM 630 Energy

#80 Post by Ath » 14 Aug 2023, 20:53

PieterS wrote: 14 Aug 2023, 20:01
frank wrote: 14 Aug 2023, 18:05 which version of espeasy are you using?
Build: ESP_Easy_mega_20230808_energy_ESP8266_4M1M Aug 8 2023
frank wrote: 14 Aug 2023, 20:49 i have this one and it works

https://github.com/letscontrolit/ESPEas ... 5728205521
Both builds are quite outdated, please get a more recent version, like the current mega branch build (today): https://github.com/letscontrolit/ESPEas ... 5850022962
/Ton (PayPal.me)

frank
Normal user
Posts: 116
Joined: 15 Oct 2016, 20:17
Location: Nederland

Re: Eastron SDM 630 Energy

#81 Post by frank » 14 Aug 2023, 21:03

i just tried this one and that also works

https://github.com/letscontrolit/ESPEas ... 5846377605

TD-er
Core team member
Posts: 8756
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Eastron SDM 630 Energy

#82 Post by TD-er » 14 Aug 2023, 22:27

OK, since you have the pins on the ESP quite accessible via screw terminals, can you try other pins (using SW serial, or else you can't change the pins)

Let's first disable all other tasks for Eastron, as you have at least on task 3 the RX and TX pins swapped in the config.
So first let's see how it will work with 1 task and if that's working, we should start looking at the other tasks.

PieterS
Normal user
Posts: 87
Joined: 27 Mar 2018, 17:18
Location: NL

Re: Eastron SDM 630 Energy

#83 Post by PieterS » 15 Aug 2023, 08:23

Thanks guys for all hints. I will pick this hobby up later in next weekend. Leaving for other hobby.
Let you know the results.

PieterS
Normal user
Posts: 87
Joined: 27 Mar 2018, 17:18
Location: NL

Re: Eastron SDM 630 Energy

#84 Post by PieterS » 21 Aug 2023, 11:59

TD-er wrote: 14 Aug 2023, 22:27 OK, since you have the pins on the ESP quite accessible via screw terminals, can you try other pins (using SW serial, or else you can't change the pins)

Let's first disable all other tasks for Eastron, as you have at least on task 3 the RX and TX pins swapped in the config.
So first let's see how it will work with 1 task and if that's working, we should start looking at the other tasks.
I erased and flashed another ESP8266 with the latest firmware (20230820_energy) and configured only 1 task with SW Serial.

Image
Image
Image

ESP RX D9 - wit - MAX485 TX (RO)
ESP TX D10 - groen - MAX485 RX (DI)
ESP D5 - geel - MAX485 RE/DE

Image
Image

I get no communication, no data.

So I went back to the HW-settings. It is better than nothing.

TD-er
Core team member
Posts: 8756
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Eastron SDM 630 Energy

#85 Post by TD-er » 21 Aug 2023, 16:59

Hmm that's really strange.
Is it possible the A/B might have been swapped between the MAX485 board and the Eastron?
Not sure if that will actually make a difference between SW/HW serial, but I really can't explain the issues you're seeing, so I start to make wild guesses.

PieterS
Normal user
Posts: 87
Joined: 27 Mar 2018, 17:18
Location: NL

Re: Eastron SDM 630 Energy

#86 Post by PieterS » 21 Aug 2023, 17:38

TD-er wrote: 21 Aug 2023, 16:59 Hmm that's really strange.
Is it possible the A/B might have been swapped between the MAX485 board and the Eastron?
I have 2 MCU's flashed with the same firmware:
One with HW serial config and one with SW serial config.
I swapped them on the screw-terminal board. I did not swap any wiring.
As all wiring is oke for HW serial, it should be correct for SW config.
Is it possible the A/B might have been swapped between the MAX485 board and the Eastron?
Not sure if that will actually make a difference between SW/HW serial, but I really can't explain the issues you're seeing, so I start to make wild guesses.
As I was still thinking about the many errors/fails, I did a test earlier this afternoon: with the HW serial config board, I swapped the A/B wiring between the meter and the MAX485. That was clear right away: no data at all.

So if you really want me to do that test for the SW serial config version: just let me know.

Another wild guess:
Could interference from the "high voltage" cables be a reason for this bad behaviour? The A/B-wiring has no shielding.

TD-er
Core team member
Posts: 8756
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Eastron SDM 630 Energy

#87 Post by TD-er » 21 Aug 2023, 21:12

I don't expect, the high voltage lines may interfere here.
But when in doubt, you could try to twist the wires.
So the A and B wires twisted around each other.

RS485 is a differential signal, so any noise picked up on one line should have the opposite effect on the other wire and thus cancel out.
But twisting the wires should not make things worse.

And you can also connect the GND from the ESP to the GND pin of the Eastron (GND next to the A/B pins, just to be sure to not connect it to the mains earth pin)

PieterS
Normal user
Posts: 87
Joined: 27 Mar 2018, 17:18
Location: NL

Re: Eastron SDM 630 Energy

#88 Post by PieterS » 27 Aug 2023, 19:28

Hi all, especially Gijs,

Yesterday I mounted the ESP and MAX485 TTL to RS485 on connectors to a circuitboard and build that in a case. All close to the meter. This afternoon I looked into ESPeasy and I was surprised that the readings of modbus were excellent!

Image

Image

I changed the negative values of current and power positive by the ABS()-function in a rule. :D I tested the new config by loading the EV and there was no delay in presenting values. The interface feels quick! So I am very happy with the results!

I want to thank Gijs (and other members) for all your effort to make this project a big succes!

TD-er
Core team member
Posts: 8756
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Eastron SDM 630 Energy

#89 Post by TD-er » 27 Aug 2023, 22:40

Ah good to see it is finally working.
So I assume it was some kind of wire picking up noise?

Well we'll never know, but it is working now, so who cares :)

frank
Normal user
Posts: 116
Joined: 15 Oct 2016, 20:17
Location: Nederland

Re: Eastron SDM 630 Energy

#90 Post by frank » 04 Nov 2023, 13:36

This is working and that is great.

Does annyone has anny thoughts of how to get the info into Domoticz?

User avatar
Ath
Normal user
Posts: 3522
Joined: 10 Jun 2018, 12:06
Location: NL

Re: Eastron SDM 630 Energy

#91 Post by Ath » 04 Nov 2023, 13:57

frank wrote: 04 Nov 2023, 13:36 This is working and that is great.

Does annyone has anny thoughts of how to get the info into Domoticz?
On the ESPEasy side you can configure either a Domoticz HTTP Controller or Domoticz MQTT Controller (that also needs a MQTT broker at the Domoticz side, usually Mosquitto), but that sounds more like a Domoticz question, not an ESPEasy question?
The last screenshot above shows the Ctr (IDX) column, where Domoticz IDX values are configured for the Domoticz Virtual sensors, that receive the values from ESPEasy.
/Ton (PayPal.me)

frank
Normal user
Posts: 116
Joined: 15 Oct 2016, 20:17
Location: Nederland

Re: Eastron SDM 630 Energy

#92 Post by frank » 04 Nov 2023, 14:12

I get the info into domoticz. But making it workable in domoticz is a challange

User avatar
Ath
Normal user
Posts: 3522
Joined: 10 Jun 2018, 12:06
Location: NL

Re: Eastron SDM 630 Energy

#93 Post by Ath » 04 Nov 2023, 14:50

frank wrote: 04 Nov 2023, 14:12 I get the info into domoticz. But making it workable in domoticz is a challange
Ah, yes, you'll have to work with the scripting in Domoticz to do some fancy stuff, that can indeed be challenging :lol:
/Ton (PayPal.me)

frank
Normal user
Posts: 116
Joined: 15 Oct 2016, 20:17
Location: Nederland

Re: Eastron SDM 630 Energy

#94 Post by frank » 04 Nov 2023, 17:27

Ath wrote: 04 Nov 2023, 14:50
frank wrote: 04 Nov 2023, 14:12 I get the info into domoticz. But making it workable in domoticz is a challange
Ah, yes, you'll have to work with the scripting in Domoticz to do some fancy stuff, that can indeed be challenging :lol:
Correct en i hoped someone already made it

PieterS
Normal user
Posts: 87
Joined: 27 Mar 2018, 17:18
Location: NL

Re: Eastron SDM 630 Energy

#95 Post by PieterS » 06 Nov 2023, 15:57

You mean something like this?

Code: Select all

On SDM630_L1#All Do  // Receives 4 arguments, 1st one is already sent to the controller, so can be ignored
  Publish,domoticz/in,'{"command":"udevice","idx":2282,"nvalue":0,"svalue":"%eventvalue2%"}' // Current L1
  Let,1,abs(%eventvalue3%)
  Let,5,abs(%eventvalue4%)
//  LogEntry, 'Abs of [%eventvalue3%] = [var#1]' 
  Publish,domoticz/in,'{"command":"udevice","idx":2286,"nvalue":0,"svalue":"[var#1]"}'  //Power L1
  Publish,domoticz/in,'{"command":"udevice","idx":2289,"nvalue":0,"svalue":"[var#5]"}'  //Total Active Power
Endon

On SDM630_L2#All Do  // Receives 4 arguments, 1st one is already sent to the controller, so can be ignored
  Publish,domoticz/in,'{"command":"udevice","idx":2283,"nvalue":0,"svalue":"%eventvalue2%"}' // Current L2
  Let,2,abs(%eventvalue3%)
  Publish,domoticz/in,'{"command":"udevice","idx":2287,"nvalue":0,"svalue":"[var#2]"}'  //Power L2//
  Publish,domoticz/in,'{"command":"udevice","idx":2285,"nvalue":0,"svalue":"%eventvalue4%"}'  //Total Amps van 3 fases
Endon

On SDM630_L3#All Do  // Receives 4 arguments, 1st one is already sent to the controller, so can be ignored
  Publish,domoticz/in,'{"command":"udevice","idx":2284,"nvalue":0,"svalue":"%eventvalue2%"}' // Current L3
  Let,3,abs(%eventvalue3%)
  Publish,domoticz/in,'{"command":"udevice","idx":2288,"nvalue":0,"svalue":"[var#3]"}'  //Power L3
  Let,4,abs([SDM630_L1#W])
  Let,5,([SDM630_L3#kWh]*1000)
//    Publish,domoticz/in,'{"command":"udevice","idx":76,"nvalue":0,"svalue":"[var#4];[SDM630_L3#kWh]"}'  //Total Power;Total kW
   Publish,domoticz/in,'{"command":"udevice","idx":2294,"nvalue":0,"svalue":"[var#5]"}'  //Total Power;Total kW was IDX2290
      Publish,domoticz/in,'{"command":"udevice","idx":2290,"nvalue":0,"svalue":"[var#4];[var#5]"}'  //Total Power;Total kW was IDX2290
//   Publish,domoticz/in,'{"command":"udevice","idx":2294,"nvalue":0,"svalue":"[SDM630_L3#kWh]"}'  //Total Power;Total kW 
   Publish,domoticz/in,'{"command":"udevice","idx":2292,"nvalue":0,"svalue":"[SDM630_L3#kWh]"}'  //Total Power;Total kW 
Endon
To clearify why I use the abs(): that's because the meter is not feed in on top... So I got negative values.

Hope, this will help you forward? Otherwise, let me know!

User avatar
Ath
Normal user
Posts: 3522
Joined: 10 Jun 2018, 12:06
Location: NL

Re: Eastron SDM 630 Energy

#96 Post by Ath » 06 Nov 2023, 16:06

PieterS wrote: 06 Nov 2023, 15:57 To clearify why I use the abs(): that's because the meter is not feed in on top... So I got negative values.
Shouldn't you multiply by -1 then, to just invert the value, in case current starts flowing in the other direction?
/Ton (PayPal.me)

PieterS
Normal user
Posts: 87
Joined: 27 Mar 2018, 17:18
Location: NL

Re: Eastron SDM 630 Energy

#97 Post by PieterS » 06 Nov 2023, 16:37

Both solutions do their job for me. Like several nice roads to Rome :D Through France for example :!:

frank
Normal user
Posts: 116
Joined: 15 Oct 2016, 20:17
Location: Nederland

Re: Eastron SDM 630 Energy

#98 Post by frank » 06 Nov 2023, 18:26

Looks like that it is wat i am looking for.

To customize i have to change the following:

SDM630_L1
idx":2282,"
"%eventvalue2%"

Is this : domoticz/in to send it to mqtt in Domoticz?

TD-er
Core team member
Posts: 8756
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Eastron SDM 630 Energy

#99 Post by TD-er » 06 Nov 2023, 21:43

Yep the topic to publish to is "domoticz/in"
N.B. Make sure not to use a leading / in the topic.

Also you still need to have a MQTT controller configured as the publish command uses the same connection to the MQTT broker as setup by the MQTT controller.

frank
Normal user
Posts: 116
Joined: 15 Oct 2016, 20:17
Location: Nederland

Re: Eastron SDM 630 Energy

#100 Post by frank » 19 Nov 2023, 16:02

thx for the help. I got it working now :D :D :D

Post Reply

Who is online

Users browsing this forum: No registered users and 32 guests