Hi,
when i go to services and i chose notify ios_nastja, put the message below - > iPhone receives message… but under configuration, I have set that it automaticly sends a message to the iPhone, if someone enters with wrong password, but i dont get the message? What am i doing wrong?
code:
platform: command_line
name: badlogin
command: grep -c “Login attempt” /home/homeassistant/.homeassistant/home-assistant.log
automation:
alias: Login Failure
trigger:
platform: numeric_state
entity_id: sensor.badlogin
above: 0
action:
service: notify.ios_nastja
data:
message: “Login Failure Detected”
notify:
name: iOSApp
platform: ios
juka
May 9, 2017, 7:18am
2
Hey,
first of all, please use the code block syntax the next time.
And now to your config … you don’t need the “badlogin” sensor. Furthermore you setup the iOS Component in your configuration.yaml
:
# load ios components
ios:
And this automation will send the notification:
automation:
- alias: login_failure
hide_entity: true
trigger:
platform: state
entity_id: persistent_notification.httplogin
condition:
condition: template
value_template: '{{ trigger.to_state.state != off }}'
action:
- service: notify.ios_nastja
data_template:
title: 'Login Failure Detected!'
message: '{{ trigger.to_state.state }}'
Please leave feedback if this works out for you.
Thank you very much for your help! it works like acharm!
where can i check which other persistent notificaions may i use?
juka
May 9, 2017, 8:02pm
4
Actually I don’t know…just found that one
1 Like