Hello,
I have the next code to create a template button:
template:
- button:
- unique_id: 'start_stop_stopwatch'
name: >-
{% if is_state('input_boolean.start_stopwatch','off') %}
{% if is_state('sensor.stopwatch','00:00:00') %}
Start
{% else %}
Resume
{% endif %}
{% else %}
Stop/Pause
{% endif %}
icon: >-
{% if states('input_boolean.start_stopwatch') == 'off' %}
mdi:play-circle-outline
{% else %}
mdi:stop-circle-outline
{% endif %}
press:
service: input_boolean.toggle
target:
entity_id: input_boolean.start_stopwatch
This code creates an entity called button.start
(Start is the initial name given to the button in the template).
My question is: Why the entity is not called button.start_stop_stopwatch
?
If I want to create a second button with a different unique_id
but with same name template, I don’t see it created, or maybe HA creates the same button twice. How can do it?
Thank you.