Page 1 of 1

Eastron SDM 630 Energy meter ESPeasy

Posted: Saturday 04 November 2023 17:49
by Frank
Can some one help me with this. I am a rookie with scripts not with Domoticz.

I have an SDM 630 energy meter working with ESP easy to get the data to domoticz. But the information gets to Domoticz per IDX in a batch of four values or in a batch of all values on one IDX. To work with the in values in domoticz the have to be split in singel values. Is it possible to do this with a script? And how should a script look like?

This is how the data looks: 0, 0.00;0.00;0.00;1.00. The first zero is not a value behind the , are the values.

Re: Eastron SDM 630 Energy meter ESPeasy

Posted: Saturday 04 November 2023 19:04
by waltervl
Perhaps it should be connected to a P1 smart meter device that needs multiple inputs. https://www.domoticz.com/wiki/Domoticz_ ... mart_meter

Is there more documentation about your setup with espeasy?

Re: Eastron SDM 630 Energy meter ESPeasy

Posted: Saturday 04 November 2023 20:57
by Frank
I don't know wich info you want. This sight tells a lot about the hardware.
https://www.letscontrolit.com/forum/vie ... 2ed58d9f25

This is the wiki for ESPeasy
https://www.letscontrolit.com/wiki/index.php/Main_Page

Re: Eastron SDM 630 Energy meter ESPeasy

Posted: Sunday 05 November 2023 0:13
by waltervl
Yes it looks like scripting in Domoticz or using rules in espeasy to send the correct data.

There are also python plugins for this Eastron meter but then you have to connect your Domoticz server directly to your Pi.

Re: Eastron SDM 630 Energy meter ESPeasy

Posted: Sunday 05 November 2023 11:22
by Frank
waltervl wrote: Sunday 05 November 2023 0:13 Yes it looks like scripting in Domoticz or using rules in espeasy to send the correct data.

There are also python plugins for this Eastron meter but then you have to connect your Domoticz server directly to your Pi.
That was my thoughs to. But i have no idea ho to do that

Re: Eastron SDM 630 Energy meter ESPeasy

Posted: Sunday 05 November 2023 12:51
by Toulon7559
Reading the textstring in Domoticz as in your first message it looks like the output from ESPEasy is going into an svalue of Domoticz, related to a virtual device of type 'Custom Sensor'. Correct?
IMHO then the simplest approach is a dissecting of the svalue-string with a script written in Python or in Lua/dzVents.

Data-extraction for such svalue-string with 4 fields is in Lua-script similar to

Code: Select all

sValue1, sValue2, sValue3, sValue4 = otherdevices_svalues[VirtualDevice]:match("([^;]+);([^;]+);([^;]+);([^;]+)")
Conversion for sValue1 from string to number is

Code: Select all

Value1 = tonumber(sValue1)
Obviously for sValuex and for VirtualDevice you fill-in the applicable names for your SDM' virtual device.
After that extraction you have per segment the numeric data available for your own applications.

Re: Eastron SDM 630 Energy meter ESPeasy

Posted: Monday 06 November 2023 16:01
by PieterS
Can some one help me with this. I am a rookie with scripts not with Domoticz.

I have an SDM 630 energy meter working with ESP easy to get the data to domoticz. But the information gets to Domoticz per IDX in a batch of four values or in a batch of all values on one IDX. To work with the in values in domoticz the have to be split in singel values. Is it possible to do this with a script? And how should a script look like?

This is how the data looks: 0, 0.00;0.00;0.00;1.00. The first zero is not a value behind the , are the values.
Your problem is not really clear to me. What is your question, or purpose?

I own the same meter and send the data with seperate messages to seperate sensors in Domoticz. This is done by a rule in the ESP-software.

In ESPeasy I created for every fase a single task with Voltage, Current, Power and the fourth value is different for each task. (Active Power, Total Amps, Total Power)

In Domoticz I created new virtual sensors for every value that is created in ESPeasy. You need the IDX in the rules.

Image

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%)
   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":2294,"nvalue":0,"svalue":"[var#5]"}'  //Total Power;Total kW
   Publish,domoticz/in,'{"command":"udevice","idx":2290,"nvalue":0,"svalue":"[var#4];[var#5]"}'  //Total Power;Total kW
   Publish,domoticz/in,'{"command":"udevice","idx":2292,"nvalue":0,"svalue":"[SDM630_L3#kWh]"}'  //Total Power;Total kW 
Endon
The lines with Let,1,abs(%eventvalue3%) are only necessary in my case because I did not connect the meter on the correct way. The meter needs the feed-in on top. But my wiring in the breakercase was too short for that... So I got negative values..

Or have a look at this link: https://www.letscontrolit.com/forum/vie ... 773#p66773

Re: Eastron SDM 630 Energy meter ESPeasy

Posted: Monday 06 November 2023 17:59
by Frank
I think this is wat i am looking for. One quistion. I see that u use "domoticz/in". Do you use mqtt in domoticz for this?

Re: Eastron SDM 630 Energy meter ESPeasy

Posted: Monday 06 November 2023 18:49
by PieterS
Frank wrote: Monday 06 November 2023 17:59 I think this is wat i am looking for. One quistion. I see that u use "domoticz/in". Do you use mqtt in domoticz for this?
Yes!

Re: Eastron SDM 630 Energy meter ESPeasy

Posted: Monday 06 November 2023 23:04
by waltervl
If you do not use mqtt you can change the rule so it would send Domoticz Http API calls, they are very similar to the mqtt payload messages.

Code: Select all

{"command":"udevice","idx":2282,"nvalue":0,"svalue":"%eventvalue2%"}' 
Would be

Code: Select all

/json.htm?type=command&param=udevice&idx=2282&nvalue=0&svalue=%eventvalue2%

Re: Eastron SDM 630 Energy meter ESPeasy

Posted: Tuesday 07 November 2023 21:13
by Frank
thx for the help

i don't have ever used mqtt. In the line i have to change the following to make it fit my setup?

idx=2282
eventvalue2

/json.htm?type=command&param=udevice&idx=2282&nvalue=0&svalue=%eventvalue2%

should i put the ip adres of domoticz somewhere?

Re: Eastron SDM 630 Energy meter ESPeasy

Posted: Tuesday 07 November 2023 23:08
by waltervl
Read this espeasy documentation about rules and use the sendtohttp function. There are also examples for domoticz in it

https://espeasy.readthedocs.io/en/lates ... Rules.html