New Plugin: Custom Attributes (for More-info cards)

pleased to announce the release version 1.0.0 or our new plugin Custom-attributes, that allows the user to control which attributes are displayed in the attributes dropdown on the more-info cards.

install as custom repo in HACS: Open your Home Assistant instance and open a repository inside the Home Assistant Community Store.

You can filter attributes that are shown, or unfilter attributes that HA filters by default.

@elchininet has been finetuning my suggestions, and has done most if not all of the coding, so kudos to him are in order!

If have been trying to keep custom-ui alive for years now, but the time has come to slowly say goodbye to that powerful plugin (it still is), and create more modern plugins to do some of its tasks separately.

Please checkin at the repo of Custom-attributes, have a look at its options and examples, and customize those attributes to your liking.

Want to take out all attributes on a light? no problem. There’s a powerful all filter.

filter_attributes:
  by_domain:
    light:
      - all

Want to see the device_class on domain binary_sensor (hidden by default)? go ahead.

unfilter_attributes:

  by_domain:
# filtered by Home Assistant by default
    binary_sensor:
      - device_class

You can filter and unfilter by_domain, by_glob, by_entity_id, and by_device_class.

You could even hide all attributes everywhere by setting:

filter_attributes:
  by_glob:

    '*.*':
      - all

The filter attributes works on all more-info cards, even when invoked from the developer-tools/state

Currently this is what I am using myself, and it cleans up the cards just perfectly:

##########################################################################################
# Custom attributes configuration settings                                               #
# use a config per Dashboard, and add it to the root of the yaml file like               #
#                                                                                        #
#      ############################################################################      #
#      # title: Your Dashboard title                                              #      #
#      #                                                                          #      #
#      # button_card_templates: !include_dir_merge_named ../button_card_templates #      #
#      # decluttering_templates: !include_dir_named ../decluttering_templates     #      #
#      # kiosk_mode: !include ../kiosk-mode/kiosk-mode.yaml                       #      #
#      # custom_attributes: !include ../custom_attributes/custom_attributes.yaml  #      #
#      #                                                                          #      #
#      # views:                                                                   #      #
#      #   - !include view_home.yaml                                              #      #
#      #   - !include view_number_two                                             #      #
#      #   - etc                                                                  #      #
#      ############################################################################      #
#                                                                                        #
##########################################################################################

# use the available 'debug' paramater if a filter does not work and you need to report
# malfunctioning to the issue tracker.

debug: true

##########################################################################################
# Unfilter                                                                               #
##########################################################################################

unfilter_attributes:

  by_domain:
# filtered by Home Assistant by default
    binary_sensor:
      - device_class

    sensor:
      - device_class

# filtered by User in the filter_attributes
  by_glob:

    'device_tracker.google*':
      - ip
      - mac
      - ap_mac

##########################################################################################
# Filter                                                                                 #
##########################################################################################

filter_attributes:

  by_glob:

    '*.*':
      - icon_color
      - id

# first filter 'all' in glob, then unfilter only what user needs in the unfilter section
    'device_tracker.google*':
      - all

    'sensor.ha_*_version':
      - all

    'sensor.buienradar_*':
      - Stationname

    'sensor.*_actueel': &meter # use a yaml anchor to easily c&p repetitive attributes
      - meter_type
      - meter_type_name

    'sensor.*_totaal': *meter

    'sensor.*_amperage': *meter

    'sensor.*_voltage': *meter

    'sensor.*_battery_state':
      - templates

  by_device_class:

    enum:
      - options

  by_domain:

    binary_sensor:
      - hysteresis

    light:
      - all

    siren:
      - available_tones

  by_entity_id:

    sensor.cpu_speed:
      - brand
      - arch

    group.media_players_device_trackers:
      - all

    group.hub_device_trackers:
      - all

thanks for checkin in!

4 Likes

Many thanks for this important feature. There are several places where custom attributes are necessary otherwise the attributes have to be managed e.g. with separate excel sheets in parallel. I am looking for custom attributes which can be added to the attributes in the list of devices as additional column(s). There are always attributes which would be necessary to show in such list. This could be for example an “Equipment identification” (in German: Betriebsmittelkennzeichen) according to IEC81346. In the entity list it could be a “Signal identification” according to relevant standards. Also an additional “Remark” attribute as column would be helpfull. An attribute column in such lists gives you a much better and quicker overview. And along with additional attributes there should be a possibility to do a CSV-export of the lists (device list, entity list, helper list). May be there is such a solution somewhere and I did not find it until now. After more than 30 years working in industrial automation I have now time to dig deeper into my private home automation. Homeassistant is a very impressing tool for that and motivates me to learn a lot of new things.