home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
71.11k stars 29.79k forks source link

Solax sensor does not work if home assistant restarted while it is off #30754

Closed danpowell88 closed 4 years ago

danpowell88 commented 4 years ago

Home Assistant release with the issue:

Home Assistant 0.103.6

Last working Home Assistant release (if known):

Operating environment (Hass.io/Docker/Windows/etc.):

Docker **Integration:**

https://www.home-assistant.io/integrations/solax/

Description of problem: Some (possibly all?) of the solax inverters power off overnight when there is not enough light to sustain the inverter itself, the inverter will power up the next day when there is enough sunlight to power it.

If home assistant is restarted while the inverter is off the sensor is not able to be discovered and it is not tried again.

Problem-relevant configuration.yaml entries and (fill out even if it seems unimportant):

sensor:
  - platform: solax
    ip_address: 192.168.20.13   

Traceback (if applicable):

Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/solax/sensor.py", line 34, in async_setup_platform
    api = await real_time_api(config[CONF_IP_ADDRESS], config[CONF_PORT])
  File "/usr/local/lib/python3.7/site-packages/solax/__init__.py", line 37, in real_time_api
    i = await inverter.discover(ip_address, port)
  File "/usr/local/lib/python3.7/site-packages/solax/inverter.py", line 74, in discover
    raise DiscoveryError()
solax.inverter.DiscoveryError

Additional information: Is it possible to modify it so that it continues to try to connect to the inverter even when not getting a response initially?

probot-home-assistant[bot] commented 4 years ago

Hey there @squishykid, mind taking a look at this issue as its been labeled with a integration (solax) you are listed as a codeowner for? Thanks!

stale[bot] commented 4 years ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue now has been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

squishykid commented 4 years ago

Yes, the integration will need to be changed to poll until the inverter is discovered.

Sander0542 commented 4 years ago

Yes, the integration will need to be changed to poll until the inverter is discovered.

Could you make a PR with the code needed to make this "bug" go away, please?