Conditional widget visibility / colors?

I though I share my dashboard here I have running on a raspberry pi.

The clock is realised with the iframe widget and this great project:

I think it looks quite nice and minimalistic. I would love it to be even more minimalistic and for example hide the volume buttons when no music is playing. Also the light switch only needs to be available if the sun is down.
Someone has an idea on how to achieve this?

If someone is interested let me know and I can post the config.

you need to start programming in javascript in a custom widget when you want to adchieve that.

i guess you could create a javascript function in a skin that checks if sun is down and then hide the widget.

hm… but the skin only is css and the variable yaml. Can you place some kind of java script in the css file?

Yes you can using head_include and body_include:

Also one of the next things I want to do is have conditional formatting for widgets - we’ll take a look at that and some other dashboard stuff when we get through the initial 4.0 release.


Ok… quite powerful. But I think I’ll just wait it out for now. I’m already quite happy with what I got now. The hiding of the widgets based on some hass entities would be the icing on the cake…

That should be possible with what I am planning :slight_smile:

1 Like