I am not sure I have my logic correct yet, but my goal would be to send an alert if one of the kids leave a door or something open after dark. there’s been a few times that we have gotten up the next morning to find the garage door was left open all night.
so my logic is to set a condition that if after the sun had gone down and something is open to send the alert. my concern is I think this will send an alert every time something is opened after dark. I already have an alert for when something is left open for longer than 10 min but I also want something else if it’s dark.
also I ahve some sort of typo in this as I am getting an error…
####send notification if doors left open after Dark####
- alias: Doors/windows open after Dark
initial_state: true
trigger:
- platform: state
entity_id:
- binary_sensor.garage_door
- binary_sensor.front_door
- binary_sensor.1st_floor_window
- binary_sensor.basement_door
- binary_sensor.basement_garage_door
- binary_sensor.basement_windows
- binary_sensor.breakfast_door
- binary_sensor.sliding_glass_door
- binary_sensor.sun_room_glass
state: 'on'
condition:
condition: and
conditions:
- condition: state
entity_id: sun.sun
state: below_horizon
- condition: state
entity_id:
- binary_sensor.garage_door
- binary_sensor.front_door
- binary_sensor.1st_floor_window
- binary_sensor.basement_door
- binary_sensor.basement_garage_door
- binary_sensor.basement_windows
- binary_sensor.breakfast_door
- binary_sensor.sliding_glass_door
- binary_sensor.sun_room_glass
state: 'on'
action:
service: notify.simple
data_template:
message : " {{ trigger.from_state.attributes.friendly_name }} has been left Open after dark "
title: "Don't forget to close doors"
here is the error:
Invalid config for [automation]: [state] is an invalid option for [automation]. Check: automation->trigger->0->state. (See /config/automations.yaml, line 232). Please check the docs at https://home-assistant.io/components/automation/