the error i get is:
2017-06-03 19:41:21 ERROR (MainThread) [homeassistant.config] Invalid config for [automation]: [delay] is an invalid option for [automation]. Check: automation->action->0->delay. (See /home/homeassistant/.homeassistant/configuration.yaml, line 121). Please check the docs at https://home-assistant.io/components/automation/
It’s probably something to do with the alignment of your code. Double check the spacing you’re using.
When you post code, if you highlight it and then press the < / > button, it will display with the correct format. I’m no expert but that should help someone more competent to answer your query.
I am in the same boat, needed something like this, your code helped me, however, I want a small iteration, I want the message notification to work after ever ‘00:01:35’ minutes. So first notification comes at '00:01:35, the second should come again after '00:01:35.
I changed the code a bit as the above code was sending the msg even if the door was closed. Below the updated one I am now using and its working … however my initial request still stays same, the msg should keep coming in 5 mints duration untill the door is closed. Below is my code …
automation:
alias: “front door opened”
trigger:
platform: state
entity_id: binary_sensor.front_door
from: ‘off’
to: ‘on’
for:
minutes: 5
action:
service: notify.pover
data:
message: Front Door Opened since last 5 minutes