I have a working Garbage Collection card, that is showing me this card when I need to put out the wheely bin. It has a different card, depending on the collection to be done this week. For instance:
cards:
type: vertical-stack
cards:
- type: conditional
conditions:
- condition: numeric_state
entity: sensor.afvalwijzer_next_in_days
below: 2
above: -1
- condition: state
entity: input_boolean.help_afvalwaarschuwing
state: 'on'
card:
type: conditional
conditions:
- condition: state
entity: sensor.afvalwijzer_next_type
state: dmh
card:
...
However, as the Christmas trees are this week collected on the same day, the state is “dmh, christmastree”. I therefor want to see if at least “dmh” is part of the current state. In essence: “dhm”.
I checked GPT and it gave me the solution below, but HA give an error in the conditions.
- type: conditional
conditions:
- condition: numeric_state
entity: sensor.afvalwijzer_next_in_days
below: 2
above: -1
- condition: state
entity: input_boolean.help_afvalwaarschuwing
state: 'on'
card:
type: conditional
conditions:
- condition: value_template
value_template: "{{ 'dhm' in states('sensor.afvalwijzer_next_type') }}"
card:
...
On this forum I found another example using templates, and I would get from that:
conditions:
- condition: template
value_template: "{{ 'dhm' in state_attr('sensor', 'afvalwijzer_next_type') }}"
This does not work either.
At this moment in time, I do not see an alternative option. Perhaps somebody here can steer me into the right direction?