Good afternoon. Help with the script, I don’t understand what’s wrong. The purpose of the script:
- there is an account in HA that has the account name snr93
- I want to send notifications to all devices of the user snr93, so as not to specify them directly, because they can change (for example, I bought a new phone) and in order not to register a new device everywhere, I want to make a script call that will pull up the list of devices itself
send_notification_to_snr93:
alias: "Отправить уведомление на все устройства Алексея"
sequence:
- service: notify.notify
data_template:
message: "{{ message }}"
title: "{{ title }}"
data:
channel: "{{ channel }}"
target: >
{{ states.notify | selectattr('entity_id', 'search', 'mobile_app') | selectattr('entity_id', 'search', 'snr93') | map(attribute='entity_id') | join(',') }}