I have a Unifi camera that I’m automating to turn on recording overnight. I’m trying to set up a second automation that when I manually turn on recording myself, it will turn off after 2.5 hours (trying to capture baby nap patterns during the day!).
I’m having trouble with a template condition I found on the forums that would only activate turning it off after 2.5 hours if myself or my wife were the one who manually made the change - not the automation for the overnight.
I switched out ‘is’ for ==, tried using ‘null’ with ==, tried using ‘or’ with my user IDs, no luck. Each time (whether manually or via automation), it will kick it back to ‘no recording’.
I’m currently using 5 seconds to test, here’s the code.
alias: "* Nursery Nap Auto-Disable Record"
description: ""
trigger:
- platform: state
entity_id:
- select.g3_instant_recording_mode_2
to: Always
id: nurseryrecordon
condition:
- condition: not
conditions:
- condition: template
value_template: |-
>
{{trigger.to_state.context.user_id is none}}
action:
- delay:
hours: 0
minutes: 0
seconds: 5
milliseconds: 0
- service: select.select_option
data:
option: Never
target:
entity_id: select.g3_instant_recording_mode_2
mode: single
Please consider marking my post above with the Solution tag. It will automatically place a check-mark next to the topic’s title which signals to other users that this topic has been resolved. This helps users find answers to similar questions.