Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cbulock/lovelace-battery-entity
A custom Lovelace component for displaying battery levels for battery entities
https://github.com/cbulock/lovelace-battery-entity
battery-entities home-assistant lovelace
Last synced: about 16 hours ago
JSON representation
A custom Lovelace component for displaying battery levels for battery entities
- Host: GitHub
- URL: https://github.com/cbulock/lovelace-battery-entity
- Owner: cbulock
- License: apache-2.0
- Created: 2019-03-24T23:09:51.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2022-07-06T03:05:23.000Z (over 2 years ago)
- Last Synced: 2024-08-02T20:45:51.887Z (3 months ago)
- Topics: battery-entities, home-assistant, lovelace
- Language: JavaScript
- Size: 109 KB
- Stars: 201
- Watchers: 10
- Forks: 24
- Open Issues: 21
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-home-assistant - Battery Entity - Displaying battery levels for battery entities. (Dashboards / Custom Cards)
README
# Lovelace Battery Entity
A custom [Lovelace](https://www.home-assistant.io/dashboards/) card for displaying battery levels for battery entities for [Home Assistant](https://www.home-assistant.io/).
## Install
### Simple install
1. Download and copy [battery-entity.js](https://raw.githubusercontent.com/cbulock/lovelace-battery-entity/master/battery-entity.js) into your `config/www` directory.
2. Add a reference to `battery-entity.js` inside your `ui-lovelace.yaml`.
```yaml
resources:
- url: /local/battery-entity.js?v=0.1
type: module
```### Installation using Git
**Clone this repository into your `config/www` folder using git.**```console
$ git clone https://github.com/cbulock/lovelace-battery-entity.git
```**Add a reference to the card in your `ui-lovelace.yaml`.**
```yaml
resources:
- url: /local/lovelace-battery-entity/battery-entity.js?v=1
type: module
```## Updating
1. Find your `battery-entity.js` file in `config/www` or wherever you ended up storing it.2. Replace the local file with the latest one attached in the here: [battery-entity.js](https://raw.githubusercontent.com/cbulock/lovelace-battery-entity/master/battery-entity.js).
3. Add the new version number to the end of the cards reference url in your `ui-lovelace.yaml` like below.
```yaml
resources:
- url: /local/battery-entity.js?v=0.2
type: module
```*You may need to empty the browsers cache if you have problems loading the updated card.*
## Using the card
### Options
#### Card options
| Name | Type | Default | Since | Default | Description |
|------|------|---------|-------|---------|-------------|
| type | string | **required** | v0.1 | | `custom:battery-entity`
| entity | string | **required** | v0.1 | | An entity_id that has a percentage as a state.
| name | string | optional | v0.1 | *friendly_name* | Override the entities friendly name.
| warning | integer | optional | v0.1 | 35 | Sets the level at which the battery icon will be shown as yellow.
| critical | integer | optional | v0.1 | 15 | Sets the level at which the battery icon will be shown as red.### Example usage
```yaml
- type: custom:battery-entity
entity: sensor.front_door_lock_battery
```## License
This project is under the Apache License 2.0.