alarm module - multiple alarms

852 views
Skip to first unread message

William Phelps

unread,
May 1, 2013, 1:06:00 PM5/1/13
to weewx...@googlegroups.com
I modified the example "alarm.py" to support multiple alarms.  The entries in weewx.conf now look like this:

[Alarm]
  time_wait = 3600
  smtp_host = smtp.mymailserver.com
  smtp_user = myusername
  smtp_password = mypassword

  count = 2
  expression.0 = "outTemp < 40.0"
  subject.0 = "Alarm message from weewx - Low temperature!"
  expression.1 = "outTemp > 90.0"
  subject.1 = "Alarm message from weewx- High temperature!"

I've attached a zip of alarm.py

It's still "static" - to change the alarms, you have to restart weewx after editing weewx.conf.  I thought about having alarm.py re-fetch the config data but that seems like it might be a performance hit since the code is attached to the NEW_ARCHIVE_RECORD event.  Maybe attach another event to re-read the config data?

William
alarm.zip

Steve2Q

unread,
Sep 13, 2015, 12:13:24 PM9/13/15
to weewx-user
Hi William: I think your mod will do what I want.

I have 2 questions:

1. Will your modification yield separate emails if one or the other conditions are met?

2. Does the "count =2" refer to the number of separate conditions being evaluated? If so then "count =x" will let x conditions be checked?

I tried to just set expression = " X or Y" in an attempt to get separate emails if either condition was true, but this only results in 1 email if X or Y is true, and the values for both X and Y are in the email.

Thanks, Steve

William Phelps

unread,
Sep 13, 2015, 4:32:02 PM9/13/15
to weewx...@googlegroups.com
Hello Steve,

Frankly it's been so long since I wrote this I don't remember the details now.  All I know is it did what I wanted, it allowed me to have multiple alarms and it sends me email when the conditions are met.  The source code is there, being written in Python, so I suggest you take a look at it.

Regards,
William

--
You received this message because you are subscribed to a topic in the Google Groups "weewx-user" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/weewx-user/-IGQC3CpXAE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to weewx-user+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
(sent from an alien in the Andromeda Galaxy - read at your own risk!)

Steve2Q

unread,
Sep 14, 2015, 10:59:22 AM9/14/15
to weewx-user, wbph...@gmail.com
Hi William:

I did not see that you wrote the mod so long ago. When I tried it I got a "No alarm set. 'expression' " error. Maybe your mod is not compatible with Weewx V 3.2.1 as the  newer alarm.py has additional code. I did make a "cut and paste" trial where I added your stuff into the new version, but that gives me the same error message. I will add that although I get the message in syslog, Weewx does not crash. I only know very little about Python, so I am not sure where to look for the problem, but thank you for giving me a starting place.

Steve


bjs...@gmail.com

unread,
Apr 5, 2017, 10:18:25 PM4/5/17
to weewx-user, wbph...@gmail.com
I realize this is a very old thread, but was wondering if the problems were ever resolved?  I'd like to setup multiple alarms but  I get the error message listed for the missing "expression" variable.

Bill S.

gjr80

unread,
Apr 6, 2017, 12:11:53 AM4/6/17
to weewx-user
Hi,

There have been substantial changes to the weeWX architecture since William posted his code (May 2013 - circa weeWX 2.3.1). I have taken the current (3.7.1) example alarm.py and overlaid William's code. It is working fine for me under 3.7.1 but I would not say it has been extensively tested. Try the attached alarm_multi.py, setup instructions are in the comments at the start of the file, note that as this file is named alarm_multi.py you need to use user.alarm_multi.MyAlarm when you add it to the list of report services.

Gary
alarm_multi.py

bjs...@gmail.com

unread,
Apr 6, 2017, 2:26:03 AM4/6/17
to weewx-user
Thanks for the updated script.  I see the code that does the multiple alarms.  I'll give it a try tomorrow.

Bill S.

bjs...@gmail.com

unread,
Apr 6, 2017, 1:09:28 PM4/6/17
to weewx-user
Just tested the revised alarm script and it is working for me.  Thanks so much for your assistance.  This is great.


Bill S.

On Wednesday, April 5, 2017 at 9:11:53 PM UTC-7, gjr80 wrote:

Micael Fredriksson

unread,
Mar 12, 2019, 4:06:50 AM3/12/19
to weewx-user
Hi!

Does anyone got this to work on weewx 3.9.1?

I had the original alarm.py working, but this one doesn't send email. I get the alarm expression true in the log but it never sends an email.
I double checked the credentials and the smtp settings.

/Mikael

pligg...@gmail.com

unread,
Sep 19, 2020, 3:57:45 AM9/19/20
to weewx-user

Tried this again today but it doesn't send email. I see the expression true in the logs. Has anyone got some idea why the old alarm.py works fine but not the "new" alarm_multi.py?
First tried on weewx 3.9.1 and now on 4.0.0 but still the same result.
//Mikael

Steve Meltz

unread,
Sep 19, 2020, 10:30:26 AM9/19/20
to weewx...@googlegroups.com
Thats why I did not do the upgrade. 3.8.2 does everything I want, plus I did not want my Steel Guages to be broken.

--
You received this message because you are subscribed to a topic in the Google Groups "weewx-user" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/weewx-user/-IGQC3CpXAE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to weewx-user+...@googlegroups.com.
Message has been deleted

gjr80

unread,
Sep 19, 2020, 5:33:06 PM9/19/20
to weewx-user
If the condition is being triggered and logged its possible the issue is with the email transport. Any clues will be in the logs. Set debug = 1 in weewx.conf and restart WeeWX then cause one of the conditions to be triggered. Post the WeeWX log. Look in the emails logs for your system, which log will depend on your system but syslog, mail.err, mail.log and mail.info may be good places to look.

Gary

pligg...@gmail.com

unread,
Sep 20, 2020, 4:09:29 PM9/20/20
to weewx-user
Gary, 

here's the syslog with 2 cycle's recorded in debug = 1. 
And my mail.log shows that the system have sent mail for some other events I have on my machine, like when the "raspibackup" has run att night. But no record for sent mail when 
the conditions in alarm are being met. And no logs in mail.err or mail.info.

There must be some difference in the two scripts (alarm.py and alarm_multi.py) in handling the send mail function.

Which is the best way to compare two scripts?   

Can I provide more info from my system?

//Mikael


Sep 20 21:40:21 raspberrypi weewxd: pond: found value of 51.9116
Sep 20 21:40:21 raspberrypi weewxd: pond: found value of 66.0866
Sep 20 21:40:21 raspberrypi weewxd: pond: found value of 99.9000
Sep 20 21:40:21 raspberrypi weewxd: pond: found value of 56.1866
Sep 20 21:40:21 raspberrypi weewx[21830] INFO weewx.manager: Added record 2020-09-20 21:40:00 CEST (1600630800) to database 'weewx.sdb'
Sep 20 21:40:21 raspberrypi weewx[21830] INFO weewx.manager: Added record 2020-09-20 21:40:00 CEST (1600630800) to daily summary in 'weewx.sdb'
Sep 20 21:40:21 raspberrypi weewxd: forecast: MainThread: Zambretti: starting thread
Sep 20 21:40:21 raspberrypi weewxd: forecast: ZambrettiThread: Zambretti: generating forecast for 2020-09-20 09:00:00 CEST (1600585200)
Sep 20 21:40:21 raspberrypi weewxd: forecast: MainThread: OWM: starting thread
Sep 20 21:40:21 raspberrypi weewxd: forecast: ZambrettiThread: Zambretti: using winddir from 2020-09-20 08:30:00 CEST (1600583400) to 2020-09-20 09:00:00 CEST (1600585200)
Sep 20 21:40:21 raspberrypi weewxd: forecast: ZambrettiThread: Zambretti: using pressure from 2020-09-20 06:00:00 CEST (1600574400) to 2020-09-20 09:00:00 CEST (1600585200)
Sep 20 21:40:21 raspberrypi weewxd: forecast: MainThread: UKMO: starting thread
Sep 20 21:40:21 raspberrypi weewxd: forecast: UKMOThread: UKMO: download forecast from 'http://datapoint.metoffice.gov.uk/public/data/val/wxfcs/all/json/2337?res=3hourly&key=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX5b92'
Sep 20 21:40:21 raspberrypi weewxd: alarm: Alarm expression "extraTemp1 > 40 " evaluated True at 2020-09-20 21:40:00 CEST (1600630800)
Sep 20 21:40:22 raspberrypi weewx[21830] DEBUG weewx.reportengine: Running reports for latest time in the database.
Sep 20 21:40:22 raspberrypi weewx[21830] DEBUG weewx.reportengine: Running report 'StandardReport'
Sep 20 21:40:22 raspberrypi weewx[21830] DEBUG weewx.manager: Daily summary version is 2.0
Sep 20 21:40:22 raspberrypi weewxd: forecast: ZambrettiThread: Zambretti: units=1 winddir=201.384659129 pressure=30.1827110769 first_p=30.1893485695 last_p=30.1772155811
Sep 20 21:40:22 raspberrypi weewxd: forecast: ZambrettiThread: Zambretti: pressure=1022.10375392 month=8 winddir=8 trend=-0.136956693595 north=True
Sep 20 21:40:22 raspberrypi weewxd: forecast: ZambrettiThread: Zambretti: code is R
Sep 20 21:40:22 raspberrypi weewxd: forecast: ZambrettiThread: Zambretti: generated 1 forecast record
Sep 20 21:40:22 raspberrypi weewx[21830] DEBUG weewx.reportengine: Found configuration file /etc/weewx/skins/Bjurdammen/skin.conf for report 'StandardReport'
Sep 20 21:40:22 raspberrypi weewx[21830] DEBUG weewx.cheetahgenerator: Using search list ['weewx.cheetahgenerator.Almanac', 'weewx.cheetahgenerator.Station', 'weewx.cheetahgenerator.Current', 'weewx.cheetahgenerator.Stats', 'weewx.cheetahgenerator.UnitInfo', 'weewx.cheetahgenerator.Extras', u'user.forecast.ForecastVariables', u'user.stats.MyStats', u'user.historygenerator.MyXSearch', u'user.lastrain.lastRainTags']
Sep 20 21:40:22 raspberrypi weewxd: forecast: ZambrettiThread: Zambretti: saving 1 forecast records
Sep 20 21:40:22 raspberrypi weewxd: forecast: ZambrettiThread: Zambretti: forecast failure: addRecord() got an unexpected keyword argument 'log_level'
Sep 20 21:40:22 raspberrypi weewxd: forecast: ZambrettiThread: Zambretti: terminating thread
Sep 20 21:40:22 raspberrypi weewx[21830] DEBUG weewx.manager: Daily summary version is 2.0
Sep 20 21:40:22 raspberrypi weewxd: historygenerator.pyc: No bootstrap specific labels found
Sep 20 21:40:22 raspberrypi weewxd: forecast: OWMThread: OWM: got 40 forecast records
Sep 20 21:40:22 raspberrypi weewxd: forecast: OWMThread: OWM: saving 40 forecast records
Sep 20 21:40:22 raspberrypi weewxd: forecast: OWMThread: OWM: forecast failure: addRecord() got an unexpected keyword argument 'log_level'
Sep 20 21:40:22 raspberrypi weewxd: forecast: OWMThread: OWM: terminating thread
Sep 20 21:40:22 raspberrypi weewx[21830] INFO weewx.restx: WeatherCloud: Published record 2020-09-20 21:40:00 CEST (1600630800)
Sep 20 21:40:22 raspberrypi weewx[21830] INFO weewx.restx: Windy: Published record 2020-09-20 21:40:00 CEST (1600630800)
Sep 20 21:40:22 raspberrypi weewxd: forecast: UKMOThread: UKMO: missing field 'Location'
Sep 20 21:40:22 raspberrypi weewxd: forecast: UKMOThread: UKMO: got 0 forecast records
Sep 20 21:40:22 raspberrypi weewxd: forecast: UKMOThread: UKMO: saving 0 forecast records
Sep 20 21:40:22 raspberrypi weewxd: forecast: UKMOThread: UKMO: forecast failure: addRecord() got an unexpected keyword argument 'log_level'
Sep 20 21:40:22 raspberrypi weewxd: forecast: UKMOThread: UKMO: terminating thread
Sep 20 21:40:23 raspberrypi weewx[21830] INFO weewx.restx: Wunderground-PWS: Published record 2020-09-20 21:40:00 CEST (1600630800)
Sep 20 21:40:23 raspberrypi weewxd: historygenerator.pyc: Generated 19 tables in 1.09 seconds
Sep 20 21:40:29 raspberrypi weewx[21830] INFO weewx.cheetahgenerator: Generated 8 files for report StandardReport in 6.82 seconds
Sep 20 21:40:29 raspberrypi weewx[21830] DEBUG weewx.manager: Daily summary version is 2.0
Sep 20 21:40:32 raspberrypi weewx[21830] DEBUG weewx.restx: WOW: Failed upload attempt 1: timed out
Sep 20 21:40:37 raspberrypi weewx[21830] INFO weewx.restx: WOW: Published record 2020-09-20 21:40:00 CEST (1600630800)
Sep 20 21:40:40 raspberrypi weewx[21830] INFO weewx.imagegenerator: Generated 16 images for report StandardReport in 11.32 seconds
Sep 20 21:40:40 raspberrypi weewx[21830] INFO weewx.reportengine: Copied 3 files to /var/www/html/weewx
Sep 20 21:40:40 raspberrypi weewx[21830] DEBUG weewx.reportengine: Running report 'Sofaskin-FW2205-master'
Sep 20 21:40:40 raspberrypi weewx[21830] DEBUG weewx.reportengine: Found configuration file /etc/weewx/skins/Sofaskin-FW2205-master/skin.conf for report 'Sofaskin-FW2205-master'
Sep 20 21:40:40 raspberrypi weewx[21830] DEBUG weewx.cheetahgenerator: Using search list ['weewx.cheetahgenerator.Almanac', 'weewx.cheetahgenerator.Station', 'weewx.cheetahgenerator.Current', 'weewx.cheetahgenerator.Stats', 'weewx.cheetahgenerator.UnitInfo', 'weewx.cheetahgenerator.Extras', u'user.historygenerator.MyXSearch']
Sep 20 21:40:40 raspberrypi weewx[21830] DEBUG weewx.manager: Daily summary version is 2.0
Sep 20 21:40:40 raspberrypi weewxd: historygenerator.pyc: No bootstrap specific labels found
Sep 20 21:40:40 raspberrypi weewxd: historygenerator.pyc: Generated 8 tables in 0.36 seconds
Sep 20 21:40:47 raspberrypi weewx[21830] INFO weewx.cheetahgenerator: Generated 10 files for report Sofaskin-FW2205-master in 7.02 seconds
Sep 20 21:40:47 raspberrypi weewx[21830] DEBUG weewx.manager: Daily summary version is 2.0
Sep 20 21:40:47 raspberrypi weewx[21830] DEBUG PIL.PngImagePlugin: STREAM 'IHDR' 16 13
Sep 20 21:40:47 raspberrypi weewx[21830] DEBUG PIL.PngImagePlugin: STREAM 'IDAT' 41 1216
Sep 20 21:40:47 raspberrypi weewx[21830] DEBUG PIL.PngImagePlugin: STREAM 'IHDR' 16 13
Sep 20 21:40:47 raspberrypi weewx[21830] DEBUG PIL.PngImagePlugin: STREAM 'IDAT' 41 1216
Sep 20 21:40:48 raspberrypi weewx[21830] INFO weewx.imagegenerator: Generated 9 images for report Sofaskin-FW2205-master in 0.97 seconds
Sep 20 21:40:48 raspberrypi weewx[21830] INFO weewx.reportengine: Copied 8 files to /var/www/html/weewx/Sofaskin-FW2205-master
Sep 20 21:40:48 raspberrypi weewx[21830] DEBUG weewx.reportengine: Running report 'Bjurdammen'
Sep 20 21:40:48 raspberrypi weewx[21830] DEBUG weewx.reportengine: Found configuration file /etc/weewx/skins/Bjurdammen/skin.conf for report 'Bjurdammen'
Sep 20 21:40:48 raspberrypi weewx[21830] DEBUG weewx.cheetahgenerator: Using search list ['weewx.cheetahgenerator.Almanac', 'weewx.cheetahgenerator.Station', 'weewx.cheetahgenerator.Current', 'weewx.cheetahgenerator.Stats', 'weewx.cheetahgenerator.UnitInfo', 'weewx.cheetahgenerator.Extras', u'user.forecast.ForecastVariables', u'user.stats.MyStats', u'user.historygenerator.MyXSearch', u'user.lastrain.lastRainTags']
Sep 20 21:40:48 raspberrypi weewx[21830] DEBUG weewx.manager: Daily summary version is 2.0
Sep 20 21:40:48 raspberrypi weewxd: historygenerator.pyc: No bootstrap specific labels found
Sep 20 21:40:49 raspberrypi weewxd: historygenerator.pyc: Generated 19 tables in 0.81 seconds
Sep 20 21:40:51 raspberrypi weewx[21830] INFO weewx.cheetahgenerator: Generated 8 files for report Bjurdammen in 3.17 seconds
Sep 20 21:40:51 raspberrypi weewx[21830] DEBUG weewx.manager: Daily summary version is 2.0
Sep 20 21:41:01 raspberrypi systemd[1]: Started Session c78307 of user pliggen.
Sep 20 21:41:02 raspberrypi systemd[1]: Started Session c78308 of user pliggen.
Sep 20 21:41:03 raspberrypi weewx[21830] INFO weewx.imagegenerator: Generated 16 images for report Bjurdammen in 11.28 seconds
Sep 20 21:41:03 raspberrypi weewx[21830] INFO weewx.reportengine: Copied 3 files to /var/www/html/weewx/Bjurdammen
Sep 20 21:41:03 raspberrypi weewx[21830] DEBUG weewx.reportengine: Running report 'SeasonsReport'
Sep 20 21:41:03 raspberrypi weewx[21830] DEBUG weewx.reportengine: Found configuration file /etc/weewx/skins/Bjurdammen/skin.conf for report 'SeasonsReport'
Sep 20 21:41:03 raspberrypi weewx[21830] DEBUG weewx.cheetahgenerator: Using search list ['weewx.cheetahgenerator.Almanac', 'weewx.cheetahgenerator.Station', 'weewx.cheetahgenerator.Current', 'weewx.cheetahgenerator.Stats', 'weewx.cheetahgenerator.UnitInfo', 'weewx.cheetahgenerator.Extras', u'user.forecast.ForecastVariables', u'user.stats.MyStats', u'user.historygenerator.MyXSearch', u'user.lastrain.lastRainTags']
Sep 20 21:41:03 raspberrypi weewx[21830] DEBUG weewx.manager: Daily summary version is 2.0
Sep 20 21:41:03 raspberrypi weewxd: historygenerator.pyc: No bootstrap specific labels found
Sep 20 21:41:04 raspberrypi weewxd: historygenerator.pyc: Generated 19 tables in 0.81 seconds
Sep 20 21:41:06 raspberrypi weewx[21830] INFO weewx.cheetahgenerator: Generated 8 files for report SeasonsReport in 3.20 seconds
Sep 20 21:41:06 raspberrypi weewx[21830] DEBUG weewx.manager: Daily summary version is 2.0
Sep 20 21:41:17 raspberrypi weewx[21830] INFO weewx.imagegenerator: Generated 16 images for report SeasonsReport in 11.30 seconds
Sep 20 21:41:17 raspberrypi weewx[21830] INFO weewx.reportengine: Copied 3 files to /var/www/html/weewx
Sep 20 21:41:17 raspberrypi weewx[21830] DEBUG weewx.reportengine: Report 'SmartphoneReport' not enabled. Skipping.
Sep 20 21:41:17 raspberrypi weewx[21830] DEBUG weewx.reportengine: Report 'MobileReport' not enabled. Skipping.
Sep 20 21:41:17 raspberrypi weewx[21830] DEBUG weewx.reportengine: Running report 'BigImages'
Sep 20 21:41:17 raspberrypi weewx[21830] DEBUG weewx.reportengine: Found configuration file /etc/weewx/skins/Images/skin.conf for report 'BigImages'
Sep 20 21:41:18 raspberrypi weewxd: translategenerator.pyc: No language override specified.
Sep 20 21:41:18 raspberrypi weewx[21830] DEBUG weewx.manager: Daily summary version is 2.0
Sep 20 21:41:20 raspberrypi weewx[21830] INFO weewx.imagegenerator: Generated 6 images for report BigImages in 2.96 seconds
Sep 20 21:41:20 raspberrypi weewx[21830] DEBUG weewx.reportengine: Running report 'SmallImages'
Sep 20 21:41:21 raspberrypi weewx[21830] DEBUG weewx.reportengine: Found configuration file /etc/weewx/skins/Images/skin.conf for report 'SmallImages'
Sep 20 21:41:21 raspberrypi weewxd: translategenerator.pyc: No language override specified.
Sep 20 21:41:21 raspberrypi weewx[21830] DEBUG weewx.manager: Daily summary version is 2.0
Sep 20 21:41:22 raspberrypi weewx[21830] INFO weewx.imagegenerator: Generated 6 images for report SmallImages in 1.08 seconds
Sep 20 21:41:22 raspberrypi weewx[21830] DEBUG weewx.reportengine: Running report 'StackedWindRose'
Sep 20 21:41:22 raspberrypi weewx[21830] DEBUG weewx.reportengine: Found configuration file /etc/weewx/skins/StackedWindRose/skin.conf for report 'StackedWindRose'
Sep 20 21:41:22 raspberrypi weewx[21830] DEBUG weewx.manager: Daily summary version is 2.0
Sep 20 21:41:22 raspberrypi weewx[21830] INFO user.stackedwindrose: Generated 2 images for StackedWindRose in 0.60 seconds
Sep 20 21:41:22 raspberrypi weewx[21830] DEBUG weewx.reportengine: Running report 'lastrain'
Sep 20 21:41:22 raspberrypi weewx[21830] DEBUG weewx.reportengine: Found configuration file /etc/weewx/skins/lastrain/skin.conf for report 'lastrain'
Sep 20 21:41:22 raspberrypi weewx[21830] DEBUG weewx.cheetahgenerator: Using search list ['weewx.cheetahgenerator.Almanac', 'weewx.cheetahgenerator.Station', 'weewx.cheetahgenerator.Current', 'weewx.cheetahgenerator.Stats', 'weewx.cheetahgenerator.UnitInfo', 'weewx.cheetahgenerator.Extras', u'user.lastrain.lastRainTags']
Sep 20 21:41:22 raspberrypi weewx[21830] DEBUG weewx.manager: Daily summary version is 2.0
Sep 20 21:41:22 raspberrypi weewx[21830] INFO weewx.cheetahgenerator: Generated 1 files for report lastrain in 0.08 seconds
Sep 20 21:41:22 raspberrypi weewx[21830] DEBUG weewx.reportengine: Running report 'HighchartsAverages'
Sep 20 21:41:22 raspberrypi weewx[21830] DEBUG weewx.reportengine: Found configuration file /etc/weewx/skins/HighchartsAverages/skin.conf for report 'HighchartsAverages'
Sep 20 21:41:22 raspberrypi weewx[21830] DEBUG weewx.reportengine: Report 'HighchartsAverages' skipped due to report_timing setting
Sep 20 21:41:22 raspberrypi weewx[21830] DEBUG weewx.reportengine: Running report 'wxobs'
Sep 20 21:41:22 raspberrypi weewx[21830] DEBUG weewx.reportengine: Found configuration file /etc/weewx/skins/wxobs/skin.conf for report 'wxobs'
Sep 20 21:41:22 raspberrypi weewx[21830] DEBUG weewx.cheetahgenerator: Using search list ['weewx.cheetahgenerator.Almanac', 'weewx.cheetahgenerator.Station', 'weewx.cheetahgenerator.Current', 'weewx.cheetahgenerator.Stats', 'weewx.cheetahgenerator.UnitInfo', 'weewx.cheetahgenerator.Extras', u'user.wxobs.wxobs']
Sep 20 21:41:23 raspberrypi weewx[21830] DEBUG weewx.manager: Daily summary version is 2.0
Sep 20 21:41:26 raspberrypi weewx[21830] INFO weewx.cheetahgenerator: Generated 1 files for report wxobs in 3.05 seconds
Sep 20 21:41:26 raspberrypi weewx[21830] INFO weewx.reportengine: Copied 8 files to /var/www/html/weewx/wxobs
Sep 20 21:41:26 raspberrypi weewx[21830] DEBUG weewx.reportengine: Running report 'FTP'
Sep 20 21:41:26 raspberrypi weewx[21830] DEBUG weewx.reportengine: Found configuration file /etc/weewx/skins/Ftp/skin.conf for report 'FTP'
Sep 20 21:41:26 raspberrypi weewx[21830] DEBUG weewx.reportengine: ftpgenerator: FTP upload not requested. Skipped.
Sep 20 21:41:26 raspberrypi weewx[21830] DEBUG weewx.reportengine: Running report 'RSYNC'
Sep 20 21:41:26 raspberrypi weewx[21830] DEBUG weewx.reportengine: Found configuration file /etc/weewx/skins/Rsync/skin.conf for report 'RSYNC'
Sep 20 21:41:26 raspberrypi weewx[21830] DEBUG weewx.reportengine: rsyncgenerator: Rsync upload not requested. Skipped.
Sep 20 21:42:01 raspberrypi systemd[1]: Started Session c78309 of user pliggen.
Sep 20 21:42:02 raspberrypi systemd[1]: Started Session c78310 of user pliggen.
Sep 20 21:43:01 raspberrypi systemd[1]: Started Session c78311 of user pliggen.
Sep 20 21:43:02 raspberrypi systemd[1]: Started Session c78312 of user pliggen.
Sep 20 21:44:02 raspberrypi systemd[1]: Started Session c78313 of user pliggen.
Sep 20 21:44:02 raspberrypi systemd[1]: Started Session c78314 of user pliggen.
Sep 20 21:45:01 raspberrypi CRON[22732]: (pliggen) CMD (/usr/bin/php7.0 /var/www/html/weewx/smhi_warnings_bjurdammen.php > /dev/null 2>&1)
Sep 20 21:45:01 raspberrypi systemd[1]: Started Session c78315 of user pliggen.
Sep 20 21:45:02 raspberrypi systemd[1]: Started Session c78316 of user pliggen.
Sep 20 21:46:01 raspberrypi systemd[1]: Started Session c78317 of user pliggen.
Sep 20 21:46:02 raspberrypi systemd[1]: Started Session c78318 of user pliggen.
Sep 20 21:47:01 raspberrypi systemd[1]: Started Session c78319 of user pliggen.
Sep 20 21:47:02 raspberrypi systemd[1]: Started Session c78320 of user pliggen.
Sep 20 21:48:01 raspberrypi CRON[23003]: (pliggen) CMD (/usr/bin/python3 /var/www/html/weewx/smhiheader.py)
Sep 20 21:48:01 raspberrypi CRON[23002]: (pliggen) CMD (/usr/bin/python3 /var/www/html/weewx/smhitext.py)
Sep 20 21:48:01 raspberrypi CRON[23007]: (pliggen) CMD (/usr/bin/python3 /var/www/html/weewx/smhitime.py)
Sep 20 21:48:02 raspberrypi systemd[1]: Started Session c78321 of user pliggen.
Sep 20 21:48:02 raspberrypi systemd[1]: Started Session c78322 of user pliggen.
Sep 20 21:49:01 raspberrypi systemd[1]: Started Session c78323 of user pliggen.
Sep 20 21:49:02 raspberrypi systemd[1]: Started Session c78324 of user pliggen.
Sep 20 21:50:01 raspberrypi systemd[1]: Started Session c78325 of user pliggen.
Sep 20 21:50:01 raspberrypi CRON[23234]: (pliggen) CMD (sh /home/pliggen/Dokument/rename.sh > /dev/null 2>&1)
Sep 20 21:50:02 raspberrypi systemd[1]: Started Session c78326 of user pliggen.
Sep 20 21:50:24 raspberrypi weewxd: pond: found value of 51.9116
Sep 20 21:50:24 raspberrypi weewxd: pond: found value of 66.2
Sep 20 21:50:24 raspberrypi weewxd: pond: found value of 99.9000
Sep 20 21:50:24 raspberrypi weewxd: pond: found value of 55.9616
Sep 20 21:50:24 raspberrypi weewx[21830] INFO weewx.manager: Added record 2020-09-20 21:50:00 CEST (1600631400) to database 'weewx.sdb'
Sep 20 21:50:24 raspberrypi weewx[21830] INFO weewx.manager: Added record 2020-09-20 21:50:00 CEST (1600631400) to daily summary in 'weewx.sdb'
Sep 20 21:50:25 raspberrypi weewxd: forecast: MainThread: Zambretti: starting thread
Sep 20 21:50:25 raspberrypi weewxd: forecast: ZambrettiThread: Zambretti: forecast was already calculated for 2020-09-20 09:00:00 CEST (1600585200)
Sep 20 21:50:25 raspberrypi weewxd: forecast: MainThread: OWM: starting thread
Sep 20 21:50:25 raspberrypi weewxd: forecast: ZambrettiThread: Zambretti: terminating thread
Sep 20 21:50:25 raspberrypi weewxd: forecast: MainThread: UKMO: starting thread
Sep 20 21:50:25 raspberrypi weewxd: forecast: UKMOThread: UKMO: download forecast from 'http://datapoint.metoffice.gov.uk/public/data/val/wxfcs/all/json/2337?res=3hourly&key=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX5b92'
Sep 20 21:50:25 raspberrypi weewxd: alarm: Alarm expression "extraTemp1 > 40 " evaluated True at 2020-09-20 21:50:00 CEST (1600631400)
Sep 20 21:50:25 raspberrypi weewx[21830] DEBUG weewx.reportengine: Running reports for latest time in the database.
Sep 20 21:50:25 raspberrypi weewx[21830] DEBUG weewx.reportengine: Running report 'StandardReport'
Sep 20 21:50:25 raspberrypi weewx[21830] DEBUG weewx.reportengine: Found configuration file /etc/weewx/skins/Bjurdammen/skin.conf for report 'StandardReport'
Sep 20 21:50:25 raspberrypi weewx[21830] DEBUG weewx.cheetahgenerator: Using search list ['weewx.cheetahgenerator.Almanac', 'weewx.cheetahgenerator.Station', 'weewx.cheetahgenerator.Current', 'weewx.cheetahgenerator.Stats', 'weewx.cheetahgenerator.UnitInfo', 'weewx.cheetahgenerator.Extras', u'user.forecast.ForecastVariables', u'user.stats.MyStats', u'user.historygenerator.MyXSearch', u'user.lastrain.lastRainTags']
Sep 20 21:50:25 raspberrypi weewx[21830] DEBUG weewx.manager: Daily summary version is 2.0
Sep 20 21:50:25 raspberrypi weewxd: historygenerator.pyc: No bootstrap specific labels found
Sep 20 21:50:25 raspberrypi weewxd: forecast: OWMThread: OWM: got 40 forecast records
Sep 20 21:50:25 raspberrypi weewxd: forecast: OWMThread: OWM: saving 40 forecast records
Sep 20 21:50:25 raspberrypi weewxd: forecast: OWMThread: OWM: forecast failure: addRecord() got an unexpected keyword argument 'log_level'
Sep 20 21:50:25 raspberrypi weewxd: forecast: OWMThread: OWM: terminating thread
Sep 20 21:50:25 raspberrypi weewx[21830] INFO weewx.restx: Windy: Published record 2020-09-20 21:50:00 CEST (1600631400)
Sep 20 21:50:25 raspberrypi weewx[21830] INFO weewx.restx: WOW: Published record 2020-09-20 21:50:00 CEST (1600631400)
Sep 20 21:50:25 raspberrypi weewx[21830] INFO weewx.restx: Wunderground-PWS: Published record 2020-09-20 21:50:00 CEST (1600631400)
Sep 20 21:50:25 raspberrypi weewxd: historygenerator.pyc: Generated 19 tables in 0.75 seconds
Sep 20 21:50:26 raspberrypi weewxd: forecast: UKMOThread: UKMO: missing field 'Location'
Sep 20 21:50:26 raspberrypi weewxd: forecast: UKMOThread: UKMO: got 0 forecast records
Sep 20 21:50:26 raspberrypi weewxd: forecast: UKMOThread: UKMO: saving 0 forecast records
Sep 20 21:50:26 raspberrypi weewxd: forecast: UKMOThread: UKMO: forecast failure: addRecord() got an unexpected keyword argument 'log_level'
Sep 20 21:50:26 raspberrypi weewxd: forecast: UKMOThread: UKMO: terminating thread
Sep 20 21:50:27 raspberrypi weewx[21830] INFO weewx.restx: WeatherCloud: Published record 2020-09-20 21:50:00 CEST (1600631400)
Sep 20 21:50:28 raspberrypi weewx[21830] INFO weewx.cheetahgenerator: Generated 8 files for report StandardReport in 3.31 seconds
Sep 20 21:50:28 raspberrypi weewx[21830] DEBUG weewx.manager: Daily summary version is 2.0
Sep 20 21:50:39 raspberrypi weewx[21830] INFO weewx.imagegenerator: Generated 16 images for report StandardReport in 11.31 seconds
Sep 20 21:50:39 raspberrypi weewx[21830] INFO weewx.reportengine: Copied 0 files to /var/www/html/weewx
Sep 20 21:50:39 raspberrypi weewx[21830] DEBUG weewx.reportengine: Running report 'Sofaskin-FW2205-master'
Sep 20 21:50:39 raspberrypi weewx[21830] DEBUG weewx.reportengine: Found configuration file /etc/weewx/skins/Sofaskin-FW2205-master/skin.conf for report 'Sofaskin-FW2205-master'
Sep 20 21:50:39 raspberrypi weewx[21830] DEBUG weewx.cheetahgenerator: Using search list ['weewx.cheetahgenerator.Almanac', 'weewx.cheetahgenerator.Station', 'weewx.cheetahgenerator.Current', 'weewx.cheetahgenerator.Stats', 'weewx.cheetahgenerator.UnitInfo', 'weewx.cheetahgenerator.Extras', u'user.historygenerator.MyXSearch']
Sep 20 21:50:39 raspberrypi weewx[21830] DEBUG weewx.manager: Daily summary version is 2.0
Sep 20 21:50:39 raspberrypi weewxd: historygenerator.pyc: No bootstrap specific labels found
Sep 20 21:50:40 raspberrypi weewxd: historygenerator.pyc: Generated 8 tables in 0.25 seconds
Sep 20 21:50:42 raspberrypi weewx[21830] INFO weewx.cheetahgenerator: Generated 10 files for report Sofaskin-FW2205-master in 2.68 seconds
Sep 20 21:50:42 raspberrypi weewx[21830] DEBUG weewx.manager: Daily summary version is 2.0
Sep 20 21:50:43 raspberrypi weewx[21830] INFO weewx.imagegenerator: Generated 9 images for report Sofaskin-FW2205-master in 0.85 seconds
Sep 20 21:50:43 raspberrypi weewx[21830] INFO weewx.reportengine: Copied 0 files to /var/www/html/weewx/Sofaskin-FW2205-master
Sep 20 21:50:43 raspberrypi weewx[21830] DEBUG weewx.reportengine: Running report 'Bjurdammen'
Sep 20 21:50:43 raspberrypi weewx[21830] DEBUG weewx.reportengine: Found configuration file /etc/weewx/skins/Bjurdammen/skin.conf for report 'Bjurdammen'
Sep 20 21:50:43 raspberrypi weewx[21830] DEBUG weewx.cheetahgenerator: Using search list ['weewx.cheetahgenerator.Almanac', 'weewx.cheetahgenerator.Station', 'weewx.cheetahgenerator.Current', 'weewx.cheetahgenerator.Stats', 'weewx.cheetahgenerator.UnitInfo', 'weewx.cheetahgenerator.Extras', u'user.forecast.ForecastVariables', u'user.stats.MyStats', u'user.historygenerator.MyXSearch', u'user.lastrain.lastRainTags']
Sep 20 21:50:43 raspberrypi weewx[21830] DEBUG weewx.manager: Daily summary version is 2.0
Sep 20 21:50:43 raspberrypi weewxd: historygenerator.pyc: No bootstrap specific labels found
Sep 20 21:50:44 raspberrypi weewxd: historygenerator.pyc: Generated 19 tables in 0.69 seconds
Sep 20 21:50:46 raspberrypi weewx[21830] INFO weewx.cheetahgenerator: Generated 8 files for report Bjurdammen in 3.02 seconds
Sep 20 21:50:46 raspberrypi weewx[21830] DEBUG weewx.manager: Daily summary version is 2.0
Sep 20 21:50:58 raspberrypi weewx[21830] INFO weewx.imagegenerator: Generated 16 images for report Bjurdammen in 11.42 seconds
Sep 20 21:50:58 raspberrypi weewx[21830] INFO weewx.reportengine: Copied 0 files to /var/www/html/weewx/Bjurdammen
Sep 20 21:50:58 raspberrypi weewx[21830] DEBUG weewx.reportengine: Running report 'SeasonsReport'
Sep 20 21:50:58 raspberrypi weewx[21830] DEBUG weewx.reportengine: Found configuration file /etc/weewx/skins/Bjurdammen/skin.conf for report 'SeasonsReport'
Sep 20 21:50:58 raspberrypi weewx[21830] DEBUG weewx.cheetahgenerator: Using search list ['weewx.cheetahgenerator.Almanac', 'weewx.cheetahgenerator.Station', 'weewx.cheetahgenerator.Current', 'weewx.cheetahgenerator.Stats', 'weewx.cheetahgenerator.UnitInfo', 'weewx.cheetahgenerator.Extras', u'user.forecast.ForecastVariables', u'user.stats.MyStats', u'user.historygenerator.MyXSearch', u'user.lastrain.lastRainTags']
Sep 20 21:50:58 raspberrypi weewx[21830] DEBUG weewx.manager: Daily summary version is 2.0
Sep 20 21:50:58 raspberrypi weewxd: historygenerator.pyc: No bootstrap specific labels found
Sep 20 21:50:58 raspberrypi weewxd: historygenerator.pyc: Generated 19 tables in 0.73 seconds
Sep 20 21:51:01 raspberrypi weewx[21830] INFO weewx.cheetahgenerator: Generated 8 files for report SeasonsReport in 3.12 seconds
Sep 20 21:51:01 raspberrypi weewx[21830] DEBUG weewx.manager: Daily summary version is 2.0
Sep 20 21:51:02 raspberrypi systemd[1]: Started Session c78327 of user pliggen.
Sep 20 21:51:02 raspberrypi systemd[1]: Started Session c78328 of user pliggen.
Sep 20 21:51:12 raspberrypi weewx[21830] INFO weewx.imagegenerator: Generated 16 images for report SeasonsReport in 11.40 seconds
Sep 20 21:51:12 raspberrypi weewx[21830] INFO weewx.reportengine: Copied 0 files to /var/www/html/weewx
Sep 20 21:51:12 raspberrypi weewx[21830] DEBUG weewx.reportengine: Report 'SmartphoneReport' not enabled. Skipping.
Sep 20 21:51:12 raspberrypi weewx[21830] DEBUG weewx.reportengine: Report 'MobileReport' not enabled. Skipping.
Sep 20 21:51:12 raspberrypi weewx[21830] DEBUG weewx.reportengine: Running report 'BigImages'
Sep 20 21:51:12 raspberrypi weewx[21830] DEBUG weewx.reportengine: Found configuration file /etc/weewx/skins/Images/skin.conf for report 'BigImages'
Sep 20 21:51:12 raspberrypi weewxd: translategenerator.pyc: No language override specified.
Sep 20 21:51:12 raspberrypi weewx[21830] DEBUG weewx.manager: Daily summary version is 2.0
Sep 20 21:51:15 raspberrypi weewx[21830] INFO weewx.imagegenerator: Generated 6 images for report BigImages in 3.00 seconds
Sep 20 21:51:15 raspberrypi weewx[21830] DEBUG weewx.reportengine: Running report 'SmallImages'
Sep 20 21:51:15 raspberrypi weewx[21830] DEBUG weewx.reportengine: Found configuration file /etc/weewx/skins/Images/skin.conf for report 'SmallImages'
Sep 20 21:51:15 raspberrypi weewxd: translategenerator.pyc: No language override specified.
Sep 20 21:51:15 raspberrypi weewx[21830] DEBUG weewx.manager: Daily summary version is 2.0
Sep 20 21:51:16 raspberrypi weewx[21830] INFO weewx.imagegenerator: Generated 6 images for report SmallImages in 1.06 seconds
Sep 20 21:51:16 raspberrypi weewx[21830] DEBUG weewx.reportengine: Running report 'StackedWindRose'
Sep 20 21:51:16 raspberrypi weewx[21830] DEBUG weewx.reportengine: Found configuration file /etc/weewx/skins/StackedWindRose/skin.conf for report 'StackedWindRose'
Sep 20 21:51:16 raspberrypi weewx[21830] DEBUG weewx.manager: Daily summary version is 2.0
Sep 20 21:51:17 raspberrypi weewx[21830] INFO user.stackedwindrose: Generated 2 images for StackedWindRose in 0.59 seconds
Sep 20 21:51:17 raspberrypi weewx[21830] DEBUG weewx.reportengine: Running report 'lastrain'
Sep 20 21:51:17 raspberrypi weewx[21830] DEBUG weewx.reportengine: Found configuration file /etc/weewx/skins/lastrain/skin.conf for report 'lastrain'
Sep 20 21:51:17 raspberrypi weewx[21830] DEBUG weewx.cheetahgenerator: Using search list ['weewx.cheetahgenerator.Almanac', 'weewx.cheetahgenerator.Station', 'weewx.cheetahgenerator.Current', 'weewx.cheetahgenerator.Stats', 'weewx.cheetahgenerator.UnitInfo', 'weewx.cheetahgenerator.Extras', u'user.lastrain.lastRainTags']
Sep 20 21:51:17 raspberrypi weewx[21830] DEBUG weewx.manager: Daily summary version is 2.0
Sep 20 21:51:17 raspberrypi weewx[21830] INFO weewx.cheetahgenerator: Generated 1 files for report lastrain in 0.12 seconds
Sep 20 21:51:17 raspberrypi weewx[21830] DEBUG weewx.reportengine: Running report 'HighchartsAverages'
Sep 20 21:51:17 raspberrypi weewx[21830] DEBUG weewx.reportengine: Found configuration file /etc/weewx/skins/HighchartsAverages/skin.conf for report 'HighchartsAverages'
Sep 20 21:51:17 raspberrypi weewx[21830] DEBUG weewx.reportengine: Report 'HighchartsAverages' skipped due to report_timing setting
Sep 20 21:51:17 raspberrypi weewx[21830] DEBUG weewx.reportengine: Running report 'wxobs'
Sep 20 21:51:17 raspberrypi weewx[21830] DEBUG weewx.reportengine: Found configuration file /etc/weewx/skins/wxobs/skin.conf for report 'wxobs'
Sep 20 21:51:17 raspberrypi weewx[21830] DEBUG weewx.cheetahgenerator: Using search list ['weewx.cheetahgenerator.Almanac', 'weewx.cheetahgenerator.Station', 'weewx.cheetahgenerator.Current', 'weewx.cheetahgenerator.Stats', 'weewx.cheetahgenerator.UnitInfo', 'weewx.cheetahgenerator.Extras', u'user.wxobs.wxobs']
Sep 20 21:51:17 raspberrypi weewx[21830] DEBUG weewx.manager: Daily summary version is 2.0
Sep 20 21:51:17 raspberrypi weewx[21830] INFO weewx.cheetahgenerator: Generated 1 files for report wxobs in 0.21 seconds
Sep 20 21:51:17 raspberrypi weewx[21830] INFO weewx.reportengine: Copied 0 files to /var/www/html/weewx/wxobs
Sep 20 21:51:17 raspberrypi weewx[21830] DEBUG weewx.reportengine: Running report 'FTP'
Sep 20 21:51:17 raspberrypi weewx[21830] DEBUG weewx.reportengine: Found configuration file /etc/weewx/skins/Ftp/skin.conf for report 'FTP'
Sep 20 21:51:17 raspberrypi weewx[21830] DEBUG weewx.reportengine: ftpgenerator: FTP upload not requested. Skipped.
Sep 20 21:51:17 raspberrypi weewx[21830] DEBUG weewx.reportengine: Running report 'RSYNC'
Sep 20 21:51:17 raspberrypi weewx[21830] DEBUG weewx.reportengine: Found configuration file /etc/weewx/skins/Rsync/skin.conf for report 'RSYNC'
Sep 20 21:51:17 raspberrypi weewx[21830] DEBUG weewx.reportengine: rsyncgenerator: Rsync upload not requested. Skipped.

gjr80

unread,
Sep 20, 2020, 7:51:49 PM9/20/20
to weewx-user
Thank you. It looks like the code to connect to your SMTP server and send the message is failing, since this code is run in a separate thread any exceptions are not seen by WeeWX so the SMTP thread appears to fail silently. Makes troubleshooting difficult :)

I have quickly reworked the alarm_multi.py that I posted earlier. The attached version will work with WeeWX 3.x and 4.x (only real change for 4.x is logging) and also supports both python2/3 under WeeWX 4.x. I have also added some code to catch any exceptions raised in the SMTP thread and log them. So we should now see why the code is failing. Could you replace your alarm_multi.py with the attached version then restart WeeWX and force some alarm conditions. The log should give you details of the error, if you can't solve the problem post the log here.

Gary
alarm_multi.py

pligg...@gmail.com

unread,
Sep 21, 2020, 4:47:23 AM9/21/20
to weewx-user
Thanks Gary!



I first tried your new file, but got an error at line 223 --> "s = smtplib.SMTP(self.smtp_host)". I looked at my old alarm.py file and saw that it had _SSL after SMTP
"s = smtplib.SMTP_SSL(self.smtp_host)" So I put that in the new code and then it sent my mail!


Here's the log when the error occurred:

Sep 21 09:31:20 raspberrypi weewx[14582] ERROR user.alarm_multi: Unexpected exception of type <class 'socket.error'>
Sep 21 09:31:20 raspberrypi weewx[14582] ERROR user.alarm_multi: rtgd: **** Traceback (most recent call last):
Sep 21 09:31:20 raspberrypi weewx[14582] ERROR user.alarm_multi: rtgd: ****   File "/usr/share/weewx/user/alarm_multi.py", line 223, in soundTheAlarm
Sep 21 09:31:20 raspberrypi weewx[14582] ERROR user.alarm_multi: rtgd: ****     s = smtplib.SMTP(self.smtp_host)
Sep 21 09:31:20 raspberrypi weewx[14582] ERROR user.alarm_multi: rtgd: ****   File "/usr/lib/python2.7/smtplib.py", line 256, in __init__
Sep 21 09:31:20 raspberrypi weewx[14582] ERROR user.alarm_multi: rtgd: ****     (code, msg) = self.connect(host, port)
Sep 21 09:31:20 raspberrypi weewx[14582] ERROR user.alarm_multi: rtgd: ****   File "/usr/lib/python2.7/smtplib.py", line 316, in connect
Sep 21 09:31:20 raspberrypi weewx[14582] ERROR user.alarm_multi: rtgd: ****     self.sock = self._get_socket(host, port, self.timeout)
Sep 21 09:31:20 raspberrypi weewx[14582] ERROR user.alarm_multi: rtgd: ****   File "/usr/lib/python2.7/smtplib.py", line 291, in _get_socket
Sep 21 09:31:20 raspberrypi weewx[14582] ERROR user.alarm_multi: rtgd: ****     return socket.create_connection((host, port), timeout)
Sep 21 09:31:20 raspberrypi weewx[14582] ERROR user.alarm_multi: rtgd: ****   File "/usr/lib/python2.7/socket.py", line 575, in create_connection
Sep 21 09:31:20 raspberrypi weewx[14582] ERROR user.alarm_multi: rtgd: ****     raise err
Sep 21 09:31:20 raspberrypi weewx[14582] ERROR user.alarm_multi: rtgd: **** error: [Errno 101] Nätverket kan inte nås
Sep 21 09:31:20 raspberrypi weewx[14582] ERROR user.alarm_multi: Thread exiting. Reason: [Errno 101] Nätverket kan inte nås

Thanks Gary for the work with the updated file!

/Mikael

gjr80

unread,
Sep 21, 2020, 9:44:35 AM9/21/20
to weewx-user
Good that it is working. I think alarm.py and alarm_multi.py diverged quite some time ago and some of the common code should be brought back in sync. I will have a look through in the coming days and post an updated alarm-multi.py to hopefully prevent similar situations developing in the future (well at least until WeeWX 5.0 is released :) ).

Gary

Mikael Fredriksson

unread,
Sep 21, 2020, 3:45:16 PM9/21/20
to weewx...@googlegroups.com
Thanks Gary!



I first tried your new file, but got an error at line 223 --> "s = smtplib.SMTP(self.smtp_host)". I looked at my old alarm.py file and saw that it had _SSL after SMTP
"s = smtplib.SMTP_SSL(self.smtp_host)" So I put that in the new code and then it sent my mail!


Here's the log when the error occurred:

Sep 21 09:31:20 raspberrypi weewx[14582] ERROR user.alarm_multi: Unexpected exception of type <class 'socket.error'>
Sep 21 09:31:20 raspberrypi weewx[14582] ERROR user.alarm_multi: rtgd: **** Traceback (most recent call last):
Sep 21 09:31:20 raspberrypi weewx[14582] ERROR user.alarm_multi: rtgd: ****   File "/usr/share/weewx/user/alarm_multi.py", line 223, in soundTheAlarm
Sep 21 09:31:20 raspberrypi weewx[14582] ERROR user.alarm_multi: rtgd: ****     s = smtplib.SMTP(self.smtp_host)
Sep 21 09:31:20 raspberrypi weewx[14582] ERROR user.alarm_multi: rtgd: ****   File "/usr/lib/python2.7/smtplib.py", line 256, in __init__
Sep 21 09:31:20 raspberrypi weewx[14582] ERROR user.alarm_multi: rtgd: ****     (code, msg) = self.connect(host, port)
Sep 21 09:31:20 raspberrypi weewx[14582] ERROR user.alarm_multi: rtgd: ****   File "/usr/lib/python2.7/smtplib.py", line 316, in connect
Sep 21 09:31:20 raspberrypi weewx[14582] ERROR user.alarm_multi: rtgd: ****     self.sock = self._get_socket(host, port, self.timeout)
Sep 21 09:31:20 raspberrypi weewx[14582] ERROR user.alarm_multi: rtgd: ****   File "/usr/lib/python2.7/smtplib.py", line 291, in _get_socket
Sep 21 09:31:20 raspberrypi weewx[14582] ERROR user.alarm_multi: rtgd: ****     return socket.create_connection((host, port), timeout)
Sep 21 09:31:20 raspberrypi weewx[14582] ERROR user.alarm_multi: rtgd: ****   File "/usr/lib/python2.7/socket.py", line 575, in create_connection
Sep 21 09:31:20 raspberrypi weewx[14582] ERROR user.alarm_multi: rtgd: ****     raise err
Sep 21 09:31:20 raspberrypi weewx[14582] ERROR user.alarm_multi: rtgd: **** error: [Errno 101] Nätverket kan inte nås
Sep 21 09:31:20 raspberrypi weewx[14582] ERROR user.alarm_multi: Thread exiting. Reason: [Errno 101] Nätverket kan inte nås

Thanks Gary for the work with the updated file!

/Mikael

Virusfritt. www.avg.com

--
You received this message because you are subscribed to a topic in the Google Groups "weewx-user" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/weewx-user/-IGQC3CpXAE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to weewx-user+...@googlegroups.com.

Virusfritt. www.avg.com

Mikael Fredriksson

unread,
Sep 21, 2020, 3:45:19 PM9/21/20
to weewx...@googlegroups.com
Great!

One more question. When I used alarm.py I somehow managed to get only the "faulty" record to show in the email, not every other reading. Don't remember how I did this. Could you tell me what to change in the code?

Alarm expression "extraTemp1 > 52 " evaluated True at 2020-09-21 14:40:00 CEST (1600692000)
Record:
{'outTempBatteryStatus': 0.0, 'outHumidity': 71.0, 'extraHumid1': 99.9, 'maxSolarRad': 428.4915916113489, 'extraTemp2': 68.0, 'interval': 10, 'ET': None, 'ptr': 25408.0, 'rainRate': 0.0, 'heatindex': 60.16181818181818, 'radiation': None, 'delay': 23.818181818181817, 'inTemp': 52.98000000000001, 'inDewpoint': 43.832655655290985, 'status': 0.0, 'barometer': 29.95817287439312, 'windchill': 60.16181818181818, 'dewpoint': 50.72247794136099, 'windrun': 1.511630402977166, 'rain': 0.0, 'humidex': 62.800666120830144, 'pressure': 29.050527884772734, 'rxCheckPercent': 100.0, 'rainTotal': 8.159999999999998, 'altimeter': 29.965138110733474, 'extraTemp3': 64.2866, 'usUnits': 1, 'extraTemp1': 52.025, 'appTemp': 55.33343408771088, 'UV': None, 'dateTime': 1600692000, 'windDir': 221.75921118258643, 'outTemp': 60.16181818181818, 'windSpeed': 9.069782417862998, 'inHumidity': 71.0, 'windGust': 19.68508829706588, 'windGustDir': 180.0, 'cloudbase': 2998.325092976762
So I just want to see the value that trigger the alarm.

//Mikael

--
You received this message because you are subscribed to a topic in the Google Groups "weewx-user" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/weewx-user/-IGQC3CpXAE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to weewx-user+...@googlegroups.com.

gjr80

unread,
Sep 22, 2020, 10:20:58 PM9/22/20
to weewx-user
Mikael,

I believe the old version of alarm.py that had hard coded alarm expressions did print just the offending field but the current version of alarm.py and alarm_multi.py only print the entire record and cannot print just the offending fields. To print just the field would require parsing of the alarm expression to identify the fields involved and then just pass those fields to the mail routine rather than the whole record. Doable but will require a little more code. I will see what I can incorporate in the revised version.

Gary

pligg...@gmail.com

unread,
Sep 23, 2020, 4:37:32 AM9/23/20
to weewx-user
Ok thanks Gary for clarifying that! Not a big issue but we'll see what you can do about it. 

//Mikael

gjr80

unread,
Oct 2, 2020, 1:01:41 AM10/2/20
to weewx-user
Mikael,

I have made some changes to alarm_multi so that it can now lists only the fields in the triggered expression rather than the entire archive record (its a fairly basic check and will probably trip on fields whose name is a subset of another field, eg a field named 'temp' would match 'outTemp', 'inTemp', 'extraTemp1' etc as well as 'temp'). While I was at it I gave the entire file a bit of a refresh and saved it to my WeeWX utilities repo.
To download the reworked alarm_multi.py and set it to list only fields in the triggered expression:

1. move your existing alarm_multi.py aside
$ sudo mv /usr/share/weewx/user/alarm_multi.py /usr/share/weewx/user/alarm_multi_orig.py

2. download the reworked version of alarm_multi.py:

3. edit weewx.conf and under the [Alarm] stanza add the config item include_full_record = False:

[Alarm]
    ....
    include_full_record = False

4. save weewx.conf and restart WeeWX

You can go back to displaying the full record by setting include_full_record to True or deleting the entry in its entirety.

Gary

pligg...@gmail.com

unread,
Oct 2, 2020, 10:11:48 AM10/2/20
to weewx-user
Gary, 

thank you for that! Tried it now and it works great! 
Looks much better now, and I only had my extraTemp1 to show up in the email. 
I'll let you know if there's something strange happening when I've been running this for some time.

Really appreciate the help that one can get here on this forum.


/Mikael

Ian Prescott

unread,
Oct 5, 2020, 6:44:25 AM10/5/20
to weewx-user
Hi Gary
I have been following this conversation because I have been using previous versions of alarm.py and then alarm_multi.py.
Thanks for your efforts at enhancing a great program.
So I have just finished doing this recent change and I have noticed several new lines in syslog since making the changes.
These occur every 5 minutes.

Oct  5 20:20:19 weatherpi weewx[568] DEBUG user.alarm_multi: name 'none' is not defined
Oct  5 20:20:19 weatherpi weewx[568] DEBUG user.alarm_multi: name 'none' is not defined
Oct  5 20:20:19 weatherpi weewx[568] DEBUG user.alarm_multi: name 'none' is not defined

This is my current alarm stanza
[Alarm]
    time_wait = 3600
    smtp_host =
    smtp_user =
    mailto =
    from =
    include_full_record = False
    count = 3
    expression.0 = "outTemp is not none and outTemp > 95.0"
    subject.0 = "Alarm message from weewx - High outside temperature! > 35deg"
    expression.1 = "inTemp is not none and inTemp > 104.0"
    subject.1 = "Alarm message from weewx - High inside temperature! > 40 deg"
    expression.2 = "rain is not none and rain > 00.0"
    subject.2 = "Alarm message from weewx - is it really raining????"

This piece (rain is not none) was added a while ago, it solved an issue around (some) rain values that were null (I think) and was causing grief.
I just added "is not none" to the temp alarms to be consistent.
Are these lines a concern? or can "is not none" be removed?

Thank Ian P



You received this message because you are subscribed to the Google Groups "weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-user+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/0c8800ae-e7bc-44db-b14d-30dcaf221045n%40googlegroups.com.

Graham Eddy

unread,
Oct 5, 2020, 7:04:00 AM10/5/20
to weewx...@googlegroups.com
should be ‘None’ not ‘none'

Remy Lavabre

unread,
Jan 23, 2021, 11:21:49 AM1/23/21
to weewx-user
Hi,
Do you know if there is a possibility to modify the py file in order to have an alarm delay specific to each alarm (for example 3600 seconds for alarm1, 7200 seconds for alarm2 etc)? THANK YOU
Reply all
Reply to author
Forward
0 new messages