jorticus / pymate

Outback MATE python interface
https://jared.geek.nz/pymate
GNU General Public License v2.0
28 stars 9 forks source link

Add force float feature #18

Open joshuajayg opened 4 years ago

joshuajayg commented 4 years ago

There is purportedly a way to tell charge controllers to go into float mode using the MATE. This is found on pages 61 and 62 of the MATE System Controller and Display Installation and User Manual. Unfortunately this communication is not covered in the MATE communication protocol manual.

If certain conditions are met, the MATE is supposed to tell all "inverters and charge controllers" to go into float mode. It would be nice to add this as a function so pymate can tell the charge controllers to force float.

jorticus commented 4 years ago

Thanks for the info, it does seem to be possible and it sounds like the MATE is driving it, which means this library will need to re-implement that behaviour somehow (I don't have the MATE connected in my system)

I'll do some digging later today... the current virus situation has given me a great opportunity to spend a lot of time with our outback gear 😀

joshuajayg commented 4 years ago

Connecting through VNC and SSH, I tried this on my pi at home (I'm at work.)

I just took a shot using your "control()" function and it worked.
ie. >>> mate.control(0x01C8, 1) = float

mate.control(0x01C8, 4) = eq

I watched my CC max out on watts and my voltage spiked to 32.6v before I returned it to float and it settled to 27.5v.

jorticus commented 4 years ago

That's promising, I'll see if I can capture exactly which command MATE sends.

jorticus commented 4 years ago

Well my MATE doesn't have the option it seems, so I can't test this out. I suspect it's too old (rev 4.0.4).

You should check to see whether that control is a permanent override, or whether the charge controller takes back control after the next cycle. There may be another command the MATE uses to tell the CC to enter float...

joshuajayg commented 4 years ago

I queried the status register this morning (sun is rising) and it is now set to mode 2 (Bulk). I had left it with a float command last night. I just sent a float command. I will leave it there for a couple hours to see if it stays in float.

I imagine this same method will work to set new float set point, absorb set point, and maybe a couple others. I haven't tested them yet though. Just write to the register you want to change.

joshuajayg commented 4 years ago

Alright, so batteries are charging and stopped at my float voltage. The "status" returns "1" which is float. Looks like writing an integer to the mode register of 0x01C8 puts the charge controller in that mode. It resets at sunset just like the daily log values do.

Caveat - I could not re-set the charge controller to bulk with mate.control(0x01C8, 2). It stayed in float at that point. But sending mate.control(0x01C8, 3) set it back to a bulk cycle. Then mate.status sent back "2"

I also wrote mate.control(0x0172, 260). My float set point moved down to 26.0v. So writing to that register works also.

Pretty straight forward.