iOS
iOS copied to clipboard
clear_notification does not work properly for notification groups
I'm not sure if I should post this issue here or in the core repo, but as its specific to iOS I figured this would be a good place to start first.
iOS device model, version and app version
Model Name: iPhone 11p & iPhone XR Software Version: 15beta & 14.7.1 App version: 2021.7 (2021.202)
Home Assistant Core Version
core-2021.8.0
Describe the bug
- Created a notification group with our two iPhones (notify.all_iphones).
- Created an automation which sends a notification (including a tag)
- After x min timeout I want the notification to disappear on both iPhones using the clear_notification with tag
But for some reason the notification only disappears on one of the phones. The iPhone 11 Pro to be exact, the notification remains visible on the iPhone XR.
Notify group:
- platform: group
name: all_iphones
services:
- service: mobile_app_iphone_xr
- service: mobile_app_iphone_11_pro
Automation:
alias: Verwarming - Zet 's ochtends aan
description: ''
trigger:
- platform: time
at: '08:00:00'
condition:
- condition: state
entity_id: binary_sensor.someone_home
state: 'on'
- condition: template
value_template: >-
{{ not is_state_attr('climate.thermostaat', 'temperature',
states('input_number.temperature_high')) }}
action:
- service: script.set_high_temperature
- alias: Set up variables for the actions
variables:
notification_tag: '{{ ''TAG_'' ~ context.id }}'
- service: notify.all_iphones
data:
title: Verwarming
message: >-
Automatisch ingesteld op {{ state_attr('climate.thermostaat',
'temperature') }}℃
data:
tag: '{{ notification_tag }}'
- wait_template: ''
continue_on_timeout: true
timeout: '00:00:30'
- service: notify.all_iphones
data:
message: clear_notification
data:
tag: '{{ notification_tag }}'
mode: single
It's likely the clear command isn't waking the app on one of the devices. It looks like the app needs to be launched roughly weekly to keep this working, and Apple has denied our request for permission to make this reliable. We will needs to update the docs to point out this limitation, as it was guessed at but not known prior to the release of the feature.
Thanks for your quick response. So, do I understand correctly that this is an issue related to the clearing of the notifications itself, and has nothing to do with the notify.group? In this case, the HA app of the iPhone XS did not correctly respond to the clearing request?
Have you been able to clear ANY notification? I can't get any notification cleared, at all. iOS 15.2 on HA app v. 2021.12.1
Since a few weeks I experience clearing notifications fails. I launch the companion app daily on the iOS device the issue occurs on.
An example of the service calls I use: Setting notification:
service: notify.all_cell_phones
data:
title: Verwarming staat aan 🔥
message: … terwijl er niemand thuis is.
data:
tag: heating_on_while_away
actions:
- action: SET_HEATING_LOWER
title: Zet temperatuur 1,5 °C lager
authenticationRequired: false
- action: SET_HEATING_MODE_AWAY
title: Zet afwezige modus aan
authenticationRequired: false
destructive: true
Clearing notification:
service: notify.all_cell_phones
data:
message: clear_notification
data:
tag: heating_on_while_away
iOS Home Assistant Companion: 2022.2 (2022.343) Home Assistant: 2021.12.10 Installation type: Home Assistant OS