8000 Fixed per-field entity-domain prefix (sensor./switch.) for Home Assistant config forms · Issue #39 · edge-mining/app · GitHub
[go: up one dir, main page]

Skip to content

Fixed per-field entity-domain prefix (sensor./switch.) for Home Assistant config forms #39

Closed

Description

@markoceri

Overview

Home Assistant entity fields in the configuration forms should display a fixed, non-editable domain prefix (e.g. sensor., switch.) as a chip, so the user only types the entity id and cannot enter an inconsistent/invalid prefix.

This already exists for Energy Monitor and Energy Load History Provider via the sensorPrefix flag on ConfigSchemaForm, but it has two limitations:

  1. It is hardcoded to sensor. — every entity field gets the same sensor. prefix.
  2. It is not enabled everywhere — Forecast Provider, Energy Load Forecast Provider and Miner Controller currently render the full entity id as free text.

Problem

The single sensor. prefix cannot represent forms that mix entity domains. The clearest example is the Generic Socket (Home Assistant) mi 8000 ner controller, whose config mixes:

  • entity_switch → switch.miner_socket (domain switch.)
  • entity_power → sensor.miner_power (domain sensor.)

A global sensor. prefix would be wrong for entity_switch.

Proposed solution

  • Make the fixed prefix per-field instead of a single global sensor.: derive the entity domain for each field (e.g. from the field's default value such as switch.miner_socket → switch., or sensor.… → sensor.), falling back to sensor. when no hint is available.
  • Render that per-field prefix as the fixed chip, with the user typing only the entity id (object id) after it.
  • Enable the prefix on the remaining Home Assistant forms: Forecast Provider, Energy Load Forecast Provider and Miner Controller, for a consistent experience across all HA-based configuration forms.

Activity

  1. self-assigned this
    on Jun 28, 2026
  2. added 2 commits that reference this issue on Jul 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    0