diff --git a/src/components/entity/ha-entity-state-picker.ts b/src/components/entity/ha-entity-state-picker.ts index d8f48df8b77f..4f6c06bbe828 100644 --- a/src/components/entity/ha-entity-state-picker.ts +++ b/src/components/entity/ha-entity-state-picker.ts @@ -77,17 +77,27 @@ class HaEntityStatePicker extends LitElement { })); }); - const options: StateOption[] = []; - const optionsSet = new Set(); + const optionLabels: Record = {}; for (const entityOptions of entitiesOptions) { for (const option of entityOptions) { - if (!optionsSet.has(option.value)) { - optionsSet.add(option.value); - options.push(option); + if (!(option.value in optionLabels)) { + optionLabels[option.value] = [option.label]; + } else { + const labels = optionLabels[option.value]; + if (!labels.includes(option.label)) { + labels.push(option.label); + } } } } + const options = Object.entries(optionLabels).map( + ([value, labels]) => ({ + value, + label: labels.join(" / "), + }) + ); + if (this.extraOptions) { options.unshift(...this.extraOptions); }