Hey folks,
I bought a VE.Direct USB cable a while back that I'm just now getting around to programming for. I'm trying to write a generalized Java library to allow for communication with these types of devices, wondering if anyone else out there can help test. I only have one type of Victron product (Smart Solar MPPT) so there are limits to what I can do.
I'm about to start fleshing out the README, feature requests are welcome.
https://github.com/kazetsukaimiko/victron-java
The VE.Direct protocol is silly simple, I think it is also read-only. This is what you get back, raw:
Code:
PID 0xA059
FW 146
SER# HQ1748J433S
V 24480
I 0
VPV 37340
PPV 0
CS 5
MPPT 1
OR 0x00000000
ERR 0
LOAD ON
Relay OFF
H19 27969
H20 3
H21 22
H22 3
H23 22
HSDS 292
Currently I have a few fields working. I map the PID to a product name with a fairly elaborate enum mapping:
https://github.com/kazetsukaimiko/vi...onProduct.java
I also have a Math library embedded around Potential (Voltage), Current (Amperage), Power (Wattage), and Energy (Wattage/Time), which I modeled after Java 8+ java.time for unit conversion. Its still rough, but will hopefully be worth expanding as time goes on:
https://github.com/kazetsukaimiko/vi...java/kaze/math
Example of what is currently working:
Code:
VEDirectMessage{product=SMARTSOLAR_MPPT_150_100_REV2, relayState=OFF, firmwareVersion='null', offReason=null, resettableYield=279.69 kWh, yieldToday=0.03 kWh, maxPowerToday=22 W, yieldYesterday=0.03 kWh, maxPowerYesterday=22 W}
This was all implemented according to Victron's own PDF on the matter, "VE.Direct-Protocol-3.27.pdf" available on their website.
The packets from the VEDirect device look like this, its a read-only protocol from what I can tell. To manage the devices I'll need to implement their equivalent HEX protocols, something I may do later if there's demand for it.