SonnenladenGmbH / APsystems-EZ1-API-HomeAssistant

The APsystems EZ1 Integration offers a streamlined interface for interacting with the local API of APsystems EZ1 Microinverters using Home Assistant.
MIT License
77 stars 11 forks source link

sensors unavailable at night #8

Closed odeBuXTeR closed 6 months ago

odeBuXTeR commented 7 months ago

Hi, when micro inverters shut down when sun at dusk, that provide multiple errors in HA's logs. So, is there a chance to put an option that disable logger when micro inverters going down, and reenable it when they become available ? It could be part of an automation, but integrated in this component simplify things 😅

Thx

Note that all working very well when sun is shining, big up for your work !! 👍

mawoka-myblock commented 7 months ago

Note to myself: It's an error in the python-library and only affects the switch.

Error:

Update for switch.apsystems_solar_power_status fails

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 696, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 957, in async_device_update
    await self.async_update()
  File "/config/custom_components/apsystemsapi_local/switch.py", line 59, in async_update
    status = await self._api.get_device_power_status()
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/APsystemsEZ1/__init__.py", line 237, in get_device_power_status
    return Status(int((await self._request("getOnOff"))["data"]["status"]))
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: invalid literal for int() with base 10: ''