-
Evening all; I need some guidance if possible. I have an solar hybrid inverter that uses modbus to talk to an eastron SDM120 energy meter. The solar inverter is already in communication with the meter very rapidly & the meter is responding with regular energy stats. I would like to use the SDMx20 driver/variables in tasmota to read that power data, but without requesting it from the meter first (i.e. to sniff the data already on the bus) I have already tried bi-directional SDMx20 driver coms with the energy meter from 2 devices at the same time (e.g. from the inverter & from tasmota) but while it appears to work at first, if the inverter doesnt get a timely response from the meter when it is dealing with a large load or load shedding, it starts to misbehave (e.g. not ramping power up & down properly). I have tried the bi-directional route with multiple 8266 boards & an ESP32 (so see if it was a board speed problem), but what I really need is not to put extra load on the meter at all, as it is already giving out what i need, but tasmota won’t acknowledge it RX only. I assume there has to be somewhere in the code that insists on send to receive, is anyone able to point me in the right direction ? p.s. i have spent several hours searching the web before posting, but havent found anyone trying to get tasmota to co-exist with an existing meter setup read-only. Thanks in advance Paul C |
Beta Was this translation helpful? Give feedback.
Replies: 9 comments 91 replies
-
Hi If there isn't all expected mesasge than you are in trouble as Tasmota driver is coded to be the only master and not sharing the bus (and may be the inverter too as per what you say) |
Beta Was this translation helpful? Give feedback.
-
hi barbudor, thanks for the info. if I disconnect the TX the SDM data decoding stops and the console throws SDM error 7 & SDM error 9 every time it received a modbus packet. from looking at the modbus data on the inverter, it appears to carry all the same parameters, but there must obviously be something different, unless it is the hardcoded master/slave as you suspect (yes the inverter is likely set to be the master) is there a way to change the master/slave in the SDM driver? |
Beta Was this translation helpful? Give feedback.
-
We need a "Man-in-the-Middle" Modbus feature :-) |
Beta Was this translation helpful? Give feedback.
-
just an update, ive been working with the raw mode data & i think ive figured out what the Inverter is asking the meter. (it only ever appears to send 2 modbus requests to the meter) request no 1 - this is the request SMI was able to decode previously (but was unstable). this is just a float for a single register pair & gives a total KWH figure. request - 01 04 01 56 00 02 90 27 request no 2 is much more complex & this appears to be asking for 76 registers consecutively from register 1 (basically a complete dump from the meter in a single response) request 01 04 00 00 00 4c f1 ff i had to recompile tasmota with much larger serial buffers to stop it truncating/corrupting. which is also why i suspect tasmota was crashing with the SMI decoder when trying to decode this data. now that i have this data, i dont really know what do do with it, can SMI decode this many registers in a single response?. ideas are welcome, unless like you say we are looking at external decoding & not using SMI preview of decoded response. |
Beta Was this translation helpful? Give feedback.
-
phew, just before my gitpod timed out.. working, well done reading inverter<->meter modbus data & querying 8x pylontech batteries |
Beta Was this translation helpful? Give feedback.
-
pr done, waiting for merge |
Beta Was this translation helpful? Give feedback.
-
for completeness (if anyone else finds this thread), here is an overview of my project Many thanks to gemu for all the help & adding a new SML feature to allow the 2 UARTs to co-exist on 2 different serial drivers. & barbudor for earlier guidance (I wouldn’t have got this far without them, given that ive used tasmota scripting for all of a week!!) comments welcome ;-) Objectives
Some constraints/comments -I wanted to avoid monitoring the pylontech Canbus for similar reasons (It already makes me nervous having all that lithium battery in house). The pylontech US3000C console port seemed to be the logical choice & would avoid any undesired issues between the inverter & master battery over canbus. -Each pylon battery is queried sequentially (all via the master battery cable) by specifying its power index (1-8 in my case). the script then detects which battery has responded & fills an array with the data acordingly. -Note that my batteries are stacked vertically (short edge), 4 above 4 in a custom-made rack. Batteries 1-4 are above batteries 5-8, hence you will note an average 3 degree higher temperature in batteries 1-4. -I have only pasted the code to sniff the SDM120, read pylon battery data & a basic websend trigger, as the rest of the logic/outputs will be unique to my implementation. Hardware compile includes script
label=sb(rstr 0 13) ;get value ;print decoded data.... %label% %val% %val2% ;if we have the power header switch label case "Voltage " case "Current " case "Temperature " case "Coulomb " case "Basic Status " case "Soh. Status " ends
; run every 4 seconds ;call a battery on each pass ;sum up current reading as we want total not average } ;state engine to calc export/import duration if time1>130 if time1>160 ends
;Grid Watts {m}%sml[3]%
State {m}%sta% Stack {m}%2volt[-2]%V | %2cur%A | %1pow%W | %temp[-2]%C | %0coul[-2]%%%Bat1{m}%2volt[1]%V | %2curr[1]%A | %1temp[1]%C | %0coul[1]%%% | %is1[1]% | %is2[1]% ;smart meter interface (READ ONLY, RX pin connected only)
|
Beta Was this translation helpful? Give feedback.
-
@satmanuk2 Related #18618 Did not have time yet to compile/test this branch. |
Beta Was this translation helpful? Give feedback.
-
Thank you for your prework here. I extended the script for the usage of Eastron sdm630 meter (three-phase) which is polled by a Solis hybrid inverter.
I struggeled a lot to debug and to get this to work, so here some hints:
|
Beta Was this translation helpful? Give feedback.
Hi
If you are sure that the meter is sendind all message that tasmota need as requested by the inverter, you can try to use the RS485 converter without connecting the TX pin from Tasmota
Then tasmota will only receive data, including the request from the Inverter but hopefully that won't be a problem
If there isn't all expected mesasge than you are in trouble as Tasmota driver is coded to be the only master and not sharing the bus (and may be the inverter too as per what you say)