So I have this automation that reports to my phone when some updates are available:
alias: Notify user about device updates
description: >-
Send a notification when devices have updates available, ensuring prompt
action to keep all systems current.
triggers:
- trigger: template
value_template: |-
{{ states.update
| selectattr('state', 'eq', 'on')
| map(attribute='entity_id')
| list
| count > 0 }}
conditions: []
actions:
- action: notify.my_phone
metadata: {}
data:
title: New update available
message: >
Updates: {{ states.update | selectattr('state', 'eq', 'on') |
map(attribute='attributes.title') | list | join(', ') }}.
mode: single
It works fine, but I've got twice in the past few days message Updates: None. Which to me it means that at the trigger time, states.update was evaluated, but the variable somewhat wasn't used in the action.
Is there a race condition somewhere?
When I look in the updates page, indeed there is an update available.
Also activity looks to be normal. No glitch there