dennis1804 / homewizard-climate-hass

14 stars 7 forks source link

Not working after 30m/1h with Error Connection to remote host was lost. - goodbye #22

Closed Pascal4Games closed 7 months ago

Pascal4Games commented 8 months ago

Hello, have you already found a solution for the problem that after restarting home assistant or reloading the integration, it stops working after 30m/1h? Because I can't find anything about it (but I may have missed it).

If problem still exists, I think I have found a temporary solution with the help of automations in side of home assistant. The automation is looking in the log and when the error message "Connection to remote host was los. -goodbye" comes he reloads the integration.

See explain below:

Automation

alias: Homewizard Climate Reload
description: ""
trigger:
  - platform: event
    event_type: system_log_event
    event_data:
      level: ERROR
      name: websocket
      message:
        - Connection to remote host was lost. - goodbye
condition: []
action:
  - service: shell_command.homewizard_reload
    data: {}
  - delay:
      hours: 0
      minutes: 2
      seconds: 30
      milliseconds: 0
mode: single

add inside configuration.yaml:

system_log:
  fire_event: true
shell_command:
   homewizard_reload: 'curl -X POST "http://[HA_IP]:8123/api/config/config_entries/entry/[config_entry]/reload" --oauth2-bearer "[Long-lived access token]"'

Replace in the shell_command: [HA_IP] => Home assistant local ip [config_entry]=> integration > homewizard climate > device > inside the url-bar you see config_entry=xxxx [Long-lived acces token] => under profile, scroll down and create a acces code.

dennis1804 commented 8 months ago

Sorry for not being so active here, i don't use homeassistant that often. it should be fixed in the latest version of the websocket, (0.0.27 for sure, but i think 0.0.26 also) but please let me know if it's not working for you.

Pascal4Games commented 7 months ago

I have now had it running for 24 hours on my test system without any problem. So now just transferred to main system. Thank you.