WVC inverter MQTT Data logging for all versions of inverters

okay I refreshed myself with the code the watt1, watt2, watt3, I believe are the stored data on total kwatts produced by the inverter… but from your output it not working correctly

I also see i did not echo the watt out put I only sent it MQTT to my database just add echo "DC watts " $DC and echo "AC watts " $AC after DC and AC and it display the correct wattage in the terminal window
look for these lines in the R3 section

DC="$( echo $MQttVDC \* $MQttADC bc -l)"

AC="$( echo $MQttVAC \* $MQttAAC bc -l)"

mosquitto_pub -h $host -t "incoming/$3/DC-Energy/power-$D_id" -m "N:$DC"

mosquitto_pub -h $host -t "incoming/$3/AC-Energy/power-$D_id" -m "N:$AC"

and you can comment out (#) the watt1, watt2 and watt3 or remove line 478 to 497 as it only deals with stored data on the inverter

1 Like

OK, updated with the DC and AC values per inverter. I thought maybe it was in there since it looked like there was an accumulation of all inverter being posted and they looked like a good value for the sum.

Any thoughts on the temperature value? It really wasn’t that hot here today. :wink:

I was also trying to get the WiFi modem working over rs232/USB since for some reason my HC-12 setup will stop collecting data and I have to depower/repower the FTDI->HC12 to get data again. It will sometimes run for a few days and then glitch and sometimes it’ll just run for a hour or two and glitch.

I read through this entire thread again and it seems all work on the WiFi Modem stopped when the HC-12 protocol was figured out.

put your device that the HC-12 is connected to on a UPS I find power surges and flickers kill them hc-12 … I will look at the temperature see where I went wrong there . probably something simple as well I think it done in kelvin and I probably just converted it incorrectly

I ended up getting a USB3 powered hub to try since that was my thought, ie it was a power issue. I suppose since I’m powering the HC-12 from the FTDI board maybe its filtering of the USB power is flaky. It’s an Adafruit FTDI Friend board set to 3.3V so the HC-12 is definitely being powered through the onboard 3.3V regulator of the FTDI board.

curious by “WiFi Modem” do you mean the WVC wifi router that works with these inverters I believe if your router has the serial port on it my script will still work from what info I can find on the WVC wifi router it is just a pass through to the built in hc-12

gets:
TEMP=11ce
TDEC=52753
MQttT=527.53

so it seems to be in this section where the temp is off.

Yes, the WVC-Modem with Wifi, RS232, 433MHz and what looks like an ethernet port but does not connect to a router. I have tried wvc with the modem option and even tried a brute force trimmed down version… I tried the C code version just directing it to the ttyUSB1 device which is the modem but I just see the RXT led blink and never any reply from the inverters on TXD.

for wvc you would still use hc-12 modem option is for completely different inverter format… the network port that does not connect to network sounds like rs485 Chinese equipment tend to use alot cat5 connections for RS485 . when you have the WVC wifi router collecting data and you sniff the serial port maybe it pushing the data down the serial – yes that the temperature just compare the difference in the c code and mine see where I messed up… but I am off to bed now it late if you reply I will reply in the morning

I don’t have a Windows machine, tried running KDM via Wine like the old modem(powerline) but it doesn’t seem to recognize the new inverter type WVC700 numbers( 4000xxxx ). So I can’t really sniff it and I can’t seem to get it setup on thru mxEasy and the other software they want. I see its WAP, connect to the SSID with passphrase 12345678 and connect but there’s nothing there. Nmap shows only port 1234 open on 10.10.10.1

rs485 does make sense as lots of other inverters talk over rs485 also.

I think temp will work using what you had in the code commented out since I got 65.00 when I tested the OUTPUT from previous runs against it.
TEMP="$(echo $OUTPUT | cut -c53-56 | echo $(tr -d ‘\n’) )"
TDEC=$(x=$((16#$TEMP)); [ “$x” -gt 32767 ] && ((x=x-65535)); echo “$x”; )

try installing vwplayer or virtualbox ( found in software repository) with windows for KDM … humm I thought wvc router had a login page that you setup what inverters are connected to it and you view the data on it . that what it showed on the manual i downloaded for it when I was first investigating the new WVC inverters –

I looked at it again here some info from it in

Click on the computer to connect to the WiFi network of HF-A11x_AP
as shown in Figure 8, open the browser in the computer, enter the IP
address: 10.10.100.254, enter in the name: admin, enter in the password
field: admin.

if you connect with the router you can use my script to sniff the data via the hc-12 if you like with a little modification to it … or sniff the serial port to see if anything is there

I’m not sure the uncommented temp lines are correct either since I’m seeing listed 13.00, 22.00 and 21.00 for temps this morning.

For the WiFi Modem, my modem puts out an WAP SSID of MODEM_20111839 and passphrase of 12345678
Nothing like it mentioned in any of the Kai Deng documents I’ve found.

using the commented out TEMP and TDEC the displayed temps seem to match what the C code version shows but boy does it go off the rails when they units start shutting down:

Inverter Type WVC700 R3
f220111839e91b000040000c65650d775f4c000002a1000000000c80
Inverter ID 40000C65
Temp 32.00
VDC 34.47
VAC 243.96
ADC
(standard_in) 1: syntax error
AAC
(standard_in) 1: syntax error
(standard_in) 1: syntax error
(standard_in) 2: syntax error
(standard_in) 2: syntax error
DC watts
AC watts
(standard_in) 1: syntax error
(standard_in) 1: syntax error

Totalling:
(standard_in) 2: syntax error
AC watts
(standard_in) 2: syntax error
DC watts
(standard_in) 1: syntax error
(standard_in) 1: syntax error
^C

Using the original TEMP and TDEC values it looks a bit more sane handling the data:

Inverter Type WVC700 R3
f220111839e91b000040000d02650bef309f00006e1b0000000009c4
no input from inverter 40000D02

Inverter Type WVC700 R3
f220111839e91b000040000d20650c596045000002b9000000000c80
no input from inverter 40000D20

Inverter Type WVC700 R3
f220111839e91b000040000c65650d226045000002a1000000000c1c
no input from inverter 40000C65
no wattage data

are you referring to these lines
#TEMP="$(echo $OUTPUT | cut -c53-56 | echo $(tr -d ‘\n’) )"
#TDEC=$(x=$((16#$TEMP)); [ “$x” -gt 32767 ] && ((x=x-65535)); echo “$x”; )

might have to modify it slightly as it not triggering a null value perhaps it giving a constant value when the system shuts down for the temperature value instead of a null then you have to edit
if [ -z “$MQttT” ]; then

to recognize the constant value and/or possibly the null value

if [ -z “$MQttT” ] || [ “$MQttT” ==somevalue ]; then

other possibility edit the original to use -c53-56 block instead of -c49-52 block -

if I remember back someone had issue with the R3 when testing I had to modify it and I had to offset blocks perhaps I forgot to offset the temperature block . I checked the github logs I had to offset by 2 and I never offset the temperature and the cumulative watts so the temperature block should be -c51-54 as I never did offset the temperature block

the problem was the version of sed i was using worked with sed ‘s/^…//’ but thier did not so I had to remove this from the key processing then it worked with theirs but it add two extra bit to work around

edit to this :
TEMP="$(echo $OUTPUT | cut -c53-56 | echo $(tr -d ‘\n’) )" —> the block mentioned earlier was being used by AAC (c49-52)

I’ll have to look at this more closely since 4 bytes should provide a better temp than what I’m getting.
Using bytes 53-56 in original script for TEMP does a better job and doesn’t choke on system power-up/down but the numbers just don’t look like good temps.

if the other one works then when it get disconnected in the evening it getting some sort of value that is not null can you add echo $MQttT before " if [ -z “$MQttT” ]; then " and see what the output is if in the evening it gives a value or perhaps it a white space

so
try something like this to remove the whitespace
MQttT="$( echo $MQttT | sed -r ‘s/\s+//g’ )"

put it just before

if [ -z “$MQttT” ]; then

or edit this line
MQttT="$( echo $TDEC / 100 | bc -l| head -c-19 )"
to this
MQttT="$( echo $TDEC / 100 | bc -l| head -c-19 | sed -r ‘s/\s+//g’ )"

to remove whitespace

It looked better when I’d looked at it( morning ) since it showed something around 20 - 30.00 (which might have been C) where the defaults were showing 100-300. But then the day progressed and the temps were 55-60 which would be over 130F and it’s only 65F outside. Not to mention there are no fractional values it’s always a whole number with trailing .00 so neither temp calculation is quite right.

Maybe the 2nd version and C code is correct or close since I’m seeing 47.00 54.00 and 55.00 on 3 inverters. The low one only has one panel on it right now and the other 2 have 2 new panels on each so maybe 54C and 55C(~130F) is correct.

Giving this a try:

TEMP=“$(echo $OUTPUT | cut -c53-56 | echo $(tr -d ‘\n’) )”
TDEC=$(x=$((16#$TEMP)); [ “$x” -gt 32767 ] && ((x=x-65535)); echo “$x”; )
MQttT=“$( echo $TDEC / 100 | bc -l| head -c-19 | sed -r ‘s/\s+//g’ )”

odd, it doesn’t look like there are any odd bytes in the MQttT var.
I echoed it with:

TEMP=“$(echo $OUTPUT | cut -c53-56 | echo $(tr -d ‘\n’) )”
TDEC=$(x=$((16#$TEMP)); [ “$x” -gt 32767 ] && ((x=x-65535)); echo “$x”; )
MQttT=“$( echo $TDEC / 100 | bc -l| head -c-19 | sed -r ‘s/\s+//g’ )”
echo DJL-${MQttT}-DJL

Seems this is being caused by the differences between these two TEMP lines so it looks like it’s the last bytes of the message during power down which are causing the problem.

#terminates fine with powering down output from the inverter
TEMP=“$(echo $OUTPUT | cut -c49-52 | echo $(tr -d ‘\n’) )”
#terminates with errors when powering down output from inverter
TEMP=“$(echo $OUTPUT | cut -c53-56 | echo $(tr -d ‘\n’) )”

Output:

Inverter Type WVC700 R3
f220111839e91b000040000d02650b9a309f00006e92000000000a8c
DJL-27.00-DJL
Inverter ID 40000D02
Temp 27.00
VDC 29.70
VAC 124.47
ADC
(standard_in) 1: syntax error
AAC
(standard_in) 2: syntax error
(standard_in) 2: syntax error
(standard_in) 2: syntax error
(standard_in) 2: syntax error
DC watts
AC watts
(standard_in) 1: syntax error
(standard_in) 1: syntax error

Inverter Type WVC700 R3
f220111839e91b000040000d20650d186098000a05100000001e0e10
DJL-36.00-DJL
Inverter ID 40000D20
Temp 36.00
VDC 33.52
VAC 247.28
ADC .10
AAC .01213
(standard_in) 1: syntax error
(standard_in) 1: syntax error
DC watts 3.3520
AC watts 2.9995064
Panel Efficiency .89

Inverter Type WVC700 R3
f220111839e91b000040000c65650c046098001404f00000003b0e10
DJL-36.00-DJL
Inverter ID 40000C65
Temp 36.00
VDC 30.76
VAC 247.28
ADC .20
AAC .02385
(standard_in) 1: syntax error
(standard_in) 1: syntax error
DC watts 6.1520
AC watts 5.8976280
Panel Efficiency .95

Totalling:
(standard_in) 2: syntax error
AC watts
(standard_in) 2: syntax error
DC watts

Hi all,

I got me a WVC 600 R3, and it looks like I managed to break your title with it.

I did not open the case yet, but it has no external antenna or connector for it, so I guess no HC-12 inside to communicate with.

Anyone had some success to wiring up rx/tx with an esp8266 or similar?

WVC produces a lot of different inverters. My script is specifically for those that work with 900 MHz HC12. But they do have a 2.4 GHz, powerline networking variant and versions with no communication at all. If no antenna, it is either the one that has no communication or the one with powerline networking.
If it’s a no communication version, then I think you are out of luck. If powerline, you might be able to
if you have a power line adapter that you can use to sniff what’s going on. You could buy a Arduino compatible power line communications shield to see if you can figure out what’s going on.

Perhaps if you are lucky, and it’s a powerline version with the KQ-330, my script might work out of the box…

Thank you, will have a look, but honestly, I don’t think I will find one.
No communication mentioned in the documentation sheet, in or on the box.
Will take more care next time - I need one where I can limit output power.