RPi4 64 bit OS Lite (headless). I’ve used Venus OS large for years but decided to revert to regular RPi as I would prefer to use influxdb and Grafana as this is a mobile setup and I only ever want to look at yesterday. Having dropped Venus OS and needing to control the inverter which runs my 3-way fridge controlled by SoC I need to send ON anf OFF commands to the inverter.
OK then.
That VE.Direct interface is connected to an USB port, but exposes a serial interface, right?
All you need to do is to send the HEX commands to that serial port and receive the answers.
For test purposes I am using an inject node connected to a VE.Direct USB Node, is the format for the data correct [“:451\n”] this should get the PID i believe, in my case I get nothing other than the normal ve.direct stream.
From the HEX-Protocol or the internet I don’t see (or understand) an example of sending ON or OFF to the inverter. Guidance / example would be appreciated.
Your payload above I suppose is binary from those 01/10 in front …
As the HEX protocol is a text protocol, you should send the ASCII representation of the command, all digits being in uppercase. And don’t forget the CRC.
You can play initially with the Linux built-in terminal/console application and send to that serial port where the USB to VE.Direct interface is the HEX commands.
Once all is OK and working, you worry about Node-RED.
To answer my own question, in a very basic way, here is what I’ve learnt as I can now send my Phoenix 12/500 into ON, ECO and OFF modes from Node-Red. The HEX codes can be gained from the VE.Direct-HEX-Protocol, this took me a little while to prove as I wasn’t sure if I had calculated the commands correctly or that the method I was trying to send from NR was correct. I did find a python script that allowed me to test each command.
To send a command it starts :8 follwed by the register, the flags the operation you want to send and the checksum. All bytes are sent lowest byte first. So to turn ON the inverter :800020002004900 the colon is the start identifier, 8 is to SET the register 0200, the flags are 00, 0002 is the Inverter ON command and 0049 is the checksum. To get the checksum add in HEX, 8 + 2 + 2 = C, subtract this from from 55 = 49, the checksum.
into a Function Node, the output goes to a Serial Node with a baud of 19200. I set the serial port like this /dev/serial/by-id/usb-VictronEnergy_BV_VE_Direct_cable_VE4PIC7J-if00-port0 which can be found in Linux using the terminal command ls /dev/serial/by-id/*
I did not require the :7 GET command as once the HEX command has been sent the VE.Direct returns to spitting out all data as normal which can be read easily.