muppet3000 / homeassistant-growatt_server_api

Home Assistant Integration for Growatt - Upstream repo for the growatt_server integration that is part of the Core Home Assistant repository
MIT License
52 stars 6 forks source link

BUG - Intermittently Stops Working #46

Open ghost opened 7 months ago

ghost commented 7 months ago

Hi

Thank you very much for all your hard work with this integration. It works very well most of the time. However several times a day the integration stops working. If I reload the integration it works fine again. I have set HA to restart every hour via an automation and this works but I wonder if there is another way? Is it possible to check every few minutes if the integration is working and if not automatically reload it??

Saentist commented 7 months ago

This will automatically ban you

ghost commented 7 months ago

Banned from where/what?? If you mean Growatt then I have been restarting HA every hour for over a week or so with no ban

muppet3000 commented 7 months ago

I'm not sure what @Saentist is talking about, all that happens is that your account gets blocked for about 24 hours. While your suggestion seems good unfortunately that's not how the integration (and more accurately the blocking from Growatt) works. What happens is that they block your account and either the next time you try to log in (which is what happens when you reload the integration or restart home assistant) it won't let you, or your account just hangs until the temporary block expires. This is the reason I've been directing everyone over to use Grott instead (take a look at my other GitHub project), I've put together steps on how to set it up and also how to use my integration to display information with it. Sorry I can't be more help.

Saentist commented 7 months ago

@JansonBHong @muppet3000 hope this is more clear apple image on android is written for 24h image

access via website is possible

dlangamer commented 4 months ago

I was having the same problem. Workaround I found:

SCAN_INTERVAL = datetime.timedelta(minutes=10)
THROTTLE = datetime.timedelta(minutes=10)

Captura de tela 2024-02-16 111456

alias: Check API Growatt
description: ""
trigger:
  - platform: time_pattern
    hours: /1
condition: []
action:
  - service: homeassistant.reload_config_entry
    data:
      entry_id: 1ca45a0d2fca0811b9e58ce3d782baa1
    alias: Reload API Growatt
mode: single
Anteus commented 1 month ago

Saw another automation here https://github.com/home-assistant/core/issues/109927#issuecomment-2096611186 which only reloads the config if it's unavailable, maybe this works with entry_id too?

alias: Check API Growatt
description: ""
trigger:
  - platform: time_pattern
    hours: /1
condition: []
condition:
  - condition: state
    entry_id: 1ca45a0d2fca0811b9e58ce3d782baa1
    state: unavailable
action:
  - service: homeassistant.reload_config_entry
    data:
      entry_id: 1ca45a0d2fca0811b9e58ce3d782baa1
    alias: Reload API Growatt
mode: single