#thanks

1 messages · Page 1 of 1 (latest)

light lotus
#

Thanks, they didn't make sense to me, was looking for a simple counter example, I figure it out I think...

#

template:

  • trigger:
    • platform: state
      entity_id:
      • binary_sensor.internet
        sensor:
    • name: outages
      state: >
      {% if is_state('sensor.outages','Unknown') %}
      0
      {% else %}
      {{ states('sensor.outages')|int + 1 }}
      {% endif %}
tiny mist
#

Make sure to limit your trigger by assigning to and/or from values.

#

because the state won't update from "unknown" until it is triggered, you can cut out the whole if/then and just use:
state: "{{ this.state|int(0) + 1}}"