Change status word in dashboard

Is there a way to change the status wording.

I have a contact sensor that I am using to tell when something is full or empty. The icon says open or closed. Is there a way to change it so that when that specific Contact is closed it would actually say "empty" and if it is open to have it say "full"

It is the same sensor that I use for windows so I don't want it to be a global change.

Have not tried it myself but have you checked to see about editing the css under Advanced?

Not just yet (TMK, I can edit via inspect, but cannot target in CSS that due to location, could be my lack of CSS skillz).

However you will be able to soon via smartly, check here for details.

If you use smartly, you'll be able to set a different icon to either state to be more descriptive of what's empty or full. Here's a search I did for 'tray' and it shows a few options.

The CSS to do the text replacement is below:

#tile-99 .tile-primary>div {
  visibility: hidden;
  font-size: 0;
}

#tile-99 .tile-primary.open>div:after,
#tile-99 .tile-primary.closed>div:after {
    visibility: visible;
    font-size: 14px;
}

#tile-99 .tile-primary.open>div:after {
    content: "Full";
}

#tile-99 .tile-primary.closed>div:after {
    content: "Empty";
}
1 Like

Thank you that worked great.

2 Likes

dang it!! I had.... doesn't work look above.

#tile-99 .tile-primary.open>div { content: "Full"; }

soooo close. Thanks @spelcheck. figure linking would draw him out for @paul :laughing:

1 Like

Ah yes, very close! Know that you can't swap out actual content of an element, you can only hide what's there, make it take up no space, then use :before or :after (or both) to inject new text.

1 Like

Is there a way to custom color the background of a tile separate from the template, depending on the state of the tile? On vs Off?

@shawn.foist if you are using smartly 2.0 this is easily done via simple CSS. I do it for all my smartly dashes. We can now even do temperature reading based color coding. Details on the support site.

Getting my feet wet with CSS and have experimented with Smartly, it feels like it wants to grab the wheel to much for me right now. I will give it another look now that I am more familiar with CSS and how things are working.