[Solved] Show an entire card only during work days and time range

Hi all

Is there a way to show a card only during work days?

I would like to show a travel time to work card only during that days

Thanks

Would this help?

1 Like

I’ve thought about conditional card, but how to check if today is a working day?

Thanks

You could use this

1 Like

Thanks!
I didn’t know about this binary sensor.
I will sure check and use in the conditional card.

I’ve found also the way to show the card only in a time range.

So this is what I’ve don, thanks to your suggestions…

I’ve created two binary_sensor that are on when in the time range I need (taken from here) and when is a workday.

binary_sensor:
  - platform: template
    sensors:
      display_card:
        friendly_name: Display card between 6 and 9.
        entity_id: sensor.time
        value_template: >
           {% set ct = now().hour + now().minute/60 + now().second/3600 %}
           {{ 6 <= ct <= 9 }}
  - platform: workday
    country: IT
    workdays: [mon, tue, wed, thu, fri]
    excludes: [sat, sun]
    add_holidays:
      - "2022-06-29"

Then, I’ve created the conditional card, thanks to @AdmiralStipe and @Holdestmade

  - type: conditional
    conditions:
      - entity: binary_sensor.workday_sensor
        state: 'on'
      - entity: binary_sensor.display_card
        state: 'on'
    card:
      type: entities
      entities:
        - entity: sensor.lavoro
          name: Tempo Waze
          secondary_info: last-updated
        - entity: sensor.maps_lavoro
          name: Tempo Maps
          secondary_info: last-updated
      title: Tempo per lavoro