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
Hi alex
Please send the content of your fb_mail method
Regards
Grisu
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
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