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.
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