core: Honeywell integration cookies are leaking, breaking deCONZ w/ HTTP error 431

The problem

After upgrading my several-month-old installation of hass core, I discovered that deCONZ was no longer working, generating HTTP 431 Request Header Fields Too Large errors when I attempted to access the Phoscon integration or toggle lights and the like.

After a bunch of investigation, I discovered that the header in question was a massive cookie header. The cookie in question was .ASPXAUTH_TRUEHOME, the auth cookie from aiosomecomfort. Somehow, that cookie was leaking out of honeywell’s cookie jar and into the jar that was being used for deCONZ, causing it to break. Once I disabled the honeywell integration and restarted hass, everything started working again.

What version of Home Assistant Core has the issue?

core-2025.6.2

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

honeywell

Link to integration documentation on our website

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

Diagnostics information

No response

Example YAML snippet


Anything in the logs that might be useful for us?


Additional information

No response

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Reactions: 2
  • Comments: 27 (4 by maintainers)

Most upvoted comments

Quick follow-up, I asked Gemini about this. It agreed with my logic above. Interestingly, it also clarified the expected behavior when you have multiple accounts. In that scenario, only the first account will use async_get_client_session (e.g. the shared aiohttp), and all subsequent accounts will create their own. Hence, creating new aiohttp instances is a core part of how the integration operates when you move beyond one account.

Older versions of aiohttp can miss same named cookies. If you are manually injecting cookies you shouldn’t be using the shared session.

Thank @chemelli74. I appreciate your help.

I believe I’ve located the source of “pollution” - can anyone attempt to use 0.0.33 for the aiosomecomfort API? (Simply modify the manifest file)

I asked Gemini how to do this and captured the answer here: https://m.l1k.cc/raw/b8qvjd

These worked for me. Remember to add a comma on the manifest.json line above where you add the version number.

I am familiar with coding, but not an expert on this. I believe that the change should not impact how HA connects to Honeywell and don’t think that it should impact API limits. The fix essentially forces HA to create a new aiohttp session every time it reaches out to Honeywell vs relying on the shared aiohttp session. It is the use of the separate session that fixes the problem since it avoids “polluting” other integrations using the shared session. Hence, the change is really about how HA connects to Honeywell internally (dedicated vs shared session) vs changing what is sent to Honeywell and what frequency.

That is my understanding. However, someone else can correct me if I am off base.

Edit: I want to add that this is hopefully a temporary fix and not a permanent situation.

Can you share your patch? If it is easy to implement perhaps we can use it as workaround until we wait for the formal fix from the Honeywell maintainers?

Not pretty but as a temporary patch all I did is at line 59 in homeassistant/components/honeywell/__init__.py, change 1 to -1, causing it to always call async_create_clientsession(hass) to obtain a new aiohttp session to initialize the aiosomecomfort instance, rather than using async_get_clientsession(hass) when there is only one honeywell device configured. So the section starting at line 59 now reads:

if len(hass.config_entries.async_entries(DOMAIN)) > -1:
    session = async_create_clientsession(hass)
else:
    session = async_get_clientsession(hass)

I believe this should be safe but use at your own risk. After changing this code you need to restart homeassistant.

I am using honeywell integration and have been working with owner of another integration airq which started to fail with 2025.6.0. Following a few other issues all related to the aiohttp update, the airq owner also went with async_create_clientsession. One of the odd things for us until now, is that not everyone with air-q seemed to be affected by the 2025.6.0. With the discovery of honeywell behaving this way, it makes more sense.

See https://github.com/home-assistant/core/issues/146694 and https://github.com/home-assistant/core/pull/147027

Can you share your patch? If it is easy to implement perhaps we can use it as workaround until we wait for the formal fix from the Honeywell maintainers?

Not pretty but as a temporary patch all I did is at line 59 in homeassistant/components/honeywell/__init__.py, change 1 to -1, causing it to always call async_create_clientsession(hass) to obtain a new aiohttp session to initialize the aiosomecomfort instance, rather than using async_get_clientsession(hass) when there is only one honeywell device configured. So the section starting at line 59 now reads:

    if len(hass.config_entries.async_entries(DOMAIN)) > -1:
        session = async_create_clientsession(hass)
    else:
        session = async_get_clientsession(hass)

I believe this should be safe but use at your own risk. After changing this code you need to restart homeassistant.