Problem with alarm.py in Weewx 4.0

55 views
Skip to first unread message

Remy Lavabre

unread,
May 22, 2020, 12:23:19 PM5/22/20
to weewx-user

Hello,
I have a problem using Alarm.py:

I entered the configuration in the weewx.conf file with the correct parameters:


[Alarm]
expression = "outTemp < 40.0"
time_wait = 3600
smtp_host = smtp.example.com
smtp_user = myusername
smtp_password = mypassword
from = sa...@example.com
mailto = ja...@example.com, b...@example.com
subject = "Alarm message from weewx!"

and :

[Engine]
[[Services]]
...
report_services = weewx.engine.StdPrint, weewx.engine.StdReport, user.alarm.MyAlarm
After it is indicate to copy this file (Alarm.py I think...) to the "user directory"

But what is the "user directory" ?

I've tried usr/share/weewx/usr but it doesn't work and blocks me weewx If you know how to proceed and where exactly to copy Alarm.py ?? thank you so much

Graham Eddy

unread,
May 22, 2020, 9:21:59 PM5/22/20
to weewx...@googlegroups.com
bin/user under your weewx root.
if your weewx root is /usr/share/weewx, then /usr/share/weewx/bin/user

--
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/b42b7a8e-ac8e-406a-a68e-35bff495c96b%40googlegroups.com.

Tom Keffer

unread,
May 22, 2020, 9:36:53 PM5/22/20
to weewx-user
Not quite. It's /usr/share/weewx/user

You will probably need 'sudo' to do the copy.

-tk



Remy Lavabre

unread,
May 23, 2020, 12:27:17 AM5/23/20
to weewx-user
Thanks you for jour answers but ;

1/ directory usr/share/weewx/bin/user does not existe ;
2/ Alarm.py is already in usr/share/weewx/user but it does not work...

I have a "standard" weewx installation under raspbian raspberry.

And when i put user.alarm.MyAlarm in [Engine] [[Services]]... As described, weewx connexion with my base does not work. If i remove user.alarm.MyAlarm weewx si normaly functionning...
And no mail is Nevers send as alarm !

So, i am not sure of the "user directory" because the configuration [Alarm] is simply to put and the problem is comming when adding user.alarm.MyAlarm

Si, where to put the Alarm.py or why it does not functionning ??? And blocking weawx normal work ??

Thanks you...

Remy Lavabre

unread,
May 23, 2020, 2:39:18 AM5/23/20
to weewx-user
Hello,

In fact I found a solution:

alarm.py has been placed in the folder /usr/share/weewx/weewx (with engine.py, cheetagenerator.py and other..) ;

and I changed the line in the weewx.conf : 

report_services = weewx.engine.StdPrint, weewx.engine.StdReport, weewx.alarm.MyAlarm

Now it works well!

By cons I still have a question ...(!!!) : is it possible (and how!) To make an alarm with several conditions (example: outdoor temperature> 40 AND outdoor humidity> 90)?

Thank you very much for your contribution


Reply all
Reply to author
Forward
0 new messages