juicejuice / homeassistant_redback

Home Assistant integration for inverter and battery systems from Redback Technologies
7 stars 2 forks source link

Current Load #7

Closed Slade2000 closed 1 year ago

Slade2000 commented 1 year ago

First, thank you very much, was waiting for this for a long time.

Is there a possibility for current load (Consumption) on the system. Currently only "Total Load" is available

thx

juicejuice commented 1 year ago

Glad you found this valuable! I have wrestled with the same issue here, the Redback API doesn't provide the real-time power value for load and their support seem incapable of figuring out how to help. You can calculate this from available data though, something like: pv_output + battery_discharge - battery_charge - grid_export + grid_import Does that work as some sort of helper entity? Try it out and let me know? I could add a calculated entity into the integration if it works OK. BTW, I haven't thought this through yet, but the export-import part is needed on three-phase systems as you can buy and sell across phases and need to net this out (e.g., it's exporting 1kW on phase "A" but importing 1KW on phase "B").

Slade2000 commented 1 year ago

I also went through the API's and thought it was just me missing the one needed. Okay let me try out the calculations and I will revert back if I get the right numbers.

On Sat, May 6, 2023 at 10:38 AM juicejuice @.***> wrote:

Glad you found this valuable! I have wrestled with the same issue here, the Redback API doesn't provide the real-time power value for load and their support seem incapable of figuring out how to help. You can calculate this from available data though, something like: pv_output + battery_discharge - battery_charge + grid_export - grid_import Does that work as some sort of helper entity? Try it out and let me know? I could add a calculated entity into the integration if it works OK.

— Reply to this email directly, view it on GitHub https://github.com/juicejuice/homeassistant_redback/issues/7#issuecomment-1536994585, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJG2DFT2GJ7S6QODRLGFPM3XEW2SLANCNFSM6AAAAAAXWV5KTU . You are receiving this because you authored the thread.Message ID: @.***>

juicejuice commented 1 year ago

Thanks @Slade2000! I did a bit of messing around here and it looks like that calculation gets close to the figures from the Portal, but try as I might the values returned from the Redback API don't quite match those returned by the app or portal. I'm not sure if that is important to you or not. I would be interested to hear your own results?

Slade2000 commented 1 year ago

I have created a sensor with your calculations and I think it is pretty close. This definitely helps. What I am trying to achieve is, doing automation on pool pump etc. for when certain power usage vs generation, it then switch on or off.

juicejuice commented 1 year ago

OK good feedback - I'll add this to the TODO list for next version. With any luck I will get some spare time this weekend.

juicejuice commented 1 year ago

I've added a new "Site Load" sensor that is calculated from the other data points. Please test out my latest code commit @Slade2000 and let me know if that works for you now?

Slade2000 commented 1 year ago

Work perfect. Will keep an eye on how it goes.

image