Hi - I’ve successfully installed and configured an automation that opens the blinds in my master bathroom when it detects occupancy after 8am (i.e. someone enters the master bathroom after that time). There’s then another (separate) automation that closes the blinds at sunset. All works perfectly except if someone manually closes the blinds after 8am, the automation triggers again to open the blinds when it detects occupancy.
I’d like to have the automation run one upon occupancy, then implement a condition that checks to see if it’s already been run that day (and if it has, doesn’t run again).
I’m not super skilled in YAML but here’s the current automation in use:
alias: Open Master Bathroom Blinds in AM with Occupancy
description: ""
trigger:
- type: motion
platform: device
device_id: 8b33b17d7a996143d5ae797d50a0d256
entity_id: binary_sensor.0x54ef441000491083_occupancy
domain: binary_sensor
condition:
- condition: time
weekday:
- sun
- mon
- tue
- wed
- thu
- fri
- sat
after: "07:00:00"
before: "17:00:00"
action:
- device_id: c6e723e7aecf948defa633d57797f0a1
domain: cover
entity_id: cover.0x54ef4410004d2a47
type: set_position
position: 100
mode: single
Doing some research on here I found a condition that may be applicable but I’m not sure how to implement it without borking the YAML code.
"{{ this.last_triggered.date() != now().date() }}"
Would this work?
alias: Open Master Bathroom Blinds in AM with Occupancy
description: ""
trigger:
- type: motion
platform: device
device_id: 8b33b17d7a996143d5ae797d50a0d256
entity_id: binary_sensor.0x54ef441000491083_occupancy
domain: binary_sensor
condition:
- condition: time
weekday:
- sun
- mon
- tue
- wed
- thu
- fri
- sat
after: "07:00:00"
before: "17:00:00"
- condition: "{{ this.last_triggered.date() != now().date() }}"
action:
- device_id: c6e723e7aecf948defa633d57797f0a1
domain: cover
entity_id: cover.0x54ef4410004d2a47
type: set_position
position: 100
mode: single
Thanks in advance for the help!