Bom dia,
Eu uso o IOS para notify sem terceiros, fica a dica abaixo de como uso o ios para notificações com butões de acção:
configuration.yaml:
ios:
push:
categories:
- name: alarme
identifier: 'alarme'
actions:
- identifier: 'DISARM_ALARM'
title: 'DESARMAR'
activationMode: 'background'
authenticationRequired: yes
destructive: no
behavior: 'textInput'
textInputButtonTitle: 'DESARMAR'
textInputPlaceholder: 'CODIGO'
- identifier: 'SOUND_ALARM'
title: 'DISPARAR'
activationMode: 'background'
authenticationRequired: yes
destructive: yes
behavior: 'default'
- identifier: 'ARM_AWAY'
title: 'REARMAR'
activationMode: 'background'
authenticationRequired: yes
destructive: yes
behavior: 'default'
automations.yaml (Ações dos butões):
############### IOS Desarma o Alarme
- id: ios_notif_action_1
alias: Desarmar Alarme
initial_state: true
hide_entity: true
trigger:
platform: event
event_type: ios.notification_action_fired
event_data:
actionName: DISARM_ALARM
action:
service: alarm_control_panel.alarm_disarm
data:
code: !secret code
entity_id: alarm_control_panel.casa
############### IOS Dispara o Alarme
- id: ios_notif_action_2
alias: Notif_Accionar Alarme
initial_state: true
hide_entity: true
trigger:
platform: event
event_type: ios.notification_action_fired
event_data:
actionName: SOUND_ALARM
action:
service: alarm_control_panel.alarm_trigger
data:
code: !secret code
entity_id: alarm_control_panel.casa
############### IOS Rearma o Alarme
- id: ios_notif_action_3
alias: Notif_Re-arma Alarme
initial_state: true
hide_entity: true
trigger:
platform: event
event_type: ios.notification_action_fired
event_data:
actionName: ARM_AWAY
action:
service: alarm_control_panel.alarm_arm_away
data:
code: !secret code
entity_id: alarm_control_panel.casa
Exemplo de automação que envia a notificação quando o alarme dispara:
- id: alarm_triggered
alias: '[Alarm] Triggered'
trigger:
- entity_id: alarm_control_panel.casa
platform: state
to: triggered
action:
- data:
data:
push:
badge: 0
category: alarme
message: ALERTA
title: Alarme Disparou
service: notify.ios_nelson
Espero que ajude