Conditional Card supporting value_template

Use case:

I have my Christmas tree :christmas_tree: with WLED, and I want it to appear between months December and January.
The rest of the year will be stored back. But I don’t want to continue modifying the Dashboard.
That’s where using Conditional Card should do its job.

I want to avoid having to create a “template entity” to provide boolean of the month, but instead have this provided in the Card.

Expected code:

type: conditional
conditions:
  - value_template: '{{ now().month in [1,12] }}'
    condition: template
card:
  show_name: true
  show_icon: true
  type: button
  tap_action:
    action: toggle
  entity: light.wled_arbol
  icon: mdi:pine-tree
  name: Christmas Tree
  icon_height: 60px

Current errors:

  • mandatory key conditions.0.entity.
  • value_template not working.

As you can read from the card, it requires (!) entity and state, but you can try to trick it a bit

type: custom:card-templater
card:
  type: conditional
  conditions:
    - entity: light.wled_arbol
      state_template: '{{ "on" if now().month in [1,12] }}'
  card:
    show_name: true
    show_icon: true
    type: button
    tap_action:
      action: toggle
    entity: light.wled_arbol
    icon: mdi:pine-tree
    name: Christmas Tree
    icon_height: 60px
entities:
  - entity: light.wled_arbol
2 Likes