Thanks for this. I combined it with the conditional card, so that the status and colours are only displayed when it is online.
type: vertical-stack
cards:
- type: picture-elements
elements:
- type: conditional
conditions:
- entity: sensor.printer
state_not: unavailable
elements:
- type: state-badge
entity: sensor.printer
style:
top: 24%
left: 89%
- type: state-badge
entity: switch.printer_switch
style:
top: 89%
left: 89%
image: /local/hp.jpg
- type: conditional
conditions:
- entity: sensor.printer
state_not: unavailable
card:
direction: up
entities:
- color: MediumTurquoise
entity: sensor.printer_cyan_cartridge_hp_cf411x
name: Cyan CF411x
- color: MediumOrchid
entity: sensor.printer_magenta_cartridge_hp_cf413a
name: Magenta CF413a
- color: Gold
entity: sensor.printer_yellow_cartridge_hp_cf412a
name: Yellow CF412a
- color: Black
entity: sensor.printer_black_cartridge_hp_cf410a
name: Black CF410a
height: 200px
positions:
icon: inside
title: outside
max: 100
min: 0
padding: 2px
target: '5'
type: 'custom:bar-card'
unit_of_measurement: '%'
stack: horizontal
title: HP Color LaserJet MFP M477fdw
style: |-
bar-card-title {
text-shadow: 1px 1px 5px black;
}
bar-card-value {
text-shadow: 1px 1px 5px black;
}
