Last Notification Sensor doesn't trigger automation again when the same notification is displayed more than once
See original GitHub issueHome Assistant Android version: 3.0.2-full
Android version: Android 11
Phone model: Pixel 4 XL
Home Assistant version: 2020.12.0
Last working Home Assistant release (if known):
Description of problem:
I have a smart washing (laundry) machine… It’s not so smart. It has an app with very limited functionality. Pretty much the only useful thing it does is send a notification to my phone once my washing cycle has completed.
I am using the Last Notification Sensor on the companion app, and have added my washing machines app to the allowed apps for the sensor.
I have also added an automation in Home Assistant that uses a state trigger to announce via TTS when the washing cycle is completed.
It works great, the first time… However, if I am having a day of doing laundry, I only ever get notified when the first load has completed. The completion of subsequent loads doesn’t trigger the automation.
I believe that this is because the notification that my laundry app sends is always the same, and since it is the only allowed app, the state data never really changes?
I’m including an example of the state as seen in home assistant, it is always consistent, no matter how many times I receive the notification:
State
Your washing cycle has been completed
State Attributes
android.appInfo: ApplicationInfo{4ca67fb it.hoover.wizard}
android.bigText: Your washing cycle has been completed
android.infoText: null
android.largeIcon: null
android.progress: 0
android.progressIndeterminate: false
android.progressMax: 0
android.reduced.images: true
android.remoteInputHistory: null
android.showChronometer: false
android.showWhen: true
android.subText: null
android.template: android.app.Notification$BigTextStyle
android.text: Your washing cycle has been completed
android.title: null
package: it.hoover.wizard
friendly_name: Pixel 4 XL Last Notification
icon: mdi:bell-ring
I may be missing an obvious and pre-existing solution, so apologies if that’s the case.
If not, maybe adding a state attribute to the last notification sensor with a timestamp of when the notification was received would be beneficial.
Thanks, great work on the app by the way, it’s awesome sauce!
Additional: As i was about to hit send on this, my Nest Hub suddenly announced that “Your washing cycle has been completed”.
I had run 2 washing cycles this evening, after the first one completed, a notification came through to my phone, and the TTS was announced.
The second washing cycle finished 23 minutes ago, and the notification came through to my phone straight away, but no automation/tts was triggered.
I had just opened up the Home Assistant Companion app and navigated to the last notification sensor settings to check that there was no extra information I wanted to include and the TTS automation triggered.
Just to test further, I backed out to the main screen of the app, and then navigated to the last notification sensor settings again, but the TTS Automation ddn’t trigger again ¯_(ツ)_/¯
Traceback (if applicable, to get the logs you may refer to: https://companion.home-assistant.io/docs/troubleshooting/faqs/#android-crash-logs):
Screenshot of problem:
Additional information:
Issue Analytics
- State:
- Created 3 years ago
- Comments:14 (7 by maintainers)
Top GitHub Comments
@dshokouhi Thank you for adding this, I will give it a try, it sounds like it will do the job nicely!
On a side note: It’s great to see the amazing work that been done on the Android app, it wasn’t long ago that we didn’t have one and I had serious iOS envy. The android app is amazing and has so much going for it. Thank you again to you and all involved 👍
@flexage we have added a new sensor to alleviate the issue. The active notification count sensor in the latest beta will update and contain all active notification data for you along with
post_time
attribute for each notification. So as long as this count is changing you should be able to see the attributes updating as well. I am going to close this issue now since this sensor is in the beta and we are now providing as much notification data as we can. The google play store beta updates every Saturday however you are free to grab the APK off the github release page to get it sooner if you desire.