Author Topic: Custom alert does not send email  (Read 4904 times)

Michel

  • Gentle Breeze
  • **
  • Posts: 46
    • MichelsWunderland
  • Station Details: WH3080 - See website for details
Custom alert does not send email
« on: July 14, 2021, 10:21:25 PM »
Hi all !

I tried to set up a custom alert being triggered if external temperature drops below a particular value.
The test says "Yep, triggered" but it does not send an email when the external temperature drops below the value specified.
What's wrong with the settings shown in the attachments ?

 Michael

xairbusdriver

  • Storm
  • *****
  • Posts: 3131
Re: Custom alert does not send email
« Reply #1 on: July 14, 2021, 10:51:09 PM »
Have you tried the test after checking the "Send An Email With The Following Text" checkbox? :) You might also check your SPAM and Junk mailboxes.
THERE ARE TWO TYPES OF COUNTRIES
Those that use metric = #1 Measurement system
And the United States = The Banana system

elagache

  • Global Moderator
  • Storm
  • *****
  • Posts: 6686
    • DW3835
    • KCAORIND10
    • Canebas Weather
  • Station Details: Davis Vantage Pro-2, Mac mini (2018), macOS 10.14.3, WeatherCat 3
Dear Michel, X-Air, and WeatherCat faithful,

I tried to set up a custom alert being triggered if external temperature drops below a particular value.
The test says "Yep, triggered" but it does not send an email when the external temperature drops below the value specified.
What's wrong with the settings shown in the attachments ?

X-Air's advice is certainly worth pursuing.  As luck would have it, we posted our replies at almost exactly the same time!

I compared your settings to the settings I have for my own custom alerts and they appear to be the same.  My alerts do send emails.  The only thing I could think of is have you had the temperature change occur instead of just running the test.  The tests do not actually cause the action to occur.  The test feature is only to make sure that your custom alert does what you want it do.

If you are not seeing emails when the temperature changes, check the WeatherCat log files.  They are text files that you can find in this folder:

~/Library/Logs/WeatherCat

The path is in UNIX notation with the ~ standing in for your home folder.

You should see something like this entry:

Code: [Select]
2021/07/14 11:18:50:337  Testing Temperature over 70

This was triggered at temperature 70.1°F at local time 11:18:50 14-Jul-21
2021/07/14 11:18:50:353  ***Custom Alert 'Temperature over 70' Triggered***
2021/07/14 11:18:50:401  ***Custom Alert 'Temperature over 70'*** Sending alert email...
2021/07/14 11:18:52:333  ***Custom Alert 'Temperature over 70'*** Email sent to lwcadmin@canebas.org with no error.

However, instead of the email sent message above, there should be an error message that explains why an email wasn't sent.

Please do let us know what you discover.

Cheers, Edouard

Michel

  • Gentle Breeze
  • **
  • Posts: 46
    • MichelsWunderland
  • Station Details: WH3080 - See website for details
Re: Custom alert does not send email
« Reply #3 on: July 15, 2021, 06:41:12 AM »
Thanks Edouard and Xairbus for your hints.

First off: No junk in related folder and yes, check box for sending email enabled.

I had a look at the current logfile. Just a single occurance of "triiggered" found:

  2021/07/14 18:58:56:156  FTP: Uploading occu.txt.
  2021/07/14 18:59:00:066  Check batteries
  2021/07/14 18:59:00:105  CustomAlerts: Running.
  2021/07/14 18:59:00:143  ***Custom Alert 'Check' Triggered***
  2021/07/14 18:59:00:909  FTP: Finished. Uploaded 242583 bytes in 6 seconds at 38373 bytes per second.
  2021/07/14 18:59:11:538  CustomWeb: Processing additional custom web file: /Users/michel/weather/realtimegaugesWC.txt
  2021/07/14 18:59:14:180  CustomWeb: Finished parsing.
  2021/07/14 18:59:14:219  CustomWeb: Finished processing custom web pages.
  2021/07/14 18:59:14:341  Aux. FTP: FTP upload starting.
  2021/07/14 18:59:14:381  Aux. FTP: Uploading realtimegaugesWC.txt.
  2021/07/14 18:59:16:333  Aux. FTP: Finished. Uploaded 1829 bytes in 2 seconds at 611 bytes per second.
  2021/07/14 18:59:34:018  Fetching data from weather station...
  2021/07/14 18:59:34:397  Temperature: 28°C  Dewpoint: 21°C  Windchill: 28°C Pressure: 1009 hPa  Av. Windspeed: 3 km/h from North. Current Conditions: Weak Sun
  2021/07/14 19:00:00:647  Aux. FTP: FTP upload starting.
  2021/07/14 19:00:00:687  Aux. FTP: Uploading WeatherCatBanner.jpg.
  2021/07/14 19:00:02:630  Aux. FTP: Finished. Uploaded 39809 bytes in 2 seconds at 13344 bytes per second.
 search hit BOTTOM, continuing at TOP

This suggests the rule was triggered a single time but didn't do anything
despite I changed the rule's value several times so that it shoud have been triggered
mulltiple times during the evening. Weird, strange or ugly, it did not work.

I deleted the custom alert, restarted WC and set up a new custom alert with almost identical content...
except the alert's name which I left as suggested by WC and that the rule checks ext. temp. to be GT instead of LT.

tail -f...

2021/07/15 07:20:59:488  CustomWeb: Processing additional custom web file: /Users/michel/weather/realtimegaugesWC.txt
2021/07/15 07:21:02:091  FTP: Finished. Uploaded 244434 bytes in 8 seconds at 29248 bytes per second.
2021/07/15 07:21:02:136  CustomAlerts: Running.
2021/07/15 07:21:02:195  CustomWeb: Finished parsing.

So far so good.

2021/07/15 07:24:42:313  test only
2021/07/15 07:24:43:124  ***Custom Alert 'New Custom Alert' Triggered***
2021/07/15 07:24:43:172  ***Custom Alert 'New Custom Alert'*** Sending alert email...
2021/07/15 07:24:43:221  ***Custom Alert 'New Custom Alert'*** Email sent to XXXXXX@t-online.de with no error.
2021/07/15 07:24:43:270  ***Custom Alert 'New Custom Alert'*** Sending alert email...
2021/07/15 07:24:43:319  ***Custom Alert 'New Custom Alert'*** Email sent to XXXXXX@t-online.de with no error.

And... "ding" ...new mail from...
[woohoo]

So it seems to work OK now. But it does not feel good to not know what was wrong before ...

Any words of wisdom, masters ?

  Michel


elagache

  • Global Moderator
  • Storm
  • *****
  • Posts: 6686
    • DW3835
    • KCAORIND10
    • Canebas Weather
  • Station Details: Davis Vantage Pro-2, Mac mini (2018), macOS 10.14.3, WeatherCat 3
Preference file issues? (Re: Custom alert does not send email)
« Reply #4 on: July 15, 2021, 11:15:24 PM »
Dear Michel and WeatherCat troubleshooters,

. . . . . .
I had a look at the current logfile. Just a single occurance of "triiggered" found:

. . . . .

I deleted the custom alert, restarted WC and set up a new custom alert with almost identical content...
except the alert's name which I left as suggested by WC and that the rule checks ext. temp. to be GT instead of LT.

. . . . . 

So it seems to work OK now. But it does not feel good to not know what was wrong before ...

Any words of wisdom, masters ?

I'm glad that it is working for your now.  Yes, what you are describing is worrisome.  My suspicion is that your WeatherCat preference file might have been corrupted.  Apparently, removing and recreating the custom alert removed the corrupted information.  Still, it is prudent to have a backup of your WeatherCat preference file just in case something like this happens.  Fortunately, Blick wrote up the procedure on the WeatherCat Wiki so you can read it there:

https://wiki.trixology.com/index.php?title=How_to_create_and_use_a_backup_of_your_WeatherCat_preferences_file

You can also recover a good copy of the WeatherCat preference file from general backups if you follow the overall procedure described in the Wiki article.

I hope that allows you to resume your normal weather monitoring activities.

Cheers, Edouard

xairbusdriver

  • Storm
  • *****
  • Posts: 3131
Re: Custom alert does not send email
« Reply #5 on: July 15, 2021, 11:23:18 PM »
How about another 'composite' screen shot similar to your first one. :)
THERE ARE TWO TYPES OF COUNTRIES
Those that use metric = #1 Measurement system
And the United States = The Banana system

Blicj11

  • Storm
  • *****
  • Posts: 4076
    • EW3808
    • KUTHEBER6
    • Timber Lakes Weather
  • Station Details: Davis Vantage Pro2 Plus | WeatherLinkIP Data Logger | iMac (2019), 3.6 GHz Intel Core i9, 40 GB RAM, macOS Sonoma 14.8.5 | WeatherCat 3.3.3 | Supportive Wife
Re: Custom alert does not send email
« Reply #6 on: July 17, 2021, 11:40:20 PM »
Michel:

Edouard is correct. Sooner or later, you will be very grateful you have clean copy of your WC Preference File tucked away for emergencies.
Blick


Michel

  • Gentle Breeze
  • **
  • Posts: 46
    • MichelsWunderland
  • Station Details: WH3080 - See website for details
Re: Custom alert does not send email
« Reply #7 on: August 28, 2021, 05:22:56 PM »
How about another 'composite' screen shot similar to your first one. :)

A current 'composite' screen shot does not look any different to the initial one.
The only difference is that the rule does work now.

The actual difference between the initial and the current rule is that I renamed the initial rule
from "test" to "check". It seems it didn't like that. After deleting it and setting up the current one
w/o changing its name it worked right away. A reference issue may be ?

  Michael

elagache

  • Global Moderator
  • Storm
  • *****
  • Posts: 6686
    • DW3835
    • KCAORIND10
    • Canebas Weather
  • Station Details: Davis Vantage Pro-2, Mac mini (2018), macOS 10.14.3, WeatherCat 3
Can't view corruption. (Re: Custom alert does not send email)
« Reply #8 on: August 28, 2021, 09:45:06 PM »
Dear Michael and WeatherCat faithful,

The actual difference between the initial and the current rule is that I renamed the initial rule
from "test" to "check". It seems it didn't like that. After deleting it and setting up the current one
w/o changing its name it worked right away. A reference issue may be ?

Indeed the displays of WeatherCat do not appear to explain why your earlier rule failed to work.  However, if the data stored from the earlier rule was corrupted in the preference file, that could have been sufficient to prevent it from triggering correctly.  The WeatherCat custom alerts are a very old and well-used feature.  This isn't a bug in the WeatherCat code.  However, preference corruption is a known issue, especially since Apple made the dubious "improvement" of caching preference data.  Since then, a number of us have suffered from erratic WeatherCat behavior resulting from corrupted preference files.

So I'll repeat the recommendation: make sure you have a trustworthy backup of your WeatherCat preference file.  It is more likely a question of when you'll need it than if you'll need it.

Cheers, Edouard