{"id":21970581,"url":"https://github.com/benct/lovelace-battery-entity-row","last_synced_at":"2025-04-28T11:16:54.434Z","repository":{"id":53807673,"uuid":"303857065","full_name":"benct/lovelace-battery-entity-row","owner":"benct","description":"Show battery states or attributes with dynamic icon on entity rows in Home Assistant's Lovelace UI","archived":false,"fork":false,"pushed_at":"2021-03-12T15:50:43.000Z","size":66,"stargazers_count":71,"open_issues_count":3,"forks_count":6,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-28T11:16:49.405Z","etag":null,"topics":["attribute","battery","card","entity","entity-rows","hacs","home-assistant","home-assistant-frontend","lovelace","lovelace-ui","state"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/benct.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-10-14T00:02:44.000Z","updated_at":"2025-04-21T18:50:19.000Z","dependencies_parsed_at":"2022-08-22T06:41:29.588Z","dependency_job_id":null,"html_url":"https://github.com/benct/lovelace-battery-entity-row","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benct%2Flovelace-battery-entity-row","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benct%2Flovelace-battery-entity-row/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benct%2Flovelace-battery-entity-row/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benct%2Flovelace-battery-entity-row/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/benct","download_url":"https://codeload.github.com/benct/lovelace-battery-entity-row/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251302782,"owners_count":21567601,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["attribute","battery","card","entity","entity-rows","hacs","home-assistant","home-assistant-frontend","lovelace","lovelace-ui","state"],"created_at":"2024-11-29T14:40:23.044Z","updated_at":"2025-04-28T11:16:54.415Z","avatar_url":"https://github.com/benct.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# battery-entity-row\n\nShow battery states or attributes with dynamic icon on entity rows in Home Assistant's Lovelace UI\n\n[![GH-release](https://img.shields.io/github/v/release/benct/lovelace-battery-entity-row.svg?style=flat-square)](https://github.com/benct/lovelace-battery-entity-row/releases)\n[![GH-downloads](https://img.shields.io/github/downloads/benct/lovelace-battery-entity-row/total?style=flat-square)](https://github.com/benct/lovelace-battery-entity-row/releases)\n[![GH-last-commit](https://img.shields.io/github/last-commit/benct/lovelace-battery-entity-row.svg?style=flat-square)](https://github.com/benct/lovelace-battery-entity-row/commits/master)\n[![GH-code-size](https://img.shields.io/github/languages/code-size/benct/lovelace-battery-entity-row.svg?color=red\u0026style=flat-square)](https://github.com/benct/lovelace-battery-entity-row)\n[![hacs_badge](https://img.shields.io/badge/HACS-Default-orange.svg?style=flat-square)](https://github.com/hacs)\n\nRewritten and improved version of cbulock's [battery-entity](https://github.com/cbulock/lovelace-battery-entity) card _(deprecated/unmaintained)_.\n\n**NOTE:** This is not a standalone lovelace card, but a row element for the [entities](https://www.home-assistant.io/lovelace/entities/) card.\nIf you need a standalone card or want _a lot_ more customizability, check out maxwroc's [battery-state-card](https://github.com/maxwroc/battery-state-card).\n\n## Installation\n\nManually add [battery-entity-row.js](https://raw.githubusercontent.com/benct/lovelace-battery-entity-row/master/battery-entity-row.js)\nto your `\u003cconfig\u003e/www/` folder and add the following to the `configuration.yaml` file:\n\n```yaml\nlovelace:\n  resources:\n    - url: /local/battery-entity-row.js?v=1.3.1\n      type: module\n```\n\n_OR_ install using [HACS](https://hacs.xyz/) and add this (if in YAML mode):\n\n```yaml\nlovelace:\n  resources:\n    - url: /hacsfiles/lovelace-battery-entity-row/battery-entity-row.js\n      type: module\n```\n\nThe above configuration can be managed directly in the Configuration -\u003e Lovelace Dashboards -\u003e Resources panel when not using YAML mode,\nor added by clicking the \"Add to lovelace\" button on the HACS dashboard after installing the plugin.\n\n## Configuration\n\nThis card produces an `entity-row` and must therefore be configured as an entity in an [entities](https://www.home-assistant.io/lovelace/entities/) card.\n\nThe battery level value is fetched from the entity `state`, from the attribute `battery` or `battery_level`,\nor from a custom attribute defined with the `attribute` option. Numeric values (`0-100`) and some predefined\nstring values (`high`, `normal`, `low`, etc..) are supported as a battery level value.\n\n| Name            | Type        | Default         | Description                                                                    |\n| --------------- | ----------- | --------------- | ------------------------------------------------------------------------------ |\n| type            | string      | **Required**    | `custom:battery-entity-row`                                                    |\n| entity          | string      | **Required**    | `domain.my_entity_id`                                                          |\n| attribute       | string      | `battery_level` | Override battery level attribute                                               |\n| name            | string      | `friendly_name` | Override entity `friendly_name`                                                |\n| secondary\\_info | string      |                 | `last-changed`, `last-updated` or an attribute of the entity.                  |\n| unit            | string/bool | `%`             | Override default `unit`, or hide with `false`                                  |\n| icon            | string      |                 | Override dynamic battery `icon`                                                |\n| warning         | number      | `35`            | Level at which the icon will appear yellow                                     |\n| critical        | number      | `15`            | Level at which the icon will appear red                                        |\n| charging        | bool/object | `false`         | Indicate charging based on entity state. See charging object for more options. |\n\nCurrently limited support for `secondary_info` option with value `last-changed`.\n\n### Charging object\n\n| Name      | Type        | Default              | Description                                          |\n| --------- | ----------- | -------------------- | ---------------------------------------------------- |\n| entity    | string      | `main entity`        | Get charging state from another entity               |\n| attribute | string      |                      | Get charging state from an attribute                 |\n| state     | string/list | `\"on\"`, `\"charging\"` | Add values that indicate charging (case insensitive) |\n\n## Examples\n\n![battery-entity-row](https://raw.githubusercontent.com/benct/lovelace-battery-entity-row/master/example.png)\n\n```yaml\ntype: entities\nentities:\n  - type: custom:battery-entity-row\n    entity: sensor.bedroom_temperature\n\n  - type: custom:battery-entity-row\n    entity: sensor.bedroom_temperature\n    attribute: battery_percent\n    name: Some battery\n    unit: percent\n    icon: mdi:battery-alert\n    secondary_info: last-changed\n    warning: 50\n    critical: 25\n    charging: true\n\n  - type: custom:battery-entity-row\n    entity: sensor.bedroom_temperature\n    name: Charging battery\n    charging:\n      entity: binary_sensor.bedroom_temperature_charger\n      attribute: charging\n      state:\n        - Enabled\n        - is_charging\n```\n\nUsage in [auto-entities](https://github.com/thomasloven/lovelace-auto-entities) card:\n\n```yaml\ntype: custom:auto-entities\ncard:\n  type: entities\nfilter:\n  include:\n    - entity_id: sensor.battery*   # or use other matchers\n      options:\n        type: custom:battery-entity-row\n        \u003cbattery-entity-row options\u003e\n```\n\n## My cards\n\n[xiaomi-vacuum-card](https://github.com/benct/lovelace-xiaomi-vacuum-card) |\n[multiple-entity-row](https://github.com/benct/lovelace-multiple-entity-row) |\n[github-entity-row](https://github.com/benct/lovelace-github-entity-row) |\n[battery-entity-row](https://github.com/benct/lovelace-battery-entity-row) |\n[~~attribute-entity-row~~](https://github.com/benct/lovelace-attribute-entity-row)\n\n[![BMC](https://www.buymeacoffee.com/assets/img/custom_images/white_img.png)](https://www.buymeacoff.ee/benct)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenct%2Flovelace-battery-entity-row","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbenct%2Flovelace-battery-entity-row","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenct%2Flovelace-battery-entity-row/lists"}