Email Benachrichtigung

Begonnen von Guest, 06 September 2012, 22:26:15

Vorheriges Thema - Nächstes Thema

Puschel74

                                               

Hallo,

grad versucht ;-)

Mit nur einem $Eventname klappts im Firefox.
Dann kommt
Reminder: none
an.
Danke für die Hilfe.
Wozu das zweimal im ersten Beitrag steht würd mich auch interessieren :-)

Grüße

Am Mittwoch, 19. September 2012 20:03:49 UTC+2 schrieb Borsti67:
>
> dann probier's doch mal ohne die Wiederholung. =8)
>
> Am 19. September 2012 19:55 schrieb puschel74 >:
>
> > Hallo,
> >
> > keine Ahnung - weils so im ersten Posting steht ;-)
> >
> > Grüße
> >
> > Am Mittwoch, 19. September 2012 19:54:53 UTC+2 schrieb Borsti67:
> >>
> >> hier fällt mir eines auf:
> >>
> >> >     fb_mail('meine.mail@domain.dazu',"Nix los");
> >>
> >> = 2 Parameter
> >>
> >> >     fb_mail('xxx@yyy.zz',$Eventname,$Eventname);
> >>
> >> = 3 Parameter, davon der letzte 2x - warum???
> >
> > --
> > To unsubscribe from this group, send email to
> > fhem-users+...@googlegroups.com
>

--
To unsubscribe from this group, send email to
fhem-users+unsubscribe@googlegroups.com
Zotac BI323 als Server mit DBLog
CUNO für FHT80B, 3 HM-Lan per vCCU, RasPi mit CUL433 für Somfy-Rollo (F2F), RasPi mit I2C(LM75) (F2F), RasPi für Panstamp+Vegetronix +SONOS(F2F)
Ich beantworte keine Supportanfragen per PM! Bitte im Forum suchen oder einen Beitrag erstellen.

Markus

Bei mir Funktioniert es nicht!

Ich weis nicht wo dieser pfad hinzeigen soll und welche Datei ich dort hinterlegen muß?

Gruß Markus
Raspberry Pi2 als FHEM-Plattform
HM, FS20, 1-Wire, PanStamp,LW12,Intertechno,ESPEasy,Alexa

Puschel74

Hallo

im Ordner FHEM must du eine Textdatei namens event.holiday erstellen und passend füllen.
Sollte eigentlich im Wiki erklärt sein.
Oder welche Datei weisst du nicht wo ablegen?

Grüsse
Zotac BI323 als Server mit DBLog
CUNO für FHT80B, 3 HM-Lan per vCCU, RasPi mit CUL433 für Somfy-Rollo (F2F), RasPi mit I2C(LM75) (F2F), RasPi für Panstamp+Vegetronix +SONOS(F2F)
Ich beantworte keine Supportanfragen per PM! Bitte im Forum suchen oder einen Beitrag erstellen.

Markus

Ich hab den wiki eintrag nicht gefunden hab alles von diesem post kopiert??..
Die holiday datei liegt unter: /fhem/FHEM

Das ist mein Log

2012.12.29 11:02:00 3: get events 12-29 : Geburtstag Thomas
Geburtstag ThomasUse of uninitialized value $text in concatenation (.) or string at ./FHEM/99_MailUtils.pm line 15.
sh: syntax error: unexpected newline
sh: /var/media/ftp/fhem/mailER/mailer: not found
sh: /var/media/ftp/fhem/mailER/TXT/fhem_nachricht.txt: not found
sh: bestellung@topproduct.at: not found
rm: can't remove '/var/media/ftp/fhem/mailER/TXT/fhem_nachricht.txt': No such file or directory
2012.12.29 11:02:00 3: -1
Raspberry Pi2 als FHEM-Plattform
HM, FS20, 1-Wire, PanStamp,LW12,Intertechno,ESPEasy,Alexa

Markus

hab den wiki eintrag doch gefunden :-)
aber ich meine diese zeilen im log

sh: /var/media/ftp/fhem/mailER/mailer: not found
sh: /var/media/ftp/fhem/mailER/TXT/fhem_nachricht.txt: not found
Raspberry Pi2 als FHEM-Plattform
HM, FS20, 1-Wire, PanStamp,LW12,Intertechno,ESPEasy,Alexa

Puschel74

Hallo

welche Plattform benutzt du?
Auf meiner 7390 klappt der Mailversand einwandfrei.

Grüsse
Zotac BI323 als Server mit DBLog
CUNO für FHT80B, 3 HM-Lan per vCCU, RasPi mit CUL433 für Somfy-Rollo (F2F), RasPi mit I2C(LM75) (F2F), RasPi für Panstamp+Vegetronix +SONOS(F2F)
Ich beantworte keine Supportanfragen per PM! Bitte im Forum suchen oder einen Beitrag erstellen.

Markus

ich hab auch die 7390

Gruß Markus
Raspberry Pi2 als FHEM-Plattform
HM, FS20, 1-Wire, PanStamp,LW12,Intertechno,ESPEasy,Alexa

Markus

meine cfg:

attr events room 6_EVENTS # optional
attr events group Events #optional
define CheckEventHeute at *18:35:00 {\
  my $Eventname;;\
  my $EventHeute;;\
  $EventHeute = fhem("get events today");;\
  print $EventHeute;;\
  if ($EventHeute ne "none") {\
    $Eventname = "Reminder: $EventHeute" ;;\
    FBMail('meine@mailadresset',$Eventname,$Eventname);;\
  }\
}
attr CheckEventHeute room 5_SYSTEM #optional



meine 99_emailUtils.pm

##############################################
# $Id: 99_myUtils.pm $
package main;
use strict;
use warnings;

sub
email_Initialize($$)
{
my ($hash) = @_;
}

sub fb_mail {
my $rcpt = $_[0];
my $subject = $_[1];
my $text = $_[2];
system("echo \"$text\" > fhem_nachricht.txt");
system("mailer send -i 'fhem_nachricht.txt' -s \"$subject\" -t
\"$rcpt\"");
system("rm fhem_nachricht.txt");
}

1;





Fehlermeldung beim speichern:

ERROR:
Undefined subroutine &main::emailUtils_Initialize called at fhem.pl line 1518.





meine Logdatei:

2012.12.29 18:35:00 3: get events today : Geburtstag Thomas
2012.12.29 18:35:00 3: Undefined subroutine &main::FBMail called at (eval 366) line 1.

Geburtstag Thomas2012.12.29 18:35:14 2: dummy set Markus_Handy Anwesend


Raspberry Pi2 als FHEM-Plattform
HM, FS20, 1-Wire, PanStamp,LW12,Intertechno,ESPEasy,Alexa

Markus

99_emailUtils.pm

##############################################
# $Id: 99_myUtils.pm $
package main;

use strict;
use warnings;
use POSIX;

sub
emailUtils_Initialize($$)
{
  my ($hash) = @_;
}

sub fb_mail {
  my $rcpt = $_[0];
  my $subject = $_[1];
  my $text = $_[2];
  system("/bin/echo \"$text\" > /var/tmp/fhem_nachricht.txt");
  system("/sbin/mailer send -i '/var/tmp/fhem_nachricht.txt' -s \"$subject\" -t \"$rcpt\"");
  system("rm /var/tmp/fhem_nachricht.txt");
}

1;



im log steht jetzt

Use of uninitialized value in string lt at fhem.pl line 1803, <$fh> line 334.
2012.12.29 20:38:00 3: get events today : Geburtstag Thomas
2012.12.29 20:38:00 3: Undefined subroutine &main::FBMail called at (eval 1052) line 1.

Geburtstag Thomas2012.12.29 20:38:16 2: dummy set Markus_Handy Anwesend



und keine email :-(
Raspberry Pi2 als FHEM-Plattform
HM, FS20, 1-Wire, PanStamp,LW12,Intertechno,ESPEasy,Alexa

Puschel74

Hallo,

also nochmal ganz langsam ;-)

Hier die Definition in der fhem.cfg

define events holiday

Danach die Datei events.holiday angelegt und entsprechend gefüllt:

1 11-21 GelberSack_morgen
1 12-19 GelberSack_morgen
1 12-21 Hausmuell_vorverlegt_morgen

Danach die Abfrage in der fhem.cfg (bei mir):

define CheckEventHeute at *02:40:00 {\
  my $Eventname;;\
  my $EventHeute;;\
  $EventHeute = fhem("get events ".strftime("%m-%d",localtime()));;\
  print $EventHeute;;\
  if ($EventHeute ne "none") {\
    $Eventname = "Reminder: $EventHeute" ;;\
    fb_mail('xxxxxx.yyyyyyyy@aaaaaaa.bb',$Eventname);;\
  }\
}
attr CheckEventHeute room 98_Notify

Und nun noch die fb_mail aus der 99_MyUtils.pm:

sub
MyUtils_Initialize($$)
{
  my ($hash) = @_;
}

sub fb_mail {
  my $rcpt = $_[0];
  my $subject = $_[1];
  my $text = $_[2];
  system("echo \"$text\" > fhem_nachricht.txt");
  system("mailer send -i 'fhem_nachricht.txt' -s \"$subject\" -t \"$rcpt\"");
  system("rm fhem_nachricht.txt");
}

Damit bekomme ich immer dann eine Mail wenn die Abfrage in der events.holiday einen
Wert <> none zurückliefert.
Sprich am 21.22 kam die Mail mit GelberSack_morgen (logisch).
Evtl. hilft dir das ein bischen weiter.

Grüße
Zotac BI323 als Server mit DBLog
CUNO für FHT80B, 3 HM-Lan per vCCU, RasPi mit CUL433 für Somfy-Rollo (F2F), RasPi mit I2C(LM75) (F2F), RasPi für Panstamp+Vegetronix +SONOS(F2F)
Ich beantworte keine Supportanfragen per PM! Bitte im Forum suchen oder einen Beitrag erstellen.

Puschel74

Tante Edith immer noch out-of-order.

Hast du in deiner FB auch den Mailversand aktiviert?
Ich meine das das notwendig ist um die FB dazu zu überreden
auch Mails zu versenden.

Grüße
Zotac BI323 als Server mit DBLog
CUNO für FHT80B, 3 HM-Lan per vCCU, RasPi mit CUL433 für Somfy-Rollo (F2F), RasPi mit I2C(LM75) (F2F), RasPi für Panstamp+Vegetronix +SONOS(F2F)
Ich beantworte keine Supportanfragen per PM! Bitte im Forum suchen oder einen Beitrag erstellen.

Markus

Danke!
Jetzt Funktioniert es! :-D
Ich habe jetzt folgenden logeintrag aber die Email habe ich bekommen!

Gruß Markus

Use of uninitialized value in string lt at fhem.pl line 1803, <$fh> line 336.
2012.12.30 12:39:00 3: get events 12-30 : test
testUse of uninitialized value $text in concatenation (.) or string at ./FHEM/99_emailUtils.pm line 20.
2012.12.30 12:39:00 3: -1
Raspberry Pi2 als FHEM-Plattform
HM, FS20, 1-Wire, PanStamp,LW12,Intertechno,ESPEasy,Alexa