Alert if device state has not changed after certain time on certain days

I’m trying to create an automation to alert me (App and Echo) that fires if my door sensors have not changed to the open (on) state after a certain time on select days, basically remind me if I’ve not opened door to put bins / milk bottles out on certain days, after certain times.

‘If door has not been opened after 9pm on Tuesdays, send alert’

I can make it alert me if I do open the doors after certain times etc by using the device, conditions and actions, (all in the automations editor UI) but that defeats the point.

‘Hey good job at remembering’

Am I missing something (I’m still very new to HA) or is this just not posible using the basic UI and something I’d need to manually code?

You could do a time trigger, and a state condition:

trigger:
- platform: time
  at: '21:00'
condition:
- platform: state
  entity_id: binary_sensor.my_door_sensor
  state: 'off'
  for: '01:00:00'
action:
...

Change the entity (binary_sensor.my_door_sensor) and the time (‘01:00:00’) to suit. The above will run the actions if the door has been closed for an hour (or more) at 21:00.

Thanks for the reply, I hadn’t looked at the time trigger.

Do you think this will work then?
I’m thinking it means that 10pm is my trigger time, so if the door has not been opened since 9pm, and 10pm is passed then I get an alert.

I’ve used the time condition as well, to set it to only run on Thursdays but I didnt set a fixed time after/before as to not double it up with times put in other fields.

trigger:
  - platform: time
    at: '22:00:00'
condition:
  - condition: state
    entity_id: binary_sensor.front_door_open_closed_sensor
    state: 'off'
    for: '01:00:00'
  - condition: time
    weekday:
      - thu
action:
  - service: notify.mobile_app_iphone
    data:
      message: It doesn't look like you've put the milk out yet
mode: single

Yup, that looks good to me

Nice one, I appreciate the help!