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
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.
Hide card if empty.
Sort Ascending (lowest battery top)
Include / list all devices with battery in its āentity idā or ādevice classā
Exclude any ābattery stateā entities, and Good Health states, ( āGoodā battery health, charging/discharging state)
Exclude any battery level above 25% remaining.
Rename all devices to remove the word ābatteryā
Iām trying to do a wildcard to include all my nest protects battery health sensors, then use a state map to convert the āokā and āreplaceā states to 100 and 25 respectively. However, this isnāt working:
filter:
include:
- name: entity_id
value: '*_nest_protect_battery_health'
state_map:
- from: Ok
to: 100
- from: Replace
to: 25
This unfortunately isnāt applying the state map and instead I get this:
State map belongs to the ācommon settingsā so it can be used in entity or card (to be applied for all entities). You cannot specify state_map for filter. I think in your case the card-level settings will work as expected
type: 'cusom:battery-state-card'
state_map:
- from: Ok
to: 100
- from: Replace
to: 25
filter:
include:
- name: entity_id
value: '*_nest_protect_battery_health'
Oh yeah that is true - I have a silly way of detecting whether it is a regex pattern or not (regexp flags wonāt work). I will fix it - I have created a task to track it https://github.com/maxwroc/battery-state-card/issues/159
What is the right way to use this to show a card that only has battery levels less than some percentage (e.g. 30)? When I try to include entities based on state filter, using <30, itās going across all entities and not just battery level sensors. So Iām trying to figure out how to combine both a entity ID filter then apply a state level filter.
FYI the bug with regexp filters not respecting flags is fixed now in v1.6.0
Is there a way to do 2 levels of sorting? By battery level, and by entity name?
No it is not possible now, sorry. If you want to have such option please create issue on github - maybe Iāll add it next time (especially when more people would be interested in that kind of functionality).
Iām thinking nowā¦ maybe it make sense to add sorting by name (when val is the same) as a default behavior whenever user used filters?
FYI If you have tried 1.6.0 youāve probably realized that the regex bug is still there. I have released accidentally the previous version of the card code. It is fixed now (added new release 1.6.1 with correct code )
I have been using it for quite a while now without any problems. Just recently, after the upgrade to the latest version, the secondary_info disappeared. So I downgraded to the previous version, but the secondary_info is still missing.
Where there any major changes or do I miss something really important?