Git Product home page Git Product logo

lovelace-battery-entity's Introduction

Lovelace Battery Entity

A custom Lovelace card for displaying battery levels for battery entities for Home Assistant.

Install

Simple install

  1. Download and copy battery-entity.js into your config/www directory.

  2. Add a reference to battery-entity.js inside your ui-lovelace.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.

$ git clone https://github.com/cbulock/lovelace-battery-entity.git

Add a reference to the card in your ui-lovelace.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.

  3. Add the new version number to the end of the cards reference url in your ui-lovelace.yaml like below.

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

- type: custom:battery-entity
  entity: sensor.front_door_lock_battery

License

This project is under the Apache License 2.0.

lovelace-battery-entity's People

Contributors

cbulock avatar jcwillox avatar royto avatar thelastproject avatar wrt54g 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

lovelace-battery-entity's Issues

Use in HASSIO Supervisor

I attempted to add the repository to the Supervisor, but could not find any reference. I'm probably not implementing this properly. How else can I bring the js file into HASSIO? Thanks.

Support for battery level as attribute

For some entities, battery level is an attribute of an entity.

image

Please add support for attributes.

- type: custom:battery-entity
  entity: sensor.front_door_lock_battery
  attribute: battery_level

Help is needed.

Help is needed. I can’t set it up like yours. My battery icon is moving off.
2019-08-12_181338
How to fix it? And tell me how to output several sensors, like yours. You can see your lovelace code.

Support for binary battery status

For my "Minut Point" devices they only return Battery health in binary form; it would be good if we could get support for Binary battery status

Support for "charging" state

Hi, thanks for the component.

It would be great if you could add an option to specify a boolean entity which indicates if the battery is currently charging.

So you could represent this:
image
instead of this:
image

Wildcard

It would be great to add wildcards like in monster card

sensor.battery_*

Custom color and threshold values.

  1. Being able to user select the colors would be nice, so the colors could be adapted to user themes.
  2. Would be nice to custom set the threshold values
  3. I have a water sensor which can run on batteries and cord. When used with cord, the battery value is constant 4%. Would be nice to have a “ignore_value” parameter. When this is set, the card for the sensor would display battery full. When the value suddenly differs from the “ignore_value” (the sensor is on battery power) the usual logic is applied for displaying the sensor battery level.

Just my 50 cent : )

Clickable link to entity history

I really like the battery entity card, thanks for your effort.

For a 'entities'-element, it is possible to click on a entity. In that case the 'history graph' for that entity is shown in a pop-up screen. Is it possible to add this feature to the battery entity card? Right now it is not possible to see directly how battery levels have evolved (apart from adding extra cards).

UI doesn't reflect the battery level change in real time

Hi, thanks for the component.

It looks like the UI does not reflect the battery state change in real time, but instead a page reload is needed.

I've placed in my lovelace the following:

- entity: sensor.cellphone_batt
  name: sensor.cellphone_batt (standard)
- entity: sensor.cellphone_batt
  name: sensor.cellphone_batt (battery-entity)
  type: custom:battery-entity

This is the result:
GIF 10-03-2020 07-58-45

Any clue ?

alignment off % numbers

I've installed your battery entity card
but de alignment off te % number is off
its really close to the edge.

screenshot-hassio local-8123-2019 04 06-07-12-58

Handle when entity does not exists

I configure a set of entities with battery level.

I made a typo in one of my entity and none of the battery level was displayed.

Handle entity not found and display error

Battery card does not seem in mobile phone application

Hi,
The battery card has been configured on the web ui, but it is visible only if the tab has been reloaded where the card has been placed of it it is on the first tab and it does only seem in the Android application v1.9.0-167 if the card has been placed on the first tab of the UI otherwise it is not visible, because the mobile app does not have the reload option per tab.

Having a wifi icon as an option?

Thanks for the great work, so much appreciated! That would be lovely to have also an option for WiFi status. I would love to show my tasmotized devices wifi status with this card.

Card-Background color

Hi
first time Thank you for your work.
I have the "problem" that my card does not have the same background as all of my other cards. the background of the lovelace battery entity card is 100% transparent. how can I set this card so that it has the standard background like all my other cards?
bgc1
bgc2

Support high/low

It would be useful to also support battery types that return high/low etc and map them to a value

Add support for usage in Auto Entities card

I'd like to use the card in the auto-entities lovelace card using the following config:

card:
  title: Low Batteries
  type:  'custom:battery-entity'
filter:
  include:
    - attributes:
        battery: < 30
    - attributes:
        battery_level: < 30
show_empty: false
type: 'custom:auto-entities'

Unfortunately it renders no card at all as this.stateObj is null on the first render (at least).

Card Blacklisted

Hi

I'm getting 'Repository is Blacklisted' and cannot re-install the card via HACS.

Problem on Home assistant 0.108.1

Hi,
Now i'm on latest version 0.108.1 and I have a vertical stack card with some lovelace-battery-entity configured .
Nothing is visible, but If I go in lovelace's configuration the preview is shown.
any idea?

Thanks, and ehi... great job your integration!

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.