Skip to content

FIX to log in error #446

@artepe

Description

@artepe

Checklist

  • I have verified that the account and device works in the Comfort Cloud App.
  • This issue only contains 1 issue (if you have multiple issues, open one issue for each issue).
  • This issue is not a duplicate issue of currently previous issues..

What version of Home Assistant Core?

2026.4

Describe the issue

Bug: KeyError: 'domain' when adding integration

Description

Adding the Panasonic CC integration fails with KeyError: 'domain' in config_flow.py at line 49. The code attempts to access entry.data[KEY_DOMAIN] using direct dictionary indexing, but the domain key does not exist inside entry.data — it is a top-level attribute of the config entry, not part of the data payload.

Steps to Reproduce

  1. Open Home Assistant
  2. Go to Settings → Integrations → Add Integration
  3. Search for and select Panasonic CC
  4. Enter Comfort Cloud credentials and submit
  5. Integration fails with "Unknown error"

Error

File "/config/custom_components/panasonic_cc/config_flow.py", line 49, in _create_entry
    if entry.data[KEY_DOMAIN] == PANASONIC_DOMAIN:
       ~~~~~~~~~~^^^^^^^^^^^^
KeyError: 'domain'

Root Cause

config_flow.py line 49 uses entry.data[KEY_DOMAIN] which raises KeyError because the domain key is not present in entry.data. The fix is to use .get() instead:

# Before (broken)
if entry.data[KEY_DOMAIN] == PANASONIC_DOMAIN:

# After (fixed)
if entry.data.get(KEY_DOMAIN) == PANASONIC_DOMAIN:

Temporary Workaround (via SSH terminal)

Until this is fixed in a release, the patch can be applied manually via the Home Assistant SSH terminal:

1. Patch the file:

nano /config/custom_components/panasonic_cc/config_flow.py

Go to line 49 (Ctrl+_ → type 49 → Enter) and change:

if entry.data[KEY_DOMAIN] == PANASONIC_DOMAIN:

to:

if entry.data.get(KEY_DOMAIN) == PANASONIC_DOMAIN:

Save with Ctrl+XY → Enter.

2. Clear the Python cache (required or the fix won't take effect):

rm -rf /config/custom_components/panasonic_cc/__pycache__

3. Restart Home Assistant:

ha core restart

4. Re-add the integration:
Settings → Integrations → + Add Integration → Panasonic CC

Environment

  • Home Assistant version: 2026.4
  • Panasonic CC version: (installed via HACS)
  • Device: Panasonic CS-HZ25ZKE
  • Comfort Cloud API: connecting successfully (API login and device list confirmed working in logs)

Additional Notes

The Comfort Cloud API connection itself works fine — device data is retrieved successfully in the logs before the error occurs. The bug is purely in the config flow duplicate-entry check.

Error/Debug Logs


Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions