Online / offline devices on picture-elements card

Good Morning,
I would like to use a picture-element card and place some device tracker entities on it. If they are online (home) they should appear on the card, and if they are offline (away), the badge should disappear. (Like the HP Badge in my floorplan below)

Can someone please help me with the code?
Thanks in advance,


I not exactly sure, but there should be a row on each device in your klown_devices.yaml saying hide if away or something like that.

Check that out. Set it to true or false depending if you want it to show if away or not.