question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Last Notification Sensor doesn't trigger automation again when the same notification is displayed more than once

See original GitHub issue

Home 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:closed
  • Created 3 years ago
  • Comments:14 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
flexagecommented, Dec 31, 2020

@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 👍

1reaction
dshokouhicommented, Dec 28, 2020

@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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Clearing (and modifying) notifications does not work reliable ...
I try to get some simple automations with notifications working on Android. I noticed, unfortunately, that handling of notifications seems ...
Read more >
Get notified when your Washing Machine has finished it's ...
If the trigger and condition indicate that the washing machine has been switched on, we can send a push notification to our phone...
Read more >
5 WAYS To Send Notifications (Using Home Assistant)
In this video I will be showing you 5 different ways to send notifications from Home Assistant.The 5 Methods we will look at...
Read more >
Using two sensors in triggers and conditions NEW in 2021.7
Besides Trigger IDs that were added in 2021.7, another not so big but very powerful improvement was added. Simple way to compare two...
Read more >
Home Assistant Actionable Notifications on iOS AND Android
Home Assistant notifications just got even better and easier! Today we are looking at an updated guide on how to do Home Assistant ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found