tijsverkoyen / HomeAssistant-FusionSolar

Integrate FusionSolar into your Home Assistant.
MIT License
133 stars 25 forks source link

Incorrect 0 values in some api queries #138

Closed jvcsw closed 4 months ago

jvcsw commented 5 months ago

Describe the bug Some sensors returns 0 values breaking all statitiscs.

For exemple: total_lifetime_energy

Debug information No traces found

** Are you using Kiosk or Northbound / OpenAPI mode?

To Reproduce Steps to reproduce the behavior:

I don't know.

Expected behavior Incremental values cannot be 0 when previous values were greater than 0.

Screenshots

imagen

Additional context I think that for some reason the api get fail and the sensors return 0.

tijsverkoyen commented 5 months ago

Do you have the latest version installed?

tijsverkoyen commented 5 months ago

Also, isn't this a duplicate of https://github.com/tijsverkoyen/HomeAssistant-FusionSolar/issues/135

jvcsw commented 5 months ago

I have the latest, v3.0.2.

The problem is similar, I don't know if it's the same, because it returns 0 to me

tijsverkoyen commented 5 months ago

@jvcsw would you be able to apply the changes from https://github.com/tijsverkoyen/HomeAssistant-FusionSolar/pull/142 on your local installation? And if so: would you be so kind to report if this fixes the issue.

jvcsw commented 5 months ago

It's very hard to check if it works because it's a behavior that's beyond my reach. The error happened very occasionally.

Update 142 applied. Thanks.

tijsverkoyen commented 5 months ago

@jvcsw thx, there is one change that should be removed. Can you reapply the changes please. Otherwise there might by problems with the current year and current month sensors.

Could you test this out for a few weeks, and let me know if there are issues? I would really appreciate it.

jvcsw commented 5 months ago

ok, applied again. Thanks.

jvcsw commented 5 months ago

Good morning.

I have seen these issues for the past few days. I hope they help you:

`Entity sensor.casa_total_lifetime_energy from integration fusion_solar has state class total_increasing, but its state is not strictly increasing. Triggered by state 4857.37 (4857.38) with last_updated set to 2024-02-03T19:57:29.584175+00:00. Please create a bug report at https://github.com/tijsverkoyen/HomeAssistant-FusionSolar/issues

Entity sensor.current_year_inverter_yield from integration fusion_solar has state class total_increasing, but its state is not strictly increasing. Triggered by state 113.24 (113.3) with last_updated set to 2024-02-03T21:37:29.919071+00:00. Please create a bug report at https://github.com/tijsverkoyen/HomeAssistant-FusionSolar/issues

Entity sensor.casa_total_current_year_energy from integration fusion_solar has state class total_increasing, but its state is not strictly increasing. Triggered by state 113.24 (113.3) with last_updated set to 2024-02-03T21:37:29.919464+00:00. Please create a bug report at https://github.com/tijsverkoyen/HomeAssistant-FusionSolar/issues

Entity sensor.lifetime_inverter_yield from integration fusion_solar has state class total_increasing, but its state is not strictly increasing. Triggered by state 4857.32 (4857.38) with last_updated set to 2024-02-03T21:37:29.920995+00:00. Please create a bug report at https://github.com/tijsverkoyen/HomeAssistant-FusionSolar/issues`

Error requesting FusionSolarOpenAPIDeviceRealKpiType data: 504 Server Error: Gateway Timeout for url: https://eu5.fusionsolar.huawei.com/thirdData/getDevRealKpi

Error requesting FusionSolarOpenAPIDeviceRealKpiType data: 502 Server Error: Bad Gateway for url: https://eu5.fusionsolar.huawei.com/thirdData/getDevRealKpi

Error requesting FusionSolarOpenAPIDeviceRealKpiType data: HTTPSConnectionPool(host='eu5.fusionsolar.huawei.com', port=443): Max retries exceeded with url: /thirdData/getDevRealKpi (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f6fff50d0>: Failed to establish a new connection: [Errno -3] Try again'))

Error requesting FusionSolarOpenAPIDeviceRealKpiType data: 500 Server Error: Internal Server Error for url: https://eu5.fusionsolar.huawei.com/thirdData/getDevRealKpi

danielhunt commented 5 months ago

I think this and #145 are related

tijsverkoyen commented 4 months ago

I will not try to fix the glitches for Current Month or Current Year. Huawei FusionSolar should up their game and don't send wrong values.

I have created https://github.com/tijsverkoyen/HomeAssistant-FusionSolar/releases/tag/v3.0.3 which has the better handling for the glitches in Lifetime.