Hi there - thanks for the card! Iâm using a wiser heating integration which has recently changed which means I now have entities directly for battery percentage - i.e. the state is the actual percentage. I think because this card searches for certain attributes (battery_level being the important one likely) whatâs happening is the card displays not the percentage but what it finds as battery_level, and in this integration this is actually a string like âOne thirdâ. I can see in HA that the state is the battery percentage on the entity.
type: custom:battery-state-card
title: Battery Status
entities:
So for the above example I used to user an attribute: battery_percent and this would force the card mod to show the percentage. Iâm removed this and now I see âOne thirdâ for both primary and secondary which is obviously not what I want. How do I force the card mod to display just the state value? Thanks
For reference this used to work with the older integration:
Is there a way to actually hide the battery state values (or alternatively only show them as secondary info)? I want to gain some more space for the actual name of the entity and the battery level as such is indicated by the color so I donât need to see the exact percentages:
âŠstate is the actual percentage. I think because this card searches for certain attributes (battery_level being the important one likely) whatâs happening is the card displays not the percentage but what it finds as battery_level, and in this integration this is actually a string like âOne thirdâ
You are right, card currently prioritizes higher the âbattery_levelâ attribute over the state. This needs to be fixed. If you have a github account please create a bug.
I havenât used card_mod at all so I cannot help.
Hey All love t his card but can anyone explain to me why sometimes the entities come back with Unknown? I have gone into the companion app on those devices and made sure the sensors are enabled, but I still get this from time to time. Is it the config ? Below is my config. Any help is appreciated.
I see that this is a card preview when you add it from UI. The unknown states can appear at the beginning when the card config is changed. You need to wait little bit for Home Assistant to update the state.
If you see such behaviour after you add the card and refresh the page then something is wrong. Please check in the DeveloperTools the actual states for your entities. Maybe something wrong is with the integration and the state is actually not there.
Hi @maxwroc, thanks for your effort on this, nice card!
I have just now discovered it and gave it a try: result looks good.
I had a few minor issues:
The card does not show up under the card picker.
After adding a manual card and adding the yaml code, I got to see the preview.
Refreshing the browser and restarting HA didnât bring any change.
Adding âsecondary_info: last_changedâ did not reveal anything until the card was saved.
Yes, you are right. Card will show up in the card picker in v3.0 I think. To add it you need to chose âmanualâ option of adding the card.
Adding âsecondary_info: last_changedâ did not reveal anything until the card was saved
When you modify config in card picker you need to wait for the state refresh otherwise you wonât see the data. So you donât have to save/add the card but just need to wait little bit longer sometimes. More and more people ask about that kind of issues so I will think how to solve it (I have one idea)
Problem:
The charging state information is neither part of the entity state nor of the entity attributes. Instead it is part of another entities state (at least they share some part of the entity id), e. g.:
battery level (part of used group): sensor.phone_abc_battery_level
charging state: sensor.phone_abc_battery_state
I do not want to manually name the entities in the card configuration (because this doesnât scale for the lots of entities within my group) but keep the group definition.
- entity: sensor.phone_abc_battery_level
charging_state: # uses other entity state value
entity_id: sensor.phone_abc_battery_state
state: "Charging"
Question:
Is there currently a way to cross-reference the corresponding charging state entities to the battery level entities coming from the group?
If not/feature request:
Could we implement such a âcross-linkingâ, e. g. based on the entity id name? This way we could use a group as entity and use the âuses other entity state valueâ part already existing.
I really love this card for the info that it provides at a glance really good work.
I am new to HA and I have read this thread and also your instructions on the repo.
I was able to setup a basic card the way that I want (only have a few devices)
what I am trying to achieve is when a device is charging the percentage value to change to charging
i have tried a few different setups but they all change the icon to have a lightning symbol but this does not show charging in the location and does not change back to normal when i unplug
on HACS,
go to frontend and search battery-state-card and install the repo.
then you will be able to setup the card using manual card in your dashboard and paste in the code that you want.
thank you for this info.
with the binary sensor it updates quickly but i did wait a little for the update.
as soon as i add the below the icon changes even when the device is not charging