Variable interval for my afternoon meds #174

This commit is contained in:
2023-11-14 18:29:05 -05:00
parent 18f1268ef0
commit bf93698adb
3 changed files with 14 additions and 2 deletions

View File

@ -571,7 +571,11 @@ script:
target:
entity_id: input_datetime.tony_afternoon_meds_notify
data:
time: "{{ (state_attr('input_datetime.master_bedroom_wakeup','timestamp') | int + 21600) | timestamp_custom('%H:%M', false)}}"
time: >
{% set interval = states('input_number.tony_afternoon_meds_interval') | int %}
{% set math = ((interval * 60) * 60) | int %}
{% set wakeup = state_attr('input_datetime.master_bedroom_wakeup','timestamp') | int %}
{{ (wakeup + math) | timestamp_custom('%H:%M', false) }}
- service: input_datetime.set_datetime
target:
entity_id: input_datetime.tina_morning_meds_notify

View File

@ -71,6 +71,13 @@ input_datetime:
icon: mdi:medication
input_number:
tony_afternoon_meds_interval:
name: Tony Afternoon Meds Interval
min: 0
max: 12
step: 1
unit_of_measurement: hours
icon: mdi:medication
tony_custom_meds_interval_p1:
name: Tony Custom Meds Interval P1
min: 0