C8 - Dashboard - Relay Status

Hello Folks,

(This is my first post)

I would like to create a custom Dashboard tile that represents the status of a relay.
I found an existing template option that displays the words "Off" or "On".

I would like to take it a step further by changing the background color, and displaying the words "Occupied" or "Vacant.

Any pointers on how to achieve this?

Thanks in advance,
Tim

Example custom name for a contact tile. Red when opened and grey when closed. I used this on a tile #51 of my dashboard.

}

#tile-51 .tile-primary>div {
visibility: hidden;
position: relative;
}
#tile-51 .tile-primary>div:after {
position: absolute;
left:0;
width: 100%;
visibility: visible !important;
font-size: 1rem;
}

#tile-51 .tile-primary.on>div:after {
content: 'Still Open';
color: #ab1a34;
}

#tile-51 .tile-primary.off>div:after {
content : 'All Closed';
color: #7d7a7b;
}

Example of background of a tile

#tile-51 {
background-color: rgba(0,0,255,1) !important;
}

#tile-51 .on {
he-switch_2_flipped; color: black;
}

#tile-51[style*="background-color"] {
background-color: rgba(255, 0, 0, 1)!important;
}

3 Likes

On, Off and Relay indicates a switch
Occupied and Vacant suggests a motion sensor.

Can you clarify?

Hi Gary,

I am attempting to monitor a office conference room to determine if any occupants are still inside the room.

I have a Z-Wave motion sensor, as well as a Zooz Zen17 Universal relay.

I've connected some LED lights to the relay that alternate between red and green based on the occupancy sensor,

So now I'd like to also create a custom tile that changes from red to green and displays the text "Occupied" or "Vacant".

Thanks,
Tim

Just the guidance I was hoping for. Thanks folks!

1 Like

Oh yes, that is pretty easy. I’ll send some screenshots when I get home.

This is created with Tile Builder Rooms. Don't let the name put you off, a tile is a tile.

It flips between these two tiles depending on the state of the motion sensor.
image
image

This is what the configuration screen looks like to give you some idea of your options.

I did have to add a couple of lines of code as it mainly does Icons vs Strings but it's trivial and I can do that very easily.

There may be simpler and better ways to do what you are looking for, but at least you have one response.

2 Likes

Gary, Thank you so much!
I'm really impressed how supportive the Hubitat community is.

Tim

3 Likes

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.