🔋 Lovelace: Battery state card

On you last screen it looks like the color of the SiPhone is not updated as well. Please open dev tools in the browser (F12) and check the Console tab if there are any errors related to the card. In case of the error the update process can brake and the result may be random (maybe that is the case here).

Probably a bug in HA because I noticed it was saying it could not load ‘battery state car’ when I tried to add the card in lovelace. So I added one letter behind type: ‘custom:battery-state-card’ and removed the extra letter again and then it loaded.

This is what’s in the Console tab:

I assume you have checked it when you were getting the wrong icons in the UI, right? If so I really cant tell what might be wrong

Yes it’s usually always that way as evertime I go into HA it’s the first time so rarely refresh the page to fix it. Anyway, thanks, based on running out of ideas guess I can try another card or something. Not a super big deal but family is asking why the question marks when they look at the page so not idea.

You can give it a try with this one Lovelace Battery Entity Card. It doesn’t have too many settings but it displays the battery states in similar way. If you try it out please let me know if it worked.

FYI: I have installed 0.113.3 and I have a repro in one case. This means that probably I should be able to fix it. It might be hard though - as you were saying it doesn’t repro after refresh.

In HA v0.113 they have updated MDI icons - maybe something is messed up. I’m pretty sure I haven’s seen such problem before. Neither anyone was reporting it.

@jriker1, @davefi Have you used this card before HA v0.113.X?

Yep, I started using it around 6th June, so that would have been around release 0.110 I believe. I’ve had the problem since I first installed it, so its not new to 0.113.

I also check (just forgot to post!) and mine does it on 2 out of 4 sensors. They are all Hue, 2 are Motion Sensors, 2 are Remotes. I have the ? on one of each, so it doesn’t seem related to the device type either!

image

It is only doing it on the ones reading 100% though, I have never seen it on the other two sensors.

I also tried the live view, and that works fine - comes up immediately with all the correct icons, and no ? shown:

1 Like

Hey all,
sorry, not sure what im doing wrong here.

i want to show the secondary info as the charging state.

AS you can see the state is currently “not charging” but its showing as "charging

type: 'custom:battery-state-card'
name: Secondary info
secondary_info: last_updated
entities:
  - entity: sensor.iphone_battery_level
    secondary_info: Charging # only appears when charging is detected
    charging_state:
      attribute:
        name: "Battery State"
        value: 'Charging'

It should be lowercase

secondary_info: charging
1 Like

:man_facepalming:

sorry! that work, thanks

Same problem… i have ? in each sensor (100% and 95%)

I really would like to help you guys and fix this issue but I cannot find any consistent repro. In my case it happened once on my dektop (Win + Chrome) and once on my iPad. Switching to different HA tab and back or refreshing the page fixes the issue and I cannot repro it any more (even if I re-launch the browser).
I have tried clearing web app storage in browser (in incognito mode) but it didn’t help.

I need to find the way to consistently repro this issue :frowning_face:

What automation are you guys using to get a notification if a battery is say at 10% showing the one that is 10% ?

Hello

I am unable to get tap action to work. When I hover over with my mouse it changes the cursor, but when i click (or tap on my phone) nothing happens. Any thoughts?

type: 'custom:battery-state-card'
title: Batteries
sort_by_level: desc
entities:
  - entity: sensor.schlage_door_lock_battery
    name: Front Door
    tap_action: more-info

Hey, please try to follow the example from doc/readme. It should be:

    tap_action:
      action: more-info

It is a very common mistake so I will think about adding the support for setting the string instead of object

That worked, thanks!

Hey, I’m happy to inform you guys that the bugs which were there for a long time are fixed now!

@jriker1 @davefi @Marco_Lupieri The question mark bug should be gone in v1.5.0 :slight_smile:

@Zkaning Collapsed view / expanding groups should work as well now on iOS devices

Please let me know if you still can repro one of these issues!

1 Like

Thansk Maks, looks like it’s working. Will try a bit more but after I cleared my browser cache it seemed good. Now to find my iPhone and see if it still happens.

1 Like

Nice! All seems to be working here as intended now, thank you for managing to track it down :slight_smile:

1 Like