MCPcopy Index your code
hub / github.com/benct/lovelace-multiple-entity-row

github.com/benct/lovelace-multiple-entity-row @v4.6.1

Chat with this repo
repository ↗ · DeepWiki ↗ · release v4.6.1 ↗ · + Follow
44 symbols 133 edges 24 files 0 documented · 0%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

multiple-entity-row

Show multiple entity states, attributes and icons on entity rows in Home Assistant's Lovelace UI

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

NOTE: This is not a standalone lovelace card, but a row element for the entities card.

Installation

Manually add multiple-entity-row.js to your <config>/www/ folder and add the following to the configuration.yaml file:

lovelace:
  resources:
    - url: /local/multiple-entity-row.js?v=4.6.1
      type: module

OR install using HACS and add this (if in YAML mode):

lovelace:
  resources:
    - url: /hacsfiles/lovelace-multiple-entity-row/multiple-entity-row.js
      type: module

The above configuration can be managed in the Configuration -> Dashboards -> Resources panel when not using YAML.

Configuration

This card produces an entity-row and must therefore be configured as an entity in an entities card.

Name Type Default Description
type string Required custom:multiple-entity-row
entity string Required Entity ID (domain.my_entity_id)
attribute string Show an attribute instead of the state value
name string/bool friendly_name Override entity friendly name
unit string/bool unit_of_measurement Override entity unit of measurement
icon string icon Override entity icon or image
image string Show an image instead of icon
toggle bool false Display a toggle (if supported) instead of state
show_state bool true Set to false to hide the main entity
state_header string Show header text above the main entity state
state_color bool false Enable colored icon when entity is active
column bool false Show entities in a column instead of a row
styles object Add custom CSS styles to the state element
format string Formatting Format main state/attribute value
entities list Entity Objects Additional entity IDs or entity object(s)
secondary_info string/object Secondary Info Custom secondary_info entity
tap_action object Actions Custom tap action on entity row and state value
hold_action object Custom hold action on entity row
double_tap_action object Custom double tap action on entity row

Entity Objects

Similarly as the default HA entities card, each entity can be specified by an entity ID string, or by an object which allows more customization and configuration.

If you define entities as objects, either entity, attribute or icon needs to be specified. entity is only required if you want to display data from another entity than the main entity specified above. attribute is necessary if you want to display an entity attribute value instead of the state value. icon lets you display an icon instead of a state or attribute value (works well together with a custom tap_action).

Name Type Default Description
entity string A valid entity_id (or skip to use main entity)
attribute string A valid attribute key for the entity
name string/bool friendly_name Override entity friendly name (or false to hide)
unit string/bool unit_of_measurement Override entity unit of measurement (or false to hide)
toggle bool false Display a toggle if supported by domain
icon string/bool false Display default or custom icon instead of state or attribute value
state_color bool false Enable colored icon when entity is active
default string Display this value if the entity does not exist or should not be shown
hide_unavailable bool false Hide entity if unavailable or not found
hide_if object/any Hiding Hide entity if its value matches specified value or criteria
styles object Add custom CSS styles to the entity element
format string Formatting Format entity value
tap_action object Actions Custom entity tap action

Note that hold_action and double_tap_action are currently not supported on additional entities.

Special attributes

Some special data fields from HA can be displayed by setting the attribute field to the following values:

Value Description
last-changed Renders the last_changed state of the entity if available
last-updated Renders the last_updated state of the entity if available

Secondary Info

The secondary_info field can either be any string if you just want to display some text, an object containing configuration options listed below, or any of the default string values from HA (entity-id, last-changed, last-updated, last-triggered, position, tilt-position, brightness).

Name Type Default Description
entity string A valid entity_id (or skip to use main entity)
attribute string A valid attribute key for the entity
name string/bool friendly_name Override entity friendly name (or false to hide)
unit string/bool unit_of_measurement Override entity unit of measurement (or false to hide)
hide_unavailable bool false Hide secondary info if unavailable or not found
hide_if object/any Hiding Hide secondary info if value matches specified criteria
format string Formatting Format secondary info value

Actions

This card supports all the default HA actions. See Lovelace Actions for more detailed descriptions and examples.

Name Type Default Description
action string Required more-info, toggle, call-service, url, navigate, fire-dom-event, none
entity string Override entity-id when action is more-info
service string Service to call when action is call-service
service_data object Optional data to include when action is call-service
url_path string URL to open when action is url
navigation_path string Path to navigate to when action is navigate
confirmation bool/object false Enable confirmation dialog
haptic string none Haptic feedback (success, warning, failure, light, medium, heavy, selection)

Formatting

The format option supports the following values:

Value Type Description
relative timestamp Convert value to relative time (5 minutes ago)
total timestamp Convert value to relative time (5 minutes)
date timestamp Convert timestamp value to date
time timestamp Convert timestamp value to time
datetime timestamp Convert timestamp value to date and time
brightness number Convert brightness value to percentage
duration number Convert number of seconds to duration (5:38:50)
duration-m number Convert number of milliseconds to duration (5:38:50)
duration-h number Convert number of hours to duration (5:38:50)
invert number Convert number from positive to negative or vice versa
kilo / kilo<0-9> number Divide number value by 1,000 (ex. 1500 -> 1.5)
mega / mega<0-9> number Divide number value by 1,000,000 (ex. 2500000 -> 2.5)
milli / milli<0-9> number Multiply number value by 1,000 (ex. 0.2 -> 200)
position number Reverses a position percentage (ex. 70% open -> 30% closed)
precision<0-9> number Set decimal precision of number value (precision3 -> 18.123)
celsius_to_fahrenheit number Converts a Celsius temperature to its Fahrenheit equivalent
fahrenheit_to_celsius number Converts a Fahrenheit temperature to its Celsius equivalent

kilo/mega/milli on their own default to a maximum of 2 decimal places. Suffix a digit (kilo3, mega1, milli0, ...) to request an exact decimal precision instead, the same way precision<0-9> does.

None of kilo/mega/milli/invert/position change the displayed unit — they only scale or transform the number. If you want the unit label to match (e.g. W -> kW), set unit: explicitly alongside the format:

- entity: sensor.power_usage
  type: custom:multiple-entity-row
  format: kilo
  unit: kW

Hiding

The hide_if option can be used to hide an entity if its state or attribute value matches the specified criteria. It can be used directly with a string, number or boolean value (i.e. hide_if: 'off'), as a list with several values, or as an object with one or more of the option

Core symbols most depended-on inside this repo

entityStateDisplay
called by 30
src/entity.js
computeStateDisplay
called by 17
src/lib/compute_state_display.js
formatNumber
called by 16
src/lib/format_number.js
hideIf
called by 12
src/util.js
setConfig
called by 10
src/index.js
isObject
called by 9
src/util.js
checkEntity
called by 9
src/entity.js
entityName
called by 7
src/entity.js

Shape

Function 29
Method 13
Class 2

Languages

TypeScript100%

Modules by API surface

src/index.js15 symbols
src/util.js7 symbols
src/entity.js7 symbols
src/lib/format_number.js5 symbols
src/lib/seconds_to_duration.js2 symbols
src/lib/compute_state_display.js2 symbols
src/index.test.js2 symbols
src/styles.js1 symbols
src/lib/format_time.js1 symbols
src/lib/format_date_time.js1 symbols
src/lib/format_date.js1 symbols

For agents

$ claude mcp add lovelace-multiple-entity-row \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page