I'm using Mediocre Media Player and have a Custom Button I'd only like to display at certain times (in this instance, a Christmas Playlist which only shows up in December). I've tried states directly, I've now added a Helper Sensor which works to hide the entire card, but not just one of the Custom buttons.
Helper Sensor
template:
- sensor:
- name: "Month"
state: "{{ now().month }}"
Works for the whole card
visibility:
- condition: state
entity: sensor.month
state: "12"
Doesn't work for Custom Button
- name: Christmas
icon: mdi:pine-tree
show_if_template: "{{ states('sensor.month') == '12' }}"
tap_action:
action: perform-action
perform_action: music_assistant.play_media
target:
device_id: 94e5f5a9771526e81a6aac7bc1fdcf89
data:
media_id: Christmas
media_type: playlist