Closed drashish87 closed 1 week ago
Its not really in the scope of this project, but I'll try to help you anyway.
So, I would guess the conditional card should work if the sensor.recyling
is reporting back a number. Did you check that?
Also, you probably would want to use the below
statement in the numeric_state
from the conditional card
.
For example:
type: conditional
conditions:
- condition: numeric_state
entity: sensor.recycling
below: 7
card:
type: entity
entity: sensor.recycling
name: Days to Recycling Collection
icon: mdi:recycle-variant
Did this work for you?
Thank you for your reply and apologies for the late reply. I have tried this as well but the card doesn't appear for some reason, even though 1 day is remaining to collection.
Share me your code and share me the what the sensor outputs through dev > states.
This is my sensor code in configurations.yaml, as you will appreciate, I have put the collection dates in calendars and created a sensor.
template:
- sensor:
- name: "refuse"
state: >-
{{ ((state_attr('calendar.refuse', 'start_time') | as_timestamp - today_at('00:00') | as_timestamp) / 86400) | int }} days
- name: "recycling"
state: >-
{{ ((state_attr('calendar.recycling_and_garden', 'start_time') | as_timestamp - today_at('00:00') | as_timestamp) / 86400) | int }} days
dev<states
The conditional card codes dont work for some reason, tried the code you suggested as well.
Many thanks for looking into it
Hi @drashish87, this problem is still open, but I neglected to solve it. I'm not sure if you still have this issue or moved on so i'm closing it.
If you still happen to have that issue, please let me know!
Hi, Thanks for releasing this theme really like it and waiting for a more generic code to be able to add additional cards.
In the meantime, I have been trying to add the garbage collection card. Can you advise how to make this card conditional? I have created 2 sensors refuse and recycling as both as both collections are on alternate weeks wednesday.
I want the collection which is less than 7 days away aka next up for collection, card to display rather than display both all the time.
This is my current code so far, I have tried conditions but it doesn't seem to work, can you advise if i need to add any another template ? Many Thanks for your help
With condition which is not working