hottl
June 7, 2023, 5:28pm
1
Until recently I had two “conditional cards” that only appeared on my dashboard when a recently deprecated HACS Integration called Garbage Collection triggered. The yaml for them is below.
type: conditional
conditions:
- entity: sensor.wheelie_bins
state: today
card:
type: markdown
content: '# **Put Black Bin out**'
type: conditional
conditions:
- entity: sensor.blue_bin
state: today
card:
type: markdown
content: '# **Put Recycling Bin out**'
I have just set up a Local Calendar (called Bins), and have set alternating recurring events for Blue and Black bins. But I can’t work out how to create a new Conditional Card to replace my old ones.
Can someone help me with how to do this? Many thanks!
We don’t know how your calendars are set up so it’s hard to give advise that would be applicable to your situation…
hottl
June 7, 2023, 7:52pm
3
I have 1 calendar entity called
calendar.bins
. If I go to Calendar in the left hand bar and then click on an event within the bins calendar I get this …
The “black” bin, on alternating weeks is similar. What other info can I share?
TIA
I would set up a trigger-based template sensor:
template:
- trigger:
- platform: calendar
event: start
entity_id: calendar.bins
- platform: calendar
event: end
entity_id: calendar.bins
sensor:
- name: Bins Conditional
state: "{{ 'off' if trigger.event == 'end' else trigger.calendar_event.summary }}"
Then your cards are based off the state of the sensor.
type: conditional
conditions:
- entity: sensor.bins_conditional
state: Black
card:
type: markdown
content: '# **Put Black Bin out**'
type: conditional
conditions:
- entity: sensor.bins_conditional
state: Blue
card:
type: markdown
content: '# **Put Recycling Bin out**'
The above assumes that blue and black bins never go out on the same day. If that’s not the case left us know.
1 Like
hottl
June 8, 2023, 10:43am
5
Thank you so much @Didgeridrew - that all works perfectly!
hottl
June 13, 2023, 7:50am
6
Hmmm, seems I spoke too soon.
I have this Conditional Card in my Dashboard (which I want to only show / appear on the correct day of the fortnightly cycle) …
type: conditional
conditions:
- entity: sensor.bins_conditional
state: Blue
card:
type: markdown
content: '**Put Blue Bin out**'
But it did not trigger today (as I would have hoped). Where might I have gone wrong? I have shown below the Calendar entry.
TIA
And this is my Template entry configuration.yaml …
template:
- trigger:
- platform: calendar
event: start
entity_id: calendar.bins
- platform: calendar
event: end
entity_id: calendar.bins
- sensor:
- name: Bins Conditional
state: "{{ 'off' if trigger.event == 'end' else trigger.calendar_event.summary }}"