I’m mostly just using the UI as I’m a noob, but I’m trying to create an automation that tells me when the garage door is open too long. There are a lot of older examples in yaml, but none of it is helping me. Here’s what I did so far:
Created a script that tells notify.alexa_media to say that the door has been open too long - I can execute that and she blabs as desired.
I created an automation that has a condition when the door is “open” for: minutes: 2
I have an action that does a call_service on script.announce_garage_blah, which doesn’t require any data, but when I try to save, I get Message malformed: value is not allowed for dictionary value @ data['type']
I only made the script because trying to do the notify from the automation also gave me similar errors. But the script works great by itself.
Willing to delve into the code a little bit? try to copy and paste this in your automations.yaml… Don’t forget to restart HA after pasting this, otherwise it won’t work. I hope it helps.
- id: put a random numer here.. so you'll be able to modify it from the UI
alias: put it as you like it
trigger:
- platform: state
entity_id: binary_sensor.name_of_your_door
to: on
for: '00:02:00'
action:
- service: script.turn_on
entity_id: script.announce_garage_blah
Thanks for your reply. I’m happy to play in the code/yaml. I added this to automations.yaml, and though it appears valid, this automation does not appear in the UI under config->automations (there is another one I made that does appear). I did restart the server (I even put a server restart button on my lovelace UI)
- id: '2608925526286'
alias: Door open too long
description: ''
trigger:
- platform: state
entity_id: cover.garage_door
state: open
for: '00:02:00'
action:
- service: script.turn_on
entity_id: script.announce_garage_door_open
mode: single
Appreciate any help!
[update - there was actually an error in the log!]
Invalid config for [automation]: [state] is an invalid option for [automation]. Check: automation->state. (See /config/configuration.yaml, line 8). I’m guessing that it’s state: open but not sure. Back to the docs!
Got it working. HA is amazing!! It announces on all my Echoes. In case anyone else wants this.
id: '1609007893100'
alias: Garage Door Open too long
description: ''
trigger:
- platform: state
entity_id: cover.garage_door
to: open
for: "00:15:00"
condition: []
action:
- service: script.announce_garage_door_open
data: {}
mode: single