Open MXMLN-sec opened 2 months ago
Hey there @home-assistant/core, @frenck, mind taking a look at this issue as it has been labeled with an integration (alert
) you are listed as a code owner for? Thanks!
(message by CodeOwnersMention)
alert documentation alert source (message by IssueLinks)
The same problem also occurs if you try to count iOS badges dynamically using a helper
data:
push:
badge: '{{ states.counter.app_badge_count.state }}'
Error message in logs:
2024-07-10 23:37:08.564 ERROR (MainThread) [homeassistant.components.mobile_app.notify] Value type for APS key [badge] is a number. This message is generated externally to Home Assistant.
The problem
When using a template for any value within the
data:
section (eg. critical) the template will not be parsed. My goal is to achieve a regular app notification when a door has been opened, but when the door has not been closed for a given time Home Assistant should send a critical notification instead. This time based logic as a template has not been applied in the example below since it should be an easy way to test. So due to the fact the template will not be parsed I always receive a regular non critical notification.While trying the same template in an automation the template will be parsed correctly and I receive a critical notification.
I'm using the Companion App for iOS.
What version of Home Assistant Core has the issue?
2024.7.1
What was the last working version of Home Assistant Core?
?
What type of installation are you running?
Home Assistant Supervised
Integration causing the issue
alert
Link to integration documentation on our website
https://www.home-assistant.io/integrations/alert/
Diagnostics information
No response
Example YAML snippet
Anything in the logs that might be useful for us?
No response
Additional information
As far as I can understand the problem lies somewhere near the fact that
CONF_DATA
is declared asdict
and not ascv.template
inhomeassistant/components/alert/__init__.py
with all the following necessary template specific coding.Unfortunately I’m not a developer, more like a hobby coder and I don’t have enough time to work into this the way I would love to.