configuring email actor in the alarm module

Begonnen von alex, 24 November 2014, 14:48:52

Vorheriges Thema - Nächstes Thema

alex

Searching in the wiki and forum didn't lead me to the righ answer so let's try it this way.
I look for a way to send the alarm details within the email message. Currently all I get is an email message with a fixed subject and no content.

What did I do:
I have create a dummy device mail.alarm with the attribute AlarmDevice set to Actor.
Then I configured this actor within the alarm wizard with {fb_mail('alex@vanhoboken.nl','Alarm',Value('AAA'))}

I also tried some variants like "EVENT$", or "%" but no succesfull results.

How can I send details within the email meesage like what sensor triggered the alarm, when did it exactly happen and what are the messages I en II.
Any help is highly appreciated.

Thanks,
Alex

Grisu

Hi alex

Please send the content of your fb_mail method
Regards
Grisu
2x RPI B+ 1x FritzBox7390 1x USV
1x HM-Lan 1x cul433 1x cul868
9x HM Türkontakt 1x Heizzyklen Überw. 1x Ultraschall Öl Pegel 1x Regens. 15x IT Z.stecker 2x HM Dimmer 6x FS20 Dimmer 1x Stromzähler 1x FS20 to Infrarot 3x HM Rauchmelder 3x Temp 10x Sender
Alarmanlage Aquariumst. Terrariumst.

alex

I use the standard 99_email module for this:

sub fb_mail {
  my $rcpt = $_[0];
  my $subject = $_[1];
  my $text = $_[2];
  Log3 undef,3,$subject;
  system("/bin/echo \"$text\" | /usr/bin/mail -s \"$subject\" \"$rcpt\"");
}

Regards,
Alex

fiedel

Hi Alex,

this example should show you, how it works:

# Battery warning
define Func_Bat_Lo_N notify .*:[Bb]attery.* {\
if("%" !~ m/ok/) {\
   fb_mail('user@@provider.de','FHEM Batteriewarnung','@ %');;\
   Log 3, "@: Batteriewarnung %";;\
  }\
}


But " $EVENT " instead of " @ "should work as well or even better.  ;)

Best regards

Frank
FeatureLevel: 6.1 auf Wyse N03D ; Deb. 11 ; Perl: v5.14.2 ; IO: HM-MOD-RPI-PCB + VCCU|CUL 868 V 1.66|LinkUSBi |TEK603
HM: SEC-SCO|SCI-3-FM|LC-SW4-PCB|ES-PMSW1-PL|RC-4-2|SEN-MDIR-O|SEC-WDS-2
CUL: HMS100TF|FS20 S4A-2 ; OWDevice: DS18S20|DS2401|DS2406|DS2423