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
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
I’ve thought about conditional card, but how to check if today is a working day?
Thanks
You could use this
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
This workday sensor is pretty straightforward, thank you.
If you just need to differentiate workdays from the weekend/holidays (or any other combination based on days) without the precision of hours then it does a good job!
Here is a conditional card example I came up with to only show a card on working days (aka state: 'on'
):
type: conditional
conditions:
- condition: state
entity: binary_sensor.workday_sensor
state: 'on'
card:
type: vertical-stack
cards:
- type: custom:mushroom-light-card
entity: light.dining_room_lights