Skip to content

Automations

Example use cases

Threshold alarm

I.e. trigger an alarm when power usage is over a certain threshold:

  • Create binary sensor in UI, i.e. binary_sensor.stromverbrauch_10_kw
  • Edit automations.yaml on server
- id: Alert_Stromverbrauch_10kw
  alias: Stromverbrauch 10kW
  description: ''
  triggers:
    - trigger: state
      entity_id:
        - binary_sensor.stromverbrauch_10_kw
      from: "off"
      to: "on"
      for:
        minutes: 1
  conditions: []
  actions:
    - action: ntfy.publish
      metadata: {}
      target:
        device_id: f8…  # ntfy publish device id
      data:
        title: 'Strom > 10 kW ({{ states("sensor.smi_mt631_power_cur")
          }} W)'
        priority: '3'
        tags:
          - warning
  mode: single