How to do conditionals - If 11pm AND door is OPEN, do THIS

When I first setup HA back in Dec, I setup so basic scripts (thanks to help here) to do this:
at sunset turn on garage lights
at sunset turn on garage flood lights
at 12 am turn off garage lights.

Last night I got a zwave garage door controller and would like to know how to read the entities state and if door is OPEN at say 11pm and then take some action -send me an email/or text

This is the entity that shows the state of the door:

cover.linear_nortek_security_control_llc_gd00z_4_garage_door_opener_remote_controller_barrier_state_label

From what I did in dec, I know the platform will be time but any pointers on how to read the state and then act on it?

Thanks.

This is pretty basic automation really, so you probably want to re-read the docs to bring you back up to speed. But in summary:

You’d trigger at 11pm

If the garage door is open ( condition )

The action will send you the message.

automation:
  alias: Send message if garage open at 11pm
  initial_state: on 
  trigger:
    platform: time 
    at: '23:00:00'
  condition:
    condition: state 
    entity_id: cover.linear_nortek_security_control_llc_gd00z_4_garage_door_opener_remote_controller_barrier_state_label
    state: 'open' 
  action:
    service: notify.YOU
    data:
      message: "The garage door is open" 

Thank you…yes very rusty on this…thanks for getting me started!

1 Like

Just wanted to thank you again for the help yesterday. It is working fine now.
I need to get back to my python lessons for sure…

1 Like

No worries.

You don’t need to know python (I dislike it with a passion!), just the structure that Homeassistant requires things to be written in :slight_smile: