Search-based Entity Mapping (avoiding copy/paste)
File: packages/grow_mapping_tool.yaml
The problem this solves
Dashboard 1’s mapping fields are plain input_text helpers. Typed by hand,
that means looking up each entity ID elsewhere in Home Assistant, copying
it, and pasting it into the right field - tedious and error-prone across ~30
fields.
The solution: a script exposing a native searchable entity picker
Home Assistant’s entity selector (the same search-and-pick widget used
throughout the automation/script editor) can be exposed as a script field,
and script fields with selectors render as a proper form with real search on
the Developer Tools -> Actions page. This project ships one generic
script, script.grow_assign_mapping, that uses this to let you search for
and pick a device instead of typing an entity ID.
How to use it
- Go to Developer Tools -> Actions (older HA: “Services”).
- Search for the action “Grow Assistant: Set Mapping”
(
script.grow_assign_mapping). - In “Mapping field”, pick which Grow Assistant function you want to assign (e.g. “Dehumidifier IO”). This dropdown supports typing to filter.
- In “Target entity”, search for and select your actual device/sensor entity. Leave it empty to clear that mapping instead.
- Click Perform Action. The corresponding
input_text.grow_map_*helper is set automatically - no entity ID lookup or copy/paste needed. - Repeat for every function you want to map. The “Setup Status” card on Dashboard 1 updates as you go.
Why this and not a picker directly embedded in the dashboard
Home Assistant does not (as of this writing) render selector-based fields inline in a dashboard card without a HACS custom card. Developer Tools -> Actions is a fully native, no-HACS way to get the same searchable picker widget. A nicer one-click, in-dashboard picker (e.g. via a custom card) is a reasonable candidate for the visual-polish pass in Phase 9, once the functional workflow has proven itself - it is not required for Phase 1 to be usable.
Adding new mapping fields later
If a future phase introduces a new mappable function, add it in two places
in packages/grow_mapping_tool.yaml:
- A new option under the
mapping_keyselector’soptionslist. - A new entry in the
helper_for_keyvariable’s Jinja dictionary, pointing at the correspondinginput_text.grow_map_*helper entity ID.