Skip to content

ConditionSelector visual editor rejects valid list-based entity_id in Config Flow #25741

@0x3333

Description

@0x3333

Checklist

  • I have updated to the latest available Home Assistant version.
  • I have cleared the cache of my browser.
  • I have tried a different browser to see if it is related to my browser.
  • I have tried reproducing the issue in safe mode to rule out problems with unsupported custom resources.

Describe the issue you are experiencing

When using selector.ConditionSelector in a ConfigFlow/OptionsFlow, the UI correctly allows me to save a condition whose entity_id is a single-item list. However, if I reopen the integration entry and click Configure again, the visual condition editor fails to load that saved value and shows:

The provided value for 'entity_id' is not supported by the visual editor. We support (string) but received (["climate.boiler"]).
You can still edit your config using YAML.

The condition editor refuses to load the existing condition and shows the error about entity_id expecting a string but receiving a list.

  • The initial creation of the condition works without errors.
  • Only on re-opening for editing does the UI mis-interpret the stored list value.
  • This appears to be a mismatch between what the ConditionSelector outputs (a list) and what it accepts on re-import (a string).

Image

Context: https://community.home-assistant.io/t/selector-conditionselector-inconsistency/899965

Describe the behavior you expected

The visual editor should accept the saved condition (either by normalizing the list to a string for a single entity or by supporting a single-item array), load the existing values in the form, and allow further editing without falling back to YAML.

Steps to reproduce the issue

  1. Implement a custom integration with a ConfigFlow/OptionsFlow schema including:

    schema_options = {
        …,
        vol.Optional(CONF_CONDITION, default=default_condition): selector.ConditionSelector(),
    }
  2. In the UI, add a numeric_state condition for climate.boiler (the editor produces):

    condition:
      condition: numeric_state
      entity_id:
        - climate.boiler
      attribute: current_temperature
      below: 60.0
  3. Save the entry. The integration runs and evaluates the condition successfully.

  4. Go back to Settings → Devices & Services → Integrations, locate your entry and click Configure.

What version of Home Assistant Core has the issue?

2025.5.3

What was the last working version of Home Assistant Core?

No response

In which browser are you experiencing the issue?

Firefox 138.0 on macOS

Which operating system are you using to run this browser?

macOS Sequoia

State of relevant entities

Problem-relevant frontend configuration

JavaScript errors shown in your browser console/inspector

Additional information

Discord thread: https://discord.com/channels/330944238910963714/1257019582112334014/threads/1382082850400112701

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions