-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Sending of e-mails now works in case an alarm hasn't been acknowledge…
…d after a given amount of time; a test file testAlarms.txt is included
- Loading branch information
Showing
5 changed files
with
126 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/usr/bin/python | ||
# -*- coding: utf-8 -*- | ||
|
||
import smtplib | ||
from email.mime.multipart import MIMEMultipart | ||
from email.mime.text import MIMEText | ||
|
||
def sendEmail (address, alarmDate, alarmLocation, alarmMessage, alarmSource): | ||
|
||
msg = MIMEMultipart() | ||
msg['Subject'] = alarmMessage | ||
msg['From'] = address | ||
msg['To'] = address | ||
content = alarmMessage + '\n' + \ | ||
'Date: ' + str(alarmDate) + '\n' + \ | ||
'Location: ' + alarmLocation + '\n' + \ | ||
'Source: ' + alarmSource | ||
msg.attach(MIMEText(content, 'plain')) | ||
|
||
s = smtplib.SMTP('mail.fhi-berlin.mpg.de') | ||
s.sendmail(address, address, msg.as_string()) | ||
s.quit() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
"25.7.2017 13:14:21","/Fritz-Haber-Institut/Bauteil R/Meldungen/Geb.R Meldungen","Geb.R Wasser-Sensor Lichtschacht Technikzentrale Keller ausgelst! | ||
Quelle :DI_Wasser_Sensor_Lichtschacht_TZ | ||
Besttigt :Nicht besttigt | ||
Ausfhren :Besttigen | ||
Kategorie :Heizung, Lftung, Klimatechnik - Allgemein | ||
Aktueller Status :Unnormal" x x | ||
"25.7.2017 12:24:37","/Fritz-Haber-Institut/Bauteil G/Kaltwasser/Umluftkhlwasser/Geb.G Umluftkhlwasser"xx,"Geb.G Umluftkhlwasser Sekundr Pumpe Ansteuerung Strung gehend. | ||
Quelle :Geb.G KKUK Sekundr Pumpe Ansteuerung Strung | ||
Besttigt :Nicht besttigt | ||
Ausfhren :Besttigen | ||
Kategorie :Heizung, Lftung, Klimatechnik - Allgemein | ||
Aktueller Status :Normal"x x x | ||
"25.7.2017 12:24:25","/Fritz-Haber-Institut/Bauteil G/Kaltwasser/Umluftkhlwasser/Geb.G Umluftkhlwasser"xx,"Geb.G Umluftkhlwasser Sekundr Pumpe Ansteuerung Strung! | ||
Quelle :Geb.G KKUK Sekundr Pumpe Ansteuerung Strung | ||
Besttigt :Nicht besttigt | ||
Ausfhren :Besttigen | ||
Kategorie :Heizung, Lftung, Klimatechnik - Allgemein | ||
Aktueller Status :Unnormal"x x x |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters