Home-AssistantConfig/config/script/notify_engine.yaml

84 lines
2.9 KiB
YAML
Raw Normal View History

2018-01-02 00:00:45 +00:00
######################################################################################################
2023-11-17 06:59:29 +00:00
###Script to send notifications to the mobile Phone! Call like this:
2018-01-02 00:00:45 +00:00
# action:
# service: script.notify_engine
# data:
# title: 'Ios Title'
2018-01-02 00:00:45 +00:00
# value1: 'Startup: Home Assistant is Up and Running!'
# value2: "{{ trigger.to_state.state }}"
# value3:
2018-01-02 00:00:45 +00:00
# who: "stacey | carlo | paige | family | parents"
# camera_entity: 'Camera.Camera'
# content-type: "jpeg"
# group: "Something_Unique" if important or information
2018-01-02 00:00:45 +00:00
2020-05-29 21:53:20 +00:00
# @CCOSTAN
# Original Repo : https://github.com/CCOSTAN/Home-AssistantConfig
# Need this script to work with Android? Check out this Video. https://youtu.be/mK1wdpxhLbM
2018-01-02 00:00:45 +00:00
######################################################################################################
notify_engine:
sequence:
- condition: or
conditions:
- condition: state
entity_id: input_boolean.text_notifications
state: 'on'
2018-01-02 00:00:45 +00:00
- service: >
2018-01-02 00:00:45 +00:00
{% if who == 'stacey' %}
notify.mobile_app_stacey_iphone11
2018-01-02 00:00:45 +00:00
{% elif who == 'carlo' %}
notify.mobile_app_carlo_xsmax
2018-01-02 00:00:45 +00:00
{% elif who == 'parents' %}
notify.ios_parents
{% elif who == 'family' %}
notify.ios_family
2018-01-02 00:00:45 +00:00
{% else %}
notify.ios_family
{% endif %}
data:
title: "{{ title }}"
2018-01-02 00:00:45 +00:00
message: "{{ value1 }} {{ value2 }} {{ value3 }}"
data:
group: "{{ group|default('information'),true }}"
push:
interuption_level: "{{ level|default('active'),true }}"
entity_id: "{{ camera_entity }}"
2023-11-17 06:59:29 +00:00
notify_engine_two_button:
sequence:
- condition: or
conditions:
- condition: state
entity_id: input_boolean.text_notifications
state: 'on'
- service: >
{% if who == 'stacey' %}
notify.mobile_app_stacey_iphone11
{% elif who == 'carlo' %}
notify.mobile_app_carlo_xsmax
{% elif who == 'parents' %}
notify.ios_parents
{% elif who == 'family' %}
notify.ios_family
{% else %}
notify.ios_family
{% endif %}
data:
message: "{{ value1 }} {{ value2 }} {{ value3 }}"
title: "{{ title|default('', true) }}"
data:
actions:
- title: "{{ title1|default('', true) }}"
action: "{{ action1 }}"
icon: "{{ icon1|default ('sfsymbols:house.circle', true) }}"
destructive: "{{ destructive1|default('false', true) }}"
- title: "{{ title2|default('', true) }}"
action: "{{ action2 }}"
icon: "{{ icon2|default ('sfsymbols:house.circle', true) }}"
destructive: "{{ destructive2|default('false', true) }}"
group: "{{ group|default('information'),true }}"