GitNik1 / VEBus

Arduino library for communicating with Victron Energy devices via VE.BUS
GNU General Public License v3.0
3 stars 1 forks source link

Using this to control the ESS assistant in a Multiplus II 48/3000 #1

Open M4GNV5 opened 1 week ago

M4GNV5 commented 1 week ago

So I have been doing some research on using a Multiplus II as a grid-tie battery storage solution. I read through the source code of this repository and compared it to esp32ess.

First of all there seems to be a bug when writing Settings: I think it should be WinmonCommand::WriteSetting instead of WriteRAMVar?

Furthermore I think the pre-defined RamVariables and Settings structs kind of limit what data can be read/written? For my use case I want to interface with the ESS assistant. Following this guide I first need to look through the assistant RAM entries to find the ESS assitant and can then control the desired charge/discharge power using its first assistant RAM entry. pv-baxi seems to have hardcoded his assistant power ram id, but from my understanding it can be at any ram location? How would I read an arbitrary RAM location (i.e. an address given in form of an uint8_t instead of one of the enum values)?

Also pv-baxi seems to be reading RAM IDs 0, 15 and 14 which seems to correspond to mains voltage, mains power and inverter power. Your enums seem to be lacking the RAM id 15 / mains power?

If I set voltage values and current limits using VictronConnect / VEConfigure is there anything else I need to take care of except writing to the ESS Assistant power value?

GitNik1 commented 4 days ago

Hi M4GNV5. Thank you for your Issue report. I have fixed the problem and will publish it today after testing. About the ESS functionality, I don't use this function and pv-baxi is the specialist of ESS but I will also check the RAM ID registers 15-19. To read any RAM register, i can add a public method to read a RAM register by address if needed or you can cast your address to RamVariables enum like: uint8_t address = 99; //register to read _vEBus.Read((RamVariables)address); If you find out a new useful register, please let me know to add it to the library.

GitNik1 commented 3 days ago

I will add a method to read/write the assistant RAM, I think this will solve your problem.