Hauptmenü

Creating an email macro

Begonnen von homer, 10 Mai 2013, 16:05:10

Vorheriges Thema - Nächstes Thema

homer

Hi All,

I've successfully set up email nofificatins (using prowl on iOS), using the following setup:

define myMsg MSG
define myMail MSGMail home@address.com (home@address.com) xxxxxxxxxxx@api.prowlapp.com (xxxxxxxxxxx@api.prowlapp.com) smtp.gmail.com /opt/fhem/msgmailauth
attr myMail smtpport 465
attr myMail subject FHEM has restarted
set myMsg send myMail
set myMail clear

From the above setup, I can send subsequent emails using:

attr myMail subject Message2
set myMsg send myMail
set myMail clear

What I would like is to be able to put these 3 lines into 1 macro. I looked at the reference examples and did this:

define SendEmail notify SendEmailMsg {fhem "attr myMail subject FHEM macro test";; fhem "set myMsg send myMail";; fhem "set myMail clear"}

I used trigger SendEmail to try it, but it didn't work. Trying:

{fhem "attr myMail subject FHEM macro test";; fhem "set myMsg send myMail";; fhem "set myMail clear"}

In the FHEM command box worked ok. So, I tried a simple macro in fhem.cfg:

define MyMacro notify _MyMacro { Log 1, "Hello"}
trigger MyMacro

and this doesn't work. Writing

trigger MyMacro

in the FHEM command box also fails (nothing output in the log).

I seems like notify's won't trigger this way for me. Is there something I am doing wrong?

Thanks
Homer