gemu2015 / Sonoff-Tasmota

Tasmota Fork TCS34725,PN532_i2,ccc1101 Moritz support,m5stack 4,7 epaper, hotplug drivers
GNU General Public License v3.0
24 stars 19 forks source link

Smart Meter custom registers #57

Closed pkkrusty closed 7 months ago

pkkrusty commented 8 months ago

Have you looked for this feature in other issues and in the docs?

Is your feature request related to a problem? Please describe.
I'd like to iterate through a bunch of registers to map what is available (documentation is not correct for the inverter I am communicating with). So I tried to define the meter with the following, but it doesn't work. >M 1 +1,5,m,0,9600,modbus,1,10,%astr% Where I have built astr to be a normal Modbus command like r01037D500008

Is there already a method to do this?

Describe the solution you'd like
Poll consecutive registers programmatically instead of adjusting the script.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

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

gemu2015 commented 8 months ago

variable substitution is not supported in meter definition line.

define meter with a least one register like +1,5,m,0,9600,modbus,1,5, r01037D500008

then e.g. in >S send more register requests with

>S
; modify cstr programmatically 
cstr="r0103"+hn(v1)+hn(v2)+"0008"
sml(1 3 cstr)

you may then watch the responses in dump mode with sensor53 d1

pkkrusty commented 7 months ago

That works great, thanks.