battery-state-card: Entities are not showing when sort option is present in the config
Upgraded to latest version 3.1.1 and something broke, my card was showing only 2 entries. Reverting to 3.1.0 all works as expected.
Describe the bug
How to reproduce Upgrade to 3.1.1.
Expected behavior
YAML configuration type: custom:battery-state-card title: Battery levels (<70%) tap_action: more-info secondary_info: ‘{last_changed}’ colors: steps: - ‘#ff0000’ - ‘#ffff00’ - ‘#00ff00’ gradient: true sort: by: state filter: exclude: - name: state value: 70 operator: ‘>’ - name: entity_id value: sensor.front_door_battery - name: entity_id value: binary_sensor.living_room_motion_sensor_1_battery_low include: - name: attributes.device_class value: battery collapse: 6 entities:
- entity: sensor.xxx_s_iphone_battery_level name: xxx’s phone
please paste here your card config
**Screenshots**
<!-- If applicable, add screenshots to help explain your problem. -->
**Version**
<!-- What is the version of the card? -->
<!-- If regression happened after updating Home assistant please add HA version as well. -->
About this issue
- Original URL
- State: closed
- Created 6 months ago
- Comments: 38 (13 by maintainers)
Yep, I can confirm that removing sort fixes the issue. I’ll wait for a fix (the next release) before upgrading.
Sort seems to be the issue here. Once I removed sort from mine everything showed up again.
I tried… sort: state
I even tried… sort: by: state
In both cases, none of the batteries will display. As soon as I remove sort everything appears again. So, I’m suspecting this is a code defect in the sort code.
the same here.
remove
for now solve problem, but list isnt sorted 📦 waiting for fix
Found the disable cache, let me try again
On Mon, 8 Jan 2024 at 20:39, Max Chodorowski @.***> wrote:
Yes it helps a lot. I was suspecting that this might be the problem but I thought that the code cannot be in such state that this particular line breaks…
I’ll try to figure out how come this state of the card was possible.
Thanks!
I have the same problem. I have both entities and filter to add all the entities I want. Like this.
If I remove the entities part the sort function is working. If I remove the filter part , and only have the entities part, the sort function is also working. If both used together the sort function is not working, and nothing is shown.
Hi Max, It’s GB, I’m in the UK so it’s 98.5. Let me try using default_state_formatting: false and I’ll come back shortly.