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