Skip to content

Mariusthvdb/custom-attributes

Repository files navigation

Custom attributes for Home Assistant

hacs_badge GH-release GH-downloads GH-last-commit GH-code-size

What is Custom attributes

This is a custom Plugin for Home Assistant to customize which entity attributes are displayed in the Dashboard on more-info cards. Moreover, if configured so that no more attributes are left to display (all attributes are filtered), the attributes dropdown box is not rendered at all.

From now on you are in control of the More-info attributes. Filter all, unfilter all, or select which to see/hide by glob, domain, device_class, or entity_id. Any combination is possible!

Custom attributes gives the user ultimate control over the attributes in the More-info panel.

If you want to hide the more-info panel completely, use Kiosk-mode, which is the ultimate tool for that and much more.

Note: This replaces the existing custom-ui-more-info.js standalone script, or the more-info functionality in the original Custom-ui.


Installation

Download and install the plugin like any other custom resource in Home Assistant.

Open your Home Assistant instance and open a repository inside the Home Assistant Community Store.

Enable

To enable the plugin one needs to add the custom_attributes parameter to the root of the lovelace yaml file of each Dashboard:

custom_attributes:
   # Configuration

Configuration options

5 configuration options available:

  • debug
  • filter_all
  • unfilter_all
  • filter_attributes
  • unfilter_attributes
custom_attributes:
  debug: true
  filter_all: true
  unfilter_all: true
  filter_attributes:
    # parameters
  unfilter_attributes:
    # parameters   

The parameters control which attributes should be (un)filtered in the more-info dialogs.

Available parameters:

4 'by' parameters alowing detailed customization on various levels, requiring an array of attributes

  • by_entity_id
  • by_domain
  • by_device_class
  • by_glob

All possible options:

custom_attributes:

  debug: true/false
  filter_all: true ##
  filter_attributes:
    by_entity_id:
      sensor.some_sensor:
        - <attribute>
        - <attribute>
    by_domain:
      binary_sensor:
        - <attribute>
        - <attribute>
    by_device_class:
      motion:
        - <attribute>
        - <attribute>
    by_glob:
      'sensor.*_sensor':
        - <attribute>
        - <attribute>
      '*.*':
        - <attribute>

# identical structure for 'unfilter' on all parameters

  unfilter_all: true ##
  unfilter_attributes:
    by_entity_id:

    by_domain:

    by_device_class:

    by_glob:

Special filter 'all'

The all filter is available for all parameters:

filter_attributes:
  by_domain:
    light:
      - all

and here, will filter all attributes on all Domain Light more-info panels.

Filter merge

Finally, all configured filters are merged. To check the complete filter that gets applied, enable debug: true and open an Inspector window, where the full JSON object is printed.

Examples

Please find some real life examples here which explains all available options in detail.

Result of Custom Attributes in the More-info panel

Before filtering:

Device_class attribute options

Device class options before

Siren:

Siren before

Light group:

Light group before

After filtering

Device_class attribute options after ('Mogelijke statussen' in Dutch)

Device class options after

Siren after:

Siren after

Light group after:

Light group after