blueprints/automation/medication-reminder.yaml aktualisiert

This commit is contained in:
2025-08-29 14:08:55 +00:00
parent 43fac944f5
commit 397fa40154

View File

@@ -7,11 +7,12 @@ blueprint:
the medication schedule resets for them, but the scanner gets the reminder.
- Sends reminders again after a flexible interval (hours or days).
domain: automation
input:
medication_name:
name: Medication Name
selector:
text:
text
nfc_tag_id:
name: NFC Tag ID
selector:
@@ -30,7 +31,7 @@ blueprint:
- Hours
- Days
person_selector:
name: input_select for manual person selection
name: Manual person selection
selector:
entity:
domain: input_select
@@ -41,8 +42,7 @@ trigger:
condition:
- condition: template
value_template: >
{{ trigger.event.data.tag_id == !input nfc_tag_id }}
value_template: "{{ trigger.event.data.tag_id == !input nfc_tag_id }}"
variables:
scanned_user_id: "{{ trigger.context.user_id }}"
@@ -61,8 +61,8 @@ variables:
{% endif %}
datetime_entity: "input_datetime.medication_{{ person }}"
notify_service: >
{% set scanner_device = "notify.mobile_app_" ~ (state_attr('user.' ~ scanned_user_id, 'device_name') | lower | default('unknown')) %}
{{ scanner_device }}
{% set device_name = state_attr('user.' ~ scanned_user_id, 'device_name') | default('dad_phone') %}
notify.mobile_app_{{ device_name | lower }}
action:
- service: input_datetime.set_datetime