core: Intergas intergration failing after core upgrade to 2024.2.x

The problem

Intergas intergration was working fine for an extended period of time, till I ran the upgrade of core-2024.1.x to 2024.2.0 (and later 2024.2.1).

Best guess is the Python version upgrade that came with core-2024.2 broke the intergration. Boot log states that the intergration is not responding for over 300 seconds, which disables the intergration in order to continue the boot.

What version of Home Assistant Core has the issue?

core-2024.2.x

What was the last working version of Home Assistant Core?

core-2024.1.x

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Intergas InComfort/Intouch Lan2RF gateway

Link to integration documentation on our website

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

Diagnostics information

No response

Example YAML snippet

# Intergas Gateway
incomfort:
  host: 192.168.0.xxx
  username: admin
  password: xxxxxxxxx

Anything in the logs that might be useful for us?

Logger: homeassistant.setup
Source: setup.py:335
First occurred: 15:16:47 (1 occurrences)
Last logged: 15:16:47

Setup of 'incomfort' is taking longer than 300 seconds. Startup will proceed without waiting any longer

Additional information

Webinterfae of the gateway is available. Credentials are confirmed working. Both gateway as home assistant hot and cold booted multiple times. Native gateway android app is working as intended.

About this issue

  • Original URL
  • State: open
  • Created 5 months ago
  • Comments: 33 (3 by maintainers)

Most upvoted comments

@USRFSledge if you have access to the host terminal you could execute docker exec -it homeassistant /bin/bash, then from within the container execute sed -i 's/CLIENT_TIMEOUT = 20/CLIENT_TIMEOUT = 300/g' /usr/local/lib/python3.12/site-packages/incomfortclient/__init__.py.

If you dont have access to the host terminal, define the shell command as per my first post, adn then create an automation (see below for reference):

alias: Fix Incomfort
description: ""
trigger: []
condition: []
action:
  - service: shell_command.fix_incomfort
    metadata: {}
    data: {}
mode: single

Once setup, just trigger the automation manually and reboot HA Core. Hope this helps!

I will take a look at it today… else it could take a while this will be fixed… i guess

Code is pretty minimal, and think python 3.12 broke it

@zxdavb I am not ready to take this responsibility yet, as per my previous post. Just wanted to share my 2 cents to help others. If this is indeed to be fixed from the calling code in HA as per your comments on the PR, I suggest this will be discussed with the owners of the calling code. For now I consider myself merely to be a helpful end-user of HA.

@USRFSledge Glad to help a fellow Dutchie! Agree there is something more to it as the log states it taking more than 300 seconds. Considering my bootup didnt take that long I went bughunting. Took me a while considering I have been using HA only for a week…

I have been able to work around this until a fixture can be applied: Workaround is to set timeout in the incomfortclient library to a sufficiently high value. Downside is this needs to be reapplied after every Home Assistant Core update.

docker exec command to achieve this is:

docker exec -it homeassistant sh "/bin/sed -i 's/CLIENT_TIMEOUT = 20/CLIENT_TIMEOUT = 300/g' /usr/local/lib/python3.12/site-packages/incomfortclient/__init__.py" Alternatively one could create a shell command which can be triggered per the usual ways:

shell_command:
  fix_incomfort: /bin/sed -i 's/CLIENT_TIMEOUT = 20/CLIENT_TIMEOUT = 300/g' /usr/local/lib/python3.12/site-packages/incomfortclient/__init__.py

afterwards restart homeassistant…disco !!