Hi all, I have a question about variables. I have a SO that works nights and I am a day person. She also lives closer to work during the week and is home on the weekends (most of the time). What I would like to do is have it so some of my lighting automations happen later if her phone is in the house. I have presence sensing working based on the Mikrotik router integration. What I would like to do is to set up an " if she’s home use her bedtime, else use mine" automation. Here is what I have so far.
{{ (states("input_datetime.heather_bed_time")) }}
in dev tools > templates comes back with “00:00:00” which is correct but I cannot seem to get the service to accept it.
Please forgive my formatting, I am still new to yaml and templates.
configuration.yaml
heather_alarm_time:
name: Heather Alarm Time
has_date: false
has_time: true
heather_bed_time:
name: Heather Bed Time
has_date: false
has_time: true
alarm_time:
name: Alarm Time
has_date: false
has_time: true
bed_time:
name: Bed Time
has_date: false
has_time: true
automations.yaml:
alias: Heather home
description: ''
trigger:
- platform: state
entity_id: person.heather
from: not_home
to: home
for: 00:30:00
condition: []
action:
- service: input_datetime.set_datetime
data:
entity_id: input_datetime.bed_time
data_template:
time: >
"{{ (states("input_datetime.heather_bed_time")) }}"
- service: input_datetime.set_datetime
data:
entity_id: input_datetime.alarm_time
data_template:
time: >
"{{ (states("input_datetime.heather_alarm_time")) }}"
mode: single
Thank you.