renemarc/home-assistant-config

View on GitHub
automations/notifications/humidor_notify_reset.yaml

Summary

Maintainability
Test Coverage
#
# Reset humidor notifications counter
#
# @subscribe sensor.humidor_humidity_filtered
#
# @publish counter.humidor_notify
#
# @see automations/notifications/humidor_notify.yaml
#
- id: humidor_notify_reset
  alias: "Humidor NOTIFY RESET"

  trigger:
    # When humidity is back within acceptable range.
    - platform: numeric_state
      entity_id: sensor.humidor_humidity_filtered
      above: 64
      below: 75
      for:
        seconds: 30

  action:
    # Remove the warning message from the frontend.
    - service: persistent_notification.dismiss
      data:
        notification_id: humidor

    # Reset the notification counter.
    - service: counter.reset
      data:
        entity_id: counter.humidor_notify