hultenvp / solis-sensor

HomeAssistant integration for the SolisCloud PV Monitoring portal via SolisCloud API
Apache License 2.0
190 stars 41 forks source link

Missing 'Charge' & 'Discharge' entities #344

Open HarryFlatter opened 5 months ago

HarryFlatter commented 5 months ago

First of all, many thanks for providing the missing entities that I reported in #334 :-)

I now believe there are 4 battery 'Charge' and 'Discharge' entities missing from the integration.

For 'Charged' the integration provides:

sensor.solis_daily_energy_charged sensor.solis_total_energy_charged

but nothing for Month or Year

For 'Discharged' the integration provides:

sensor.solis_daily_energy_discharged sensor.solis_total_energy_discharged

but nothing for Month or Year

The missing figures do seem to be available according to the Solis app & web portal.... Capture

HarryFlatter commented 3 months ago

Hi, any update on these missing entities? Thx

viking2010 commented 3 months ago

@HarryFlatter @hultenvp The API needed for this is /v1/api/stationDetail. This info only shows as 0 when using the /v1/api/InverterDetail.

The entity names in the API are: "batteryChargeMonthEnergy": 85.0, "batteryChargeMonthEnergyStr": "kWh", "batteryChargeYearEnergy": 741.0, "batteryChargeYearEnergyStr": "kWh",

Hope this information helps in getting them added to the integration.

HarryFlatter commented 3 months ago

Many thanks for that @viking2010. Really helpful.

Not being a 'coder', presumably this would be a change for @hultenvp to make?

Would this also go for the missing 'Discharge' entities too? eg. "batteryDischargeMonthEnergy": 85.0, "batteryDischargeMonthEnergyStr": "kWh", "batteryDischargeYearEnergy": 741.0, "batteryDischargeYearEnergyStr": "kWh",

viking2010 commented 3 months ago

Whoops, I forgot to put those in!! But yes, absolutely right. To confirm, they are:

"batteryDischargeMonthEnergy": 82.0, "batteryDischargeMonthEnergyStr": "kWh", "batteryDischargeYearEnergy": 758.0, "batteryDischargeYearEnergyStr": "kWh",

I will take a look at it but I'm not the worlds greatest coder either, and understanding someone elses code doesn't always come easy!! Ultimately, this is something Hultenvp would be able to do though.

hultenvp commented 3 months ago

@HarryFlatter: I only see the requested attributes in inverterDetail and inverterDetailList (API v2.0). Not in plantDetail However, if @viking2010's statement is correct then adding them will have no effect (note: I don't have a hybrid system, so cannot test battery values myself)

@viking2010: Can you check if inverterDetailList gives the correct values?

viking2010 commented 3 months ago

UPDATE TO THE BELOW: The entities below are also available in inverterDetail. My python script was pointing at inveterDetail (the api reference with the typo!) and it's not in there. So, the same entities as those below are available and show the correct values in both inverterDetail and inverterDetailList.

------ORIGINAL MESSAGE------ @hultenvp Hi, I can confirm that inverterDetailList does show the battery stats being requested above, but the entity name is different to the ones listed in my previous posts. They are:

"batteryMonthChargeEnergy": 230.0, "batteryMonthChargeEnergyStr": "kWh" "batteryMonthDischargeEnergy": 236.0 "batteryMonthDischargeEnergyStr": "kWh"

"batteryYearChargeEnergy": 886.0 "batteryYearChargeEnergyStr": "kWh" "batteryYearDischargeEnergy": 912.0 "batteryYearDischargeEnergyStr": "kWh"

There's even details for the charge/discharge from "yesterday": "batteryYesterdayChargeEnergy": 10.3 "batteryYesterdayChargeEnergyStr": "kWh" "batteryYesterdayDischargeEnergy": 12.1 "batteryYesterdayDischargeEnergyStr": "kWh"

It's interesting that the "Yesterday" figures are to 1 decimal place, yet the current day's entities are whole numbers only, rounded up! Wish Solis would sort that out!

Hope that helps you out @hultenvp! More that willing to do some testing when you need it!