Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- sensor:
- - platform: template
- sensors:
- toggling_icon_sensor:
- friendly_name: Toggling Icon
- value_template: >
- {% if true %}
- Flash
- {% else %}
- Steady
- {% endif %}
- icon_template: >
- {% elif is_state('sensor.toggling_icon_sensor', 'Flash') %}
- {% if states('counter.heartbeat_counter')|int % 2 == 0 %}
- mdi:recycle
- {% else %}
- mdi:trash-can
- {% endif %}
- {% else %}
- mdi:trash-can
- {% endif %}
- counter:
- heartbeat_counter:
- name: Heartbeat Counter
- restore: true
- minimum: 1
- maximum: 9999
- initial: 1
- step: 1
- automation:
- - alias: Publish Heartbeat
- trigger:
- - platform: time_pattern
- seconds: '/1'
- action:
- - service: counter.increment
- entity_id: counter.heartbeat_counter
- - alias: Reset Heartbeat
- trigger:
- - platform: template
- value_template: '{{ (states.counter.heartbeat_counter.state|int) >= (states.counter.heartbeat_counter.attributes.maximum|int) }}'
- for: "00:00:01"
- action:
- - service: counter.reset
- entity_id: counter.heartbeat_counter
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement