Notification text capture problem

rwstarkey

New member
Hello - I am trying to put the complete text of a notification into an email. The notification is the trigger and then I'm trying to put the full notification into the email body, but I keep getting only the title. I've tried to put as many items into the email as might work like this...

{not_title}+{notification} + {not_sub_text}+{not_text_lines}+{not_text_big}+{not_ticker}

But all I get is the title "motion alert". None of the details that follow in the actual notification.

I'm using macrodroid for the first time today, so any help would be appreciated! Thanks!
 

Yogi

Member
Hi,

{not_title}+{notification} should do the job.
Describe the macro - screenshot would help - so we can see where the problem is.

Regards,
Fritz
 

rwstarkey

New member
Ok. I'll try that. What should I screenshot? The email action? Or the notification text?

The macro is 2 parts. The notification received and the send email.

Thanks!

--Randy
 

rwstarkey

New member
Here's some shots...
 

Attachments

  • Screenshot_20240104_164323_MacroDroid.jpg
    Screenshot_20240104_164323_MacroDroid.jpg
    304.4 KB · Views: 11
  • Screenshot_20240104_164422_MacroDroid.jpg
    Screenshot_20240104_164422_MacroDroid.jpg
    324.9 KB · Views: 11
  • Screenshot_20240104_164350_MacroDroid.jpg
    Screenshot_20240104_164350_MacroDroid.jpg
    273.9 KB · Views: 11

rwstarkey

New member
I can now get the whole notification but it gives me 8 emails. If I select the ignore ongoing notifications and prevent multiple triggers I get no emails. Also some emails contain the full notification and others contain only the labels meant to call the text. It seems there are some bugs in the notification received trigger?

Thanks!
 

Yogi

Member
I can now get the whole notification but it gives me 8 emails. If I select the ignore ongoing notifications and prevent multiple triggers I get no emails. Also some emails contain the full notification and others contain only the labels meant to call the text. It seems there are some bugs in the notification received trigger?

Thanks!
Disable the Action "Send Email" for test purpose.
Add an action "Display Dialog" and put in the values of the notification just to show them.
Add an Constraint "Makro invoked->this macro" with 1 minute.

As I don't know how often the notification triggers you could delete the notification if it is not needed anymore.

Regards,
Fritz
 

rwstarkey

New member
Ok. The notification is from a camera detecting motion, so I don't know how it functions, it could be sending some triggers very quickly or something.
 

dhj49er

Well-known member
Ok. The notification is from a camera detecting motion, so I don't know how it functions, it could be sending some triggers very quickly or something.
I have a camera and the attached screenshot is a macro that puts the magic texts notification title and motivation text into a local variable.

I think you need to capture the magic text in a variable and use the contents of this variable in your email.

I would check the camera app settings, if available.

I would expect the camera to have a dead time in which motion is not detected. This setting may be tied to cloud access & provides time for the short video to be uploaded.

However, if such a setting doesn't exist, then use a constraint on the Notification trigger - not invoked this macro for X seconds, where X exceeds the camera settling time (if it's producing multiple notifications for a single event) + time to complete sending the email. I would start with X at 20s and experiment to find the optimum value.
 

Attachments

  • Screenshot_20240106_115115_MacroDroid.jpg
    Screenshot_20240106_115115_MacroDroid.jpg
    306.4 KB · Views: 7

rwstarkey

New member
Thanks for sharing all that! I'm not very familiar with variables, so what would that variable accomplish for me? Keeping it in one item to send to email somehow? Thanks again?
 

dhj49er

Well-known member
Variables are a key feature of MD.

Checkout the wiki for information on the use of variables

There are many different types and once you start using them, your macros will take on a new lease of life!

I used a variable so as to capture the notification Magic text for the notification that triggered the macro.

In my macro I have used a String variable that can hold text.....and I've written 2 magic texts in the set variable action. You could add other magic texts such as date & time, if that is useful to include.

The issue with your macro is writing the magic text in the email. There is uncertainty as to which notification is being used if multiple notifications are being generated. Also your macro would run on each received notification, leading to perhaps many instances of the macro running simultaneously, giving rise to unpredictable results, which I think is what you have observed.

I've attached screenshots of my test macro with the send email action added, the send email configuration and the email I received.
 

Attachments

  • Screenshot_20240106_171347_MacroDroid~2.jpg
    Screenshot_20240106_171347_MacroDroid~2.jpg
    170.4 KB · Views: 5
  • Screenshot_20240106_171405_MacroDroid~2.jpg
    Screenshot_20240106_171405_MacroDroid~2.jpg
    98.1 KB · Views: 5
  • Screenshot_20240106_171231_FairEmail~2.jpg
    Screenshot_20240106_171231_FairEmail~2.jpg
    74.1 KB · Views: 5

rwstarkey

New member
Very cool. I need to study that. Yes I'm seeing exactly what you describe. Many emails but only one has a full notification. The full notification gives "motion detected on (camera name) at (date-time)" which is what I want. All the other spurious notifications just say "motion detected". Probably 4 of those to every full one. I experimented with the "ignore multiple..." etc. check boxes but that didn't solve it. So I'll study the variable. I'm not sure how that limits the email to one good email but I'll study it I need to learn on all that. Thanks again!
 

dhj49er

Well-known member
Very cool. I need to study that. Yes I'm seeing exactly what you describe. Many emails but only one has a full notification. The full notification gives "motion detected on (camera name) at (date-time)" which is what I want. All the other spurious notifications just say "motion detected". Probably 4 of those to every full one. I experimented with the "ignore multiple..." etc. check boxes but that didn't solve it. So I'll study the variable. I'm not sure how that limits the email to one good email but I'll study it I need to learn on all that. Thanks again!
The variable alone doesn't limit the email to one good.

The constraint I described earlier is also required, if multiple notifications can't be eliminated by settings in the camera app .
 
Top