Advertisement
Flo_R1der

Home Assistant / Custom flexible Notification

Mar 21st, 2024 (edited)
918
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 2.00 KB | None | 0 0
  1. alias: Custom flexible Notification
  2. sequence:
  3.   - alias: Xiaomi 12X (Florian)
  4.     if:
  5.       - condition: or
  6.         conditions:
  7.           - alias: Switch Notification 'On' and NOT at Work
  8.             condition: template
  9.             value_template: >-
  10.               {{ is_state('input_boolean.notify_mobile_app_xiaomi_12x', 'on')
  11.               and states('person.florian') != 'Trivit AG' }}
  12.           - condition: template
  13.             value_template: "{{ data.channel == 'Alarm' or message == 'clear_notification' }}"
  14.             alias: channel == 'Alarm' or Message == 'clear_notification'
  15.     then:
  16.       - service: notify.mobile_app_xiaomi_12x
  17.         data:
  18.           title: "{{ title }}"
  19.           message: "{{ message }}"
  20.           data: "{{ data }}"
  21.     enabled: true
  22.   - alias: Xiaomi 13 (Denise)
  23.     if:
  24.       - condition: or
  25.         conditions:
  26.           - alias: Switch Notification 'On' and NOT at Work
  27.             condition: template
  28.             value_template: >-
  29.               {{ is_state('input_boolean.notify_mobile_app_xiaomi_13', 'on') and
  30.               states('person.denise') != 'MTU FN Werk1' }}
  31.           - condition: template
  32.             value_template: "{{ data.channel == 'Alarm' or message == 'clear_notification' }}"
  33.             alias: channel == 'Alarm' or Message == 'clear_notification'
  34.     then:
  35.       - service: notify.mobile_app_xiaomi_13
  36.         data:
  37.           title: "{{ title }}"
  38.           message: "{{ message }}"
  39.           data: "{{ data }}"
  40.     enabled: true
  41.   - alias: Sony Xperia Z Tablet (Florian)
  42.     if:
  43.       - condition: state
  44.         entity_id: input_boolean.notify_mobile_app_sgp321
  45.         state: "on"
  46.       - condition: template
  47.         value_template: "{{ states('device_tracker.sgp321') == 'home' }}"
  48.         alias: is 'Home'
  49.     then:
  50.       - service: notify.mobile_app_sgp321
  51.         data:
  52.           title: "{{ title }}"
  53.           message: "{{ message }}"
  54.           data: "{{ data }}"
  55.     enabled: true
  56. mode: single
  57. icon: mdi:message-badge
  58.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement