As the topic suggests, I was wondering if there was a way to change the “Unknown Entity” to a static icon (preferably) or a static image?
Use Case: I have battery monitors that are only used when charging certain batteries not permanently connected to a charger (Car battery, spare battery etc) and just wanted a static icon to show when the node is not physically connected. Side note, these entities that go offline are volt gauges with min/max etc.
Is there a special card that can accommodate this, or maybe more importantly, can this be done?
Option 2: When there are more devices you could use teh auto-entities card and search all entities in status unknown. Irrevant devices can be excluded using a dedicated label (or other way arround and include label only)
Hi thanks for the reply, but I actually just want to display an icon in place of the “Unknown Entities” box that crops up when an entity goes offline for a prolonged period of time. I just find the whole:
thing a little off-putting on an otherwise clean dashboard.
Apologies, for the misunderstanding, I do tend to be vague when explaining things sometimes.
I think what morlies is suggesting is to use visibility to show/hide what you want to see. You can hide the offending entity. You can also use another card with inverse visibility settings to display in its place. That way you can show whatever you like.
Noob question, how would I go about using “another card with inverse visibility settings to display in its place”? as that may be an option for me to display 1 or 2 sensors from another entity on the same card I don’t already have showing (If that makes any sense at all)
Depending on the layout you use and where it is in your layout, you may just be able to put both cards below each other, because you’ll only ever see one.
Apologies for all the questions, but the dashboard is not even remotely something I am comfortable writing code for as it always kicks my butt.
Edit: Also, what happens in the case with your scenario, where both entities are actually available, would this not cause problems which one it displays, or would the first card then take precedence?
You want to set a default value or placeholder when your sensor is offline.
I would create a template sensor for your dashboard. The template sensor has the same value when the original is online. Otherwise set a default value like “offline”, “0” or whatever you prefer.
I don’t want to steal recognition. Check that thread, probably it helps. Check the post which is marked as solution.
I’m afraid you are heading into turbulent waters here with template sensors etc lol, I manage to scrape by with the bare minimum on HA, so templates have not even been touched by me yet. I am currently just using HA raw with it’s own sql, no MQTT.
I think I may just rethink my strategy here, as I was hoping it would be as simple as:
I don’t know what sensor or implementation you are using. But when it’s MQTT you should check on your device if you have the option to set retain flag or LWT.
The technical background, retain means, the last message is kept in the queue and HA shows the last update but entity is still available.
LWT means “last will and testament” - > when a sensor (actor) goes offline in a planned way like a shutdown it sends a message which is kept and HA knows that it’s offline but still exists.
You need to check the implemention or documentation. I assume it’s described and covered somehow.
I do not have MQTT, I only have HA’s sql that comes with Home Assistant (Changed my previous comment to state this, as I saw where the confusion I created came from).
For now I think I need to just live with the Unavailable Entity thing, until I have progressed far enough to actually start making templates etc (it’s been a real learning curve as it is, having no past experience in coding, so you can imagine the fun I had with all the nodes).
I miss-read, my bad. I started a few weeks back but I’m a developer in real life so that’s not a problem for me.
Do some testing and define what’s important. When you are familiar with the architecture throw away your playground and start from scratch. Probably the issue solves by itself …
It will work with any card. Visibility options are quite new, some places it does not work yet, if not you can use a conditional card and put the card you want to hide in it.
As for two available entities: you asked for putting another entity in place if the first one is unavailable. So I made them look at the same entity. If you let each one look at their own availability, both might show, or both might disappear. If you build the view right, that may also look nice.
I honestly doubt you miss-read, as I mentioned, I have a bad habit of explaining things terribly :/.
There’s so much going on in my HA currently, that I would dread starting from scratch, but yes, I do understand your reasoning behind that remark, it would actually benefit me, if I eventually did that, just in terms of getting rid of bad code/habits lol.
Gauges is not a place, but a card type. But where you want to put it matters a bit. But regardless, place a conditional card where you want the gauge, then inside that, put the gauge. The effect is the same.
Edit. I’m missing something obvious here, the code I have for the 2 conditional cards are to only show the card when the state is Not unavailable. It seems that whether I change this to the normal state or state not, the gauge just keeps being displayed.
I did notice that while I was moving the 2 cards to the front of the que where the current gauges were (With the arrows left and right in the card while under edit), it would vanish for a split second and then re-appear