juicejuice / homeassistant_redback

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

Battery Issues? #6

Closed Lastaerie closed 1 year ago

Lastaerie commented 1 year ago

Hi, Firstly thanks for the effort on this. I've been asking RBT about this for aaaages and tried myself a year or so ago but didn't get very far. My issue is this. is there a way to return the information relating to batterys? i have 2 battery packs in my system and noticed today (while setting this up) that one of the packs has stopped working according the to the console. As there is no notification method in the Redback portal it would be cool to have something set up via HA. James

juicejuice commented 1 year ago

I like the idea, here is what the Redback API provides in terms of battery details:

Which of those would be suitable for your needs? I haven't had a battery stop working so I don't know what that would look like from the API perspective? What does it look like on the Redback portal? Final thought, you could test out the API methods and report back? https://api.redbacktech.com/docs/index.html

Lastaerie commented 1 year ago

The only notification that i got was in the redback web portal it tells you what the inverter type, panels capacity and battery capacity. i noticed it was only saying 3.6Kwh instead of 7.2. I'll have a play around with the API methods and see which one looks right "Battery Capacity" looks like it might be the right option. but will confirm. the is only shown on the web portal and not the mobile app. Thanks J.

juicejuice commented 1 year ago

@Lastaerie sounds good. In that case I think it should be easy to pass through the relevant data points. For example, if BatteryCapacitykWh and UsableBatteryCapacitykWh were available as HA entities then you could write some automation that checks those entity values are within expected parameters?

Lastaerie commented 1 year ago

Hi,
is it possible to pass through the following 3:

  1. "BatteryCapacitykWh" = total installed battery capacity
  2. "UsableBatteryCapacitykWh" = total available battery capacity
  3. "BatteryModels" = list of installed batteries

1 & 2 would enable a reconciliation of battery performance and 1 & 3 would help to a confirm the availability of batteries but also assist in the diagnosis of a fault assuming that 3 is a dynamic & reported list rather than a installer set field at the point of install. thanks -James

juicejuice commented 1 year ago

Sorry for the delay @Lastaerie, I'm going to add a few other entities (perhaps on the weekend) so I'll include these in the mix.

Lastaerie commented 1 year ago

That's all good and thankyou. I'm just super stoked you are working on this integration at all. It's adding so much value to my Solar setup. Redback should be sponsoring you.

juicejuice commented 1 year ago

Hi @Lastaerie, I've looked into this today but realised what you're asking for might not actually do what you want. Those three fields you identified are all from the StaticData API. The StaticData doesn't change, it's configured by the installer when your system is installed. Can you check with the API and see if "UsableBatteryCapacitykWh" changes for your system? Mine seems to stay the same, but maybe I'm missing something.

Lastaerie commented 1 year ago

hi @juicejuice , will do. I assume there must be some method reporting back as the web portal displays battery capacity which is how i am currently seeing the occasion occurrence of my battery capacity flipping between 7.1 & 3.6 Kwh.

juicejuice commented 1 year ago

Yes that did occur to me too, but then again I have noticed the portal+app use a different "private" API as compared to the public one this integration is using. Anyway, please do report back if you can find a way via the regular public API to retrieve the data you need?

Lastaerie commented 1 year ago

Just thinking that if this is not the case I will raise a request to see if it can be added to the public API. Seems odd that they wouldn't provide it by default.

juicejuice commented 1 year ago

Yeah, makes sense to have detailed real-time battery information beyond the basic charge/discharge. Anyway, let me know how you get along :)

Lastaerie commented 1 year ago

Hi @juicejuice looking at postman today it looks like this value is changes:

delivered from the Static data set

7am "BatteryCapacitykWh": 7.104, "UsableBatteryCapacitykWh": 6.394,

11am "BatteryCapacitykWh": 3.552, "UsableBatteryCapacitykWh": 3.197,

Kind regards

James

juicejuice commented 1 year ago

Good research! I'll have a look at pulling that data through.

juicejuice commented 1 year ago

@Lastaerie please check out my latest commit, it adds two new sensors for the values you found were changing. Does this work for your needs?

Lastaerie commented 1 year ago

@juicejuice I'll update now and then add the fields to check. Many thanks for this will update shortly. Edit: updated and looks to be all good. Although the web portal is reporting my inverter being offline. So looks like I will need to reset that when I get home.

Lastaerie commented 1 year ago

Hi @juicejuice, Quick question. what is the update frequency? does the integration poll on a certain time frame? i only ask as there don't seem to be many datapoints on the historical graph in HA? thanks. James

juicejuice commented 1 year ago

I've got the dynamic data fields on a one minute timer and the static data fields (your two new sensors) on a one hour timer. Maximum resolution is one minute because that's the timer frequency inside the Ouija board that uploads the production data to the Redback backend.

Lastaerie commented 1 year ago

ah ok,. Would it be possible to increase the timer on those two items? not sure what a practical timer would be? 15 min? while an hour would seem to make sense for something that should be "static" when it develops a fault a shorter timing would give greater visibility. many thanks James

juicejuice commented 1 year ago

Sure - the idea was that we don't need to hammer the API for data updates when the data changes infrequently. No one else has asked for these two data points so in this case it really depends on what you feel is appropriate for your situation. If it's 15 minutes then I can update that, no worries.

Lastaerie commented 1 year ago

Its an interesting one right? it's not something that normally would need updating as its supposed to be static but when errors/faults occur that's when you would like a more granular view. pragmatically i think 15 would be fine as long as that doesn't cause any issues with API requests

juicejuice commented 1 year ago

I think that 15 minutes works fine so I've made the change now, you should be able to update and check it out.