lovelace-auto-entities
lovelace-auto-entities copied to clipboard
Cannot exclude MacBook model from list of batteries
Setting up a card to show all batteries, I exclude some device models that I do not want to see, but cannot set a generic rule to exclude MacBook running the HomeAssistant app.
type: custom:auto-entities
card:
type: entities
title: Batteries
state_color: true
filter:
exclude:
- device_model: ZBMINIL2
- device_model: Smart-UPS_1000
- device_model: '*iPad*'
- device_model: '*iPhone*'
- entity_id: sensor.macbook_pro_steve_internal_battery_level
- entity_id: sensor.macbook_pro_steve_internal_battery_state
include:
- entity_id: sensor.*battery*
sort:
method: state
reverse: false
numeric: true
In the filter exclude section I tried to exclude device_model: Mac14,10 and 'Mac' etc, but did not succeed in suppressing entities of my MacBook Pro from the results. In the end I had to explicitly exclude by entity_id
Are other devices properly excluded? if yes - then probably this is not an issue for auto-entities card, this an incorrect device_model. Or maybe these Mac entities are just not associated to a device.
The model was auto detected when I installed the HomeAssistant app on the MacBook Pro. I was wondering if the issue could be related to the model name with a comma ',' in it: Mac14,10
Check here:
core.device_registry:
So, both ways (using "*" and exact name with a comma) work.
For simplicity - try this code:
type: custom:auto-entities
card:
type: entities
filter:
include:
- device_model: DEV_NAME_OF_MAC
Don't know the solution to the problem at hand, but may I suggest to use this filter:
filter:
include:
- attributes:
device_class: battery