Giter VIP home page Giter VIP logo

lovelace-attribute-entity-row's Introduction

attribute-entity-row

Show entity attribute value(s) on entity rows in Home Assistant's Lovelace UI.

GH-release GH-last-commit GH-code-size

Note: Semi-deprecated in favor of multiple-entity-row card, so this card will most likely not be further worked upon.

Setup

Add attribute-entity-row.js to your <config>/www/ folder. Add the following to your ui-lovelace.yaml file:

resources:
  - url: /local/attribute-entity-row.js?v=1.1.2
    type: js

Options

Name Type Default Description
type string Required custom:attribute-entity-row
entity string Required sensor.my_sensor
name string Override entity name / friendly_name
name_attribute string Use an attribute as the entity name
unit string Override state unit_of_measurement
toggle bool false Display a toogle instead of state
hide_state bool false Hide the entity state
primary object see below Primary attribute object
secondary object see below Secondary attribute object

Primary/secondary object

Name Type Default Description
key string Required A valid attribute key within the entity
name string Name / prefix for attribute
unit string Unit / postfix for attribute
entity string Use attribute from another entity

Example

attribute-entity-row

type: entities
title: attribute-entity-row
show_header_toggle: false
entities:
  - type: section
    label: Primary attribute

  - entity: sensor.smoke_sensor_livingroom_temperature
    type: custom:attribute-entity-row
    primary:
      key: battery_level
      name: Battery
      unit: '%'
  - entity: light.living_room
    type: custom:attribute-entity-row
    primary:
      key: min_mireds
      name: 'Attribute:'
  - entity: media_player.spotify
    type: custom:attribute-entity-row
    primary:
      key: media_title

  - type: section
    label: Toggle

  - entity: light.living_room
    type: custom:attribute-entity-row
    name: Light with Toggle
    toggle: true
    primary:
      key: min_mireds
      name: Mireds
  - entity: switch.power_office_pc
    type: custom:attribute-entity-row
    toggle: true
    primary:
      key: friendly_name

  - type: section
    label: Customization

  - entity: sensor.smoke_sensor_livingroom_temperature
    type: custom:attribute-entity-row
    name: Custom Name
    primary:
      key: battery_level
      name: Battery
      unit: '%'
  - entity: sensor.motion_hall_temperature
    type: custom:attribute-entity-row
    name: Sensor
    primary:
      key: battery_level
      name: 'Value:'
      unit: units
  - entity: sensor.motion_hall_temperature
    type: custom:attribute-entity-row
    name: Sensor
    unit: Unit
    primary:
      key: battery_level
      name: Battery
      unit: '%'

  - type: section
    label: Secondary attribute

  - entity: sensor.magnet_door_main_temperature
    type: custom:attribute-entity-row
    secondary:
      key: battery_level
      name: Battery
      unit: '%'
  - entity: vacuum.xiaomi_vacuum_cleaner
    type: custom:attribute-entity-row
    primary:
      key: battery_level
      name: Battery
      unit: '%'
    secondary:
      key: status
  - entity: vacuum.xiaomi_vacuum_cleaner
    type: custom:attribute-entity-row
    primary:
      key: status
      name: 'Status:'
    secondary:
      key: battery_level
      name: Battery
      unit: '%'

  - type: section
    label: Alternative entity

  - entity: sensor.smoke_sensor_livingroom_temperature
    type: 'custom:attribute-entity-row'
    primary:
      key: fan_speed
      name: 'Vacuum fan:'
      entity: vacuum.xiaomi_vacuum_cleaner
  - entity: sensor.template_smoke_sensor_livingroom
    type: custom:attribute-entity-row
    primary:
      key: battery_level
      name: Other entity attribute
      entity: sensor.smoke_sensor_livingroom_temperature
    secondary:
      key: status
      name: Another entity -
      entity: vacuum.xiaomi_vacuum_cleaner

  - type: section
    label: Hide State

  - entity: sensor.smoke_sensor_livingroom_temperature
    type: custom:attribute-entity-row
    hide_state: true
    primary:
      key: battery_level
      name: Battery
      unit: '%'
  - entity: sensor.smoke_sensor_livingroom_temperature
    type: custom:attribute-entity-row
    name: With secondary
    hide_state: true
    primary:
      key: battery_level
      name: Battery
      unit: '%'
    secondary:
      key: status
      entity: vacuum.xiaomi_vacuum_cleaner

Partially based on @thomasloven's slider-entity-row lovelace card.

My cards

xiaomi-vacuum-card | github-entity-row | multiple-entity-row | attribute-entity-row

BMC

lovelace-attribute-entity-row's People

Contributors

benct avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

ujstudio web-dc

lovelace-attribute-entity-row's Issues

Not_home on device trackers

When showing device trackers Not_home is shown rather than the newer Away / Zone Name.

I know this is semi-depreciated ... and I use normally use multiple-entity-row instead ... but there are a few rare situations where I need to use this instead.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.