- Notifications
You must be signed in to change notification settings - Fork66
Show multiple entity states and attributes on entity rows in Home Assistant's Lovelace UI
License
benct/lovelace-multiple-entity-row
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Show multiple entity states, attributes and icons on entity rows in Home Assistant's Lovelace UI
NOTE: This is not a standalone lovelace card, but a row element for theentities card.
Manually addmultiple-entity-row.jsto your<config>/www/
folder and add the following to theconfiguration.yaml
file:
lovelace:resources: -url:/local/multiple-entity-row.js?v=4.5.1type:module
OR install usingHACS and add this (if in YAML mode):
lovelace:resources: -url:/hacsfiles/lovelace-multiple-entity-row/multiple-entity-row.jstype:module
The above configuration can be managed in the Configuration -> Dashboards -> Resources panel when not using YAML.
This card produces anentity-row
and must therefore be configured as an entity in anentities 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 tofalse 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 | Customsecondary_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 |
Similarly as the default HAentities
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, eitherentity
,attribute
oricon
needs to be specified.entity
is only required if you wantto display data from another entity than the main entity specified above.attribute
is necessary if you want to display an entityattribute value instead of the state value.icon
lets you display an icon instead of a state or attribute value(works well together with a customtap_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 (orfalse to hide) |
unit | string/bool | unit_of_measurement | Override entity unit of measurement (orfalse 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 thathold_action
anddouble_tap_action
are currentlynot supported on additional entities.
Some special data fields from HA can be displayed by setting theattribute
field to the following values:
Value | Description |
---|---|
last-changed | Renders thelast_changed state of the entity if available |
last-updated | Renders thelast_updated state of the entity if available |
Thesecondary_info
field can either beany 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 (orfalse to hide) |
unit | string/bool | unit_of_measurement | Override entity unit of measurement (orfalse 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 |
This card supports all the default HA actions. SeeLovelace Actionsfor 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 whenaction ismore-info | |
service | string | Service to call whenaction iscall-service | |
service_data | object | Optional data to include whenaction iscall-service | |
url_path | string | URL to open whenaction isurl | |
navigation_path | string | Path to navigate to whenaction isnavigate | |
confirmation | bool/object | false | Enable confirmation dialog |
haptic | string | none | Haptic feedback (success ,warning ,failure ,light ,medium ,heavy ,selection ) |
Theformat
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 | number | Divide number value by 1000 (ex.1500 W ->1.5 kW ) |
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 |
Thehide_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 options listed below.
Name | Type | Description |
---|---|---|
above | number | Hidden if entitynumber value is above the specified value |
below | number | Hidden if entitynumber value is below the specified value |
value | list/any | Hidden if value matches specified value or any value in a list |
type:entitiesentities: -entity:sensor.bedroom_temperaturetype:custom:multiple-entity-rowname:One entitysecondary_info:last-changedentities: -sensor.bedroom_max_temp -entity:sensor.bedroom_temperaturetype:custom:multiple-entity-rowname:Two entitiessecondary_info:last-changedentities: -sensor.bedroom_min_temp -sensor.bedroom_max_temp -entity:sensor.bedroom_temperaturetype:custom:multiple-entity-rowname:Three entitiessecondary_info:last-changedentities: -entity:sensor.bedroom_humidityname:humidity -sensor.bedroom_min_temp -sensor.bedroom_max_temp -entity:sensor.bedroom_temperaturetype:custom:multiple-entity-rowname:Custom secondary_infosecondary_info:attribute:battery_levelname:Batteryunit:'%' -type:section -entity:vacuum.xiaomi_vacuum_cleanertype:custom:multiple-entity-rowname:Attributesentities: -attribute:battery_levelname:Batteryunit:'%' -attribute:statusname:Status -entity:sensor.lovelace_multiple_entity_rowtype:custom:multiple-entity-rowname:Attributes (show_state=false)show_state:falseentities: -attribute:stargazersname:Stars -attribute:open_issuesname:Issues -attribute:open_pull_requestsname:PRs -type:section -entity:sensor.bedroom_temperaturetype:custom:multiple-entity-rowname:Hide headers (name)entities: -entity:sensor.bedroom_min_tempname:false -entity:sensor.bedroom_max_tempname:false -entity:sensor.bedroom_temperaturetype:custom:multiple-entity-rowname:Main state headerstate_header:currententities: -sensor.bedroom_min_temp -sensor.bedroom_max_temp -type:section -entity:switch.livingroom_tvtype:custom:multiple-entity-rowname:Toggletoggle:truestate_color:trueentities: -entity:sensor.livingroom_tv_powername:Power -entity:sensor.livingroom_tv_power_totalname:Total -entity:switch.livingroom_tvtype:custom:multiple-entity-rowname:Multiple togglesstate_header:maintoggle:truestate_color:trueentities: -entity:switch.livingroom_lightname:toggle1toggle:true -entity:switch.livingroom_light_2name:toggle2toggle:true -type:section -entity:light.living_roomtype:custom:multiple-entity-rowname:Toggle with hold_actionstate_header:Livingroomtoggle:falsehold_action:action:toggleentities: -entity:light.nightstandname:Bedroomtap_action:action:toggle -entity:light.living_roomtype:custom:multiple-entity-rowname:Icons with tap_actionsecondary_info:last-changedentities: -entity:light.living_roomicon:mdi:palette -icon:mdi:lightbulb-off-outlinestate_color:truetap_action:action:call-serviceservice:light.turn_offservice_data:entity_id:light.living_room -icon:mdi:lightbulb-outlinestate_color:truetap_action:action:call-serviceservice:light.turn_onservice_data:entity_id:light.living_roomconfirmation:text:'Are you sure?' -type:section -entity:sensor.bedroom_temperaturetype:custom:multiple-entity-rowname:Customizationicon:mdi:fireunit:°Fsecondary_info:last-changedentities: -entity:sensor.bedroom_max_tempname:custom nameunit:temp -type:section -entity:sensor.bedroom_temperaturetype:custom:multiple-entity-rowname:Stylesstyles:width:80pxtext-align:rightsecondary_info:attribute:battery_levelstyles:font-weight:boldentities: -entity:sensor.bedroom_max_tempstyles:width:80pxtext-align:left
xiaomi-vacuum-card |multiple-entity-row |github-entity-row |battery-entity-row |attribute-entity-row
About
Show multiple entity states and attributes on entity rows in Home Assistant's Lovelace UI
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Uh oh!
There was an error while loading.Please reload this page.