#Conditional Dashboard Views

1 messages · Page 1 of 1 (latest)

coarse oyster
#

Hi all, I set up a Christmas View on my main dashboard to show a santa tracker and seasonal lighting which i will now not need until next year. Is there any way to show/hide this based on a sensor or time/date?

analog dagger
#

I don't use the Visibility options myself but it looks like the options for Views are only limited to users while individual cards have a couple more options. For right now, I'm going to say the answer to your question is simply no. With that said, I wouldn't be surprised to see more options added in the future. Visibility is a relatively new feature.
On a side note, currently for cards, there's a Time option but no Date option. There is, however, an Entity state option. You could configure a input_boolean helper (show_seasonal) with a template to evaluate true/false based on your holiday criteria (month=12, for example.) The state of the helper could be used for the visibility. But, again, this is only for cards and not views.

sweet yarrow
#

With card-mod v4 you can use the following template with card-mod-root theme to hide the tab with CSS based on the current dashboard and month (or use any template logic you wish).

Card Mod Test:

  card-mod-theme: Card Mod Test

  card-mod-root: |
    {% set panelUrlPath = panel.panelUrlPath if 'panelUrlPath' in panel else None %}
    {% set isDec = now().month == 12 %}
    {% set panelToHide = 2 %}
    {% if panelUrlPath == 'dashboard-test' and not isDec %}
    ha-tab-group-tab[panel="{{panelToHide}}"] {
      display: none;
    }
    {% endif %}