Using this template
decluttering_templates:
device:
card:
type: custom:mushroom-template-card
primary: "[[name]]"
secondary: "{{ states('[[entity]]') | int}}"
icon: "[[icon]]"
icon_color: >
{% set p = states('[[entity]]') | int%}
{% if p > 1000 %}
red
{% elif p > 100 %}
orange
{% elif p > 0 %}
green
{% endif%}
entity: [[entity]]
tap_action:
action: more-info
layout: vertical
multiline_secondary: false
- type: horizontal-stack
cards:
- type: custom:decluttering-card
template: device
variables:
- name: UPS Tot
- entity: sensor.shellypro4pm_c8f09e8877e0_switch_0_power
- icon: mdi:power-plug
the tap_action does not work.
While if I do not use the template and I use this code:
- type: horizontal-stack
cards:
- type: custom:mushroom-template-card
entity: sensor.shellypro4pm_c8f09e8877e0_switch_0_power
primary: UPS Tot
secondary: "{{ states(entity) | int}}"
icon: mdi:power-plug
icon_color: >
{% set p = states(entity) | int%}
{% if p > 1000 %}
red
{% elif p > 100 %}
orange
{% elif p > 0 %}
green
{% endif%}
tap_action:
action: more-info
layout: vertical
multiline_secondary: false
tap_action more-info works fine.
I use the template “device” in many places of my dashboard and it would be great to make the tap_action more-info work from there. I tried navigate instead of more-info in the template and it works.
Many thanks