Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- type: custom:mushroom-template-card
- entity: input_boolean.tester ###needs an input_boolean helper. Add to automation turning this on/off
- secondary: >-
- Last changed: {% set t = ((as_timestamp(now()) -
- as_timestamp(states.input_boolean.tester.last_updated)) | int) %} {% if t <=
- 10 %} Just now {% elif t <= 60 %} {{ t }} seconds {% elif t < 3600 %}
- {{ (t / 60) | int }} min {{ (t % 60) }} sec
- {% elif t >= 3600 %}
- {{ (t / 3600) | int }} hr {{ (t / 60) | int }} min {{ (t % 60) }} sec
- {% else %} error {% endif %}
- primary: '{{ ''Stop drumming'' if states(entity) == ''on'' else ''Start drumming'' }}'
- icon: '{{ ''mdi:music-box'' if states(entity) == ''on'' else ''mdi:music-box-outline'' }}'
- icon_color: '{{ ''green'' if states(entity) == ''on'' else ''red'' }}'
- tap_action:
- action: call-service
- service: automation.trigger
- service_data:
- entity_id: automation.start_drumming
- double_tap_action:
- action: call-service
- service: automation.trigger
- service_data:
- entity_id: automation.stop_drumming
Advertisement
Add Comment
Please, Sign In to add comment