@Crumpy10 i use yaml editor (Studio code server addon or file editor) for all my automations.
For power cut notification automation:
configuration.yaml:
- platform: template
sensors:
home_power:
friendly_name: "Home Power"
device_class: power
value_template: "{{ is_state_attr('sensor.crow_alarm_system', 'mains', True) }}"
automation.yaml:
- alias: Home Power On/Off
trigger:
- platform: state
entity_id: sensor.home_power
condition:
condition: template
value_template: >
{{ trigger.from_state.state != 'unknown' }}
action:
- service: notify.pushover
data_template:
message: >
{% if is_state('sensor.home_power','True') %}
Power on...
{% else %}
Power off!!!
{% endif %}
data:
sound: powercut
But in order for this to work you should have UPS connected to your HA server and internet modem. Also, sometimes when the power cut occurs, my internet connection goes also esp. where i live. Then this doesnāt workā¦
Also, this is an alarm trigger notification automation:
- alias: Alarm Trigger Message
trigger:
- platform: template
value_template: "{{is_state_attr('alarm_control_panel.area_a','alarm', True) }}"
action:
- service: notify.pushover
data_template:
message: >
{% set zone_names = ['GiriÅ PIR','Ćatı MK','Zemin MK','Sinema MK','Mutfak PIR','Sinema PIR','Ćst Kat MK','Mutfak Pencere Kablosuz','Salon PIR','ĆalıÅma Oda PIR','Ćocuk Oda PIR','Misafir Oda PIR','Ebeveyn PIR','Ebeveyn MK','Ćocuk Oda MK','Sinema Oda Kablosuz'] %}
ALARM: {{ zone_names[state_attr('alarm_control_panel.area_a','alarm_zone') | int -1 ] }}