tijsverkoyen / HomeAssistant-FusionSolar

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

total_current_day_energy is unavailable #99

Closed Webtica closed 12 months ago

Webtica commented 1 year ago

Hi Tijs,

Thanks for this integration. I was able to setup the integration via the OpenAPI setup with credentials I got from Huawei. I have two questions:

  1. The total_current_day_energy seems to be unavailable. See screenshot here. This is for the solar setup in the energy dashboard. Any idea why it is unavailable or how I could get this working.

  2. the other ones (grid in, grid out, battery in/out) seem to be working fine but are named a bit different then the ones you have in your tutorial/readme. It is using the following entities:

    • sensor.battery_charging_capacity
    • sensor.battery_discharging_capacity
    • sensor.power_sensor_reverse_active_energy (via powermeter)
    • sensor.power_sensor_active_energy_forward_active_energy (via powermeter)

Instead of the ones in your readme like: sensor.xxx_battery_charging_capacity

are these the same or?

Thanks! Dieter

tijsverkoyen commented 12 months ago

@Webtica can you enable debugging and check the logs for errors?

Webtica commented 12 months ago

Hi Tijs,

Here is a log from this morning:

Logger: custom_components.fusion_solar.sensor Source: custom_components/fusion_solar/fusion_solar/openapi/openapi_api.py:183 Integration: Fusion Solar (documentation, issues) First occurred: 8:41:44 AM (1 occurrences) Last logged: 8:41:44 AM

Unexpected error fetching FusionSolarOpenAPIStationRealKpi data: Invalid access to current interface! Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 283, in _async_refresh self.data = await self._async_update_data() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 242, in _async_update_data return await self.update_method() ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/fusion_solar/sensor.py", line 581, in async_update_station_real_kpi_data response = await hass.async_add_executor_job(api.get_station_real_kpi, station_codes) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, **self.kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/fusion_solar/fusion_solar/openapi/openapi_api.py", line 108, in get_station_real_kpi response = self._do_call(url, json) ^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/fusion_solar/fusion_solar/openapi/openapi_api.py", line 183, in _do_call raise FusionSolarOpenApiErrorInvalidAccessToCurrentInterfaceError(json_data[ATTR_MESSAGE]) custom_components.fusion_solar.fusion_solar.openapi.openapi_api.FusionSolarOpenApiErrorInvalidAccessToCurrentInterfaceError: Invalid access to current interface!

tijsverkoyen commented 12 months ago

File "/config/custom_components/fusion_solar/fusion_solar/openapi/openapi_api.py", line 183, in _do_call raise FusionSolarOpenApiErrorInvalidAccessToCurrentInterfaceError(json_data[ATTR_MESSAGE]) custom_components.fusion_solar.fusion_solar.openapi.openapi_api.FusionSolarOpenApiErrorInvalidAccessToCurrentInterfaceError: Invalid access to current interface!

My first guess is that you don't have access to everything that is needed, see: https://github.com/tijsverkoyen/HomeAssistant-FusionSolar#device-data

Webtica commented 12 months ago

Alright. Would it be easier to change to Kiosk mode?

tijsverkoyen commented 12 months ago

@Webtica that will be easier than ask your installer. But your data will be updated less frequently. It all depends on what you want to achieve in Home Assistant

Webtica commented 12 months ago

Hi Tijs,

Thanks! I added both of them as the battery and other items are working. One last question: In the readme you say to use total energy per day for solar but isn't it better to use the realtime value or?

Thanks, Dieter

tijsverkoyen commented 12 months ago

I'm not 100% sure, but I think the Energy dashboard expects a total number and not a realtime value.

Webtica commented 12 months ago

Alright thanks!