Mlin
November 19, 2022, 6:00pm
1
I made a card for an entity.
I would now like to add more of these cards for this type of entity.
Is there a way i can template this so i can just specify
"smartplug_n"
and it will get
voltage, current, power, ...
without having to put it there manualy?
rccoleman
(Rob Coleman)
November 19, 2022, 6:13pm
2
As I see , the person needs to re-use the card which is a stack with 2 cards.
For this - use custom:decluttering-card.
Then you will only need to call a template with “smartplug_n”.
Mlin
October 15, 2023, 3:44pm
4
Thank’s! could you elaborate?
I extracted the text from the image, since my HA Corrupted and i had no Backup
type: vertical-stack
cards:
- type: entities
entities:
- entity: switch.smart_plug_2
state_color: true # Enable state color for this entity.
show_name: false # Hide the entity name.
show_icon: true # Show the entity icon.
show_state: true # Show the entity state.
- type: glance
entities:
- entity: sensor.smart_plug_2_voltage
- entity: sensor.smart_plug_2_current
- entity: sensor.smart_plug_2_power
- entity: sensor.smart_plug_2_energy
- entity: sensor.smart_plug_2_total_daily_energy
these options does not belong to Entities card:
show_name: false # Hide the entity name.
show_icon: true # Show the entity icon.
show_state: true # Show the entity state.
they are a part of the Glance card.
If you wish to create a decluttering template from your stack card:
template:
my_super_template:
card:
type: vertical-stack
cards:
- type: entities
entities:
- entity: switch.[[DEVICE_NAME]]
...
- type: glance
entities:
- entity: sensor.[[DEVICE_NAME]]_voltage
- entity: sensor.[[DEVICE_NAME]]_current
- entity: sensor.[[DEVICE_NAME]]_power
...
using:
type: custom:decluttering-card
template: my_super_template
variables:
- DEVICE_NAME: smart_plug_2
Check Github for the decluttering card & a dedicated Community thread for docs & examples.
2 Likes