Push Benachrichtigung bei Zustandsänderung löschen

Habe das von Amillio erweitert und mit clear_notification kombiniert. Bestimmt falsch aufgebaut.

YAML sieht so aus:

alias: Fenster offen
description: “”
triggers:

- entity_id:
  - binary_sensor.fenster_ben_contact
    trigger: state
    to: “on”
- entity_id:
  - binary_sensor.fenster_ben_contact
    trigger: state
    to: “off”
- trigger: state
  entity_id:
  - binary_sensor.fenster_kuche_contact
    to: “on”
- trigger: state
  entity_id:
  - binary_sensor.fenster_kuche_contact
    to: “off”
    conditions: [ ]
    actions:
- choose:
  - conditions:
    - condition: state
      state: “on”
      entity_id: binary_sensor.fenster_ben_contact
      sequence:
    - action: notify.mobile_app_pixel_8_pro
      metadata: {}
      data:
      data:
      ttl: 0
      importance: high
      priority: high
      tag: ben
      title: Fenster Ben offen.
      message: Das Fenster bei Ben steht noch offen.
  - conditions:
    - condition: state
      entity_id: binary_sensor.fenster_ben_contact
      state: “off”
      sequence:
    - action: notify.mobile_app_pixel_8_pro
      data:
      message: clear_notification
      data:
      tag: ben
  - conditions:
    - condition: state
      state: “on”
      entity_id: binary_sensor.fenster_kuche_contact
      sequence:
    - action: notify.mobile_app_pixel_8_pro
      metadata: {}
      data:
      data:
      ttl: 0
      importance: high
      priority: high
      tag: kuche
      title: Fenster Küche offen.
      message: Das Fenster in der Küche steht noch offen.
  - conditions:
    - condition: state
      entity_id: binary_sensor.fenster_kuche_contact
      state: “off”
      sequence:
    - action: notify.mobile_app_pixel_8_pro
      data:
      message: clear_notification
      data:
      tag: kuche
      mode: single

:crayon:by HarryP: Code-/Logzeilen formatiert (bitte immer in </> einbinden)

s.a.: (Neues Update & Features - Hier in der Community 🫶)