Callmonitor für Anfänger

Begonnen von coolice, 25 Januar 2014, 13:07:36

Vorheriges Thema - Nächstes Thema

coolice

Hallo @all. Wie ihr euch sicher denken könnt bin ich relativ neu was fhem angeht. Muss sagen ich habe es zum laufen bekommen und auch das eine oder andere aus der Wiki umgesetzt bekommen. Immer streng nach Anleitung halt.

Ich habe den Call_Monitor installiert und möchte jetzt eine Liste (vielleicht eine readingsGroup?) wo ich sehen kann wer angerufen hat (Anruf in Abwesenheit) und ob jemand auf den AB gesprochen hat. Ich habe mehrmals gelesen das das einige von euch bereits umgesetzt haben.
Da mir die Erfahrung fehlt und ich es durch Versuch macht klug nicht hinbekommen habe, wäre es super wenn mir jemand unter die Arme greifen könnte.

mfg
Mirco

coolice

Um mich etwas genauer aus zu drücken... ich habe unter FB_CALLMONITOT - Readings z.B. missed_call was auch richtig gefüttert wird. Wie kann ich dieses Ereignis in einem Feld im Raum Telefon mit der Bezeichnung "Verpasst" anzeigen?

Grüße
Mirco

fiedel

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

coolice

Guten Morgen Fiedel, das hatte ich über die Suche auch schon gefunden. Habe versucht es für meine Umgebung anzupassen. Leider bin ich wohl noch nicht soweit zu verstehen was davon gebraucht wird und was nicht. Ich habe gehofft das man die Ergebnisse in eine z.B. Dummy über einen "für Anfänger" tauglichen Weg darstellen kann.

Grüße
Mirco

fiedel

#4
Da wagst du dich als Anfänger ja schon mal an ganz kapitale Hirsche...  ;)
Schreib doch mal was du alles schon wie eingerichtet hast und was du nun nicht verstehst. Ich habe z.B. den Code von diesem Post / Thread einfach bei mir reinkopiert, etwas angepasst und es lief so gut wie auf Anhieb.

Gruß

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

coolice

#5
Gerne. fhem.cfg define Fritz_Box FB_CALLMONITOR 192.168.143.1
attr Fritz_Box local-area-code 05237
attr Fritz_Box reverse-search all
attr Fritz_Box reverse-search-cache 1
attr Fritz_Box reverse-search-cache-file ./log/Fritz_Box-%Y.log Fritz_Box
attr Fritz_Box reverse-search-phonebook-file ./log/Fritz_Box_Telefonbuch.xml
attr Fritz_Box room Telefon
# attr Fritz_Box icon icoWelt
define FileLog_Fritz_Box FileLog ./log/Fritz_Box-%Y.log Fritz_Box
attr FileLog_Fritz_Box logtype text
# attr FileLog_Fritz_Box room Telefon

und heraus kommt das aus dem Anhang.

holzwurm83

#6
Zitat von: fiedel am 26 Januar 2014, 20:34:23
Suchdienst fiedel meldet sich zur Stelle...  ;)

Ich habe das ganze auch gleich mal getestet! Ich bekommen allerdings eine Fehlermeldung. Hier die Meldung aus dem Log:
2014.01.27 19:58:53 3: Call_Notify return value: Undefined subroutine &main::EventZeit called at /Users/mediaserver/fhem/FHEM/99_myUtilsTelefon.pm line 154.

2014.01.27 19:59:29 3: Call_Notify return value: Undefined subroutine &main::sig2_break called at /Users/mediaserver/fhem/FHEM/99_myUtilsTelefon.pm line 120.
- Fhem auf einem MacMini Server
- CUL; HMLAN; CUNO2 für FS20; HM-Wired RS485 LAN Gateway
- HMW_Sen_SC_12_FM; HMW_LC_Sw2_DR; HMW_LC_Bl1_DR; HMW_IO_12_Sw7; HMW_IO_12_Sw14_DR; HMW_IO_12_FM; HBW_1W_T10
- HM-TC-IT-WM-W-EU; HM-CC-RT-DN

fiedel

ZitatIch habe das ganze auch gleich mal getestet! Ich bekommen allerdings eine Fehlermeldung.

Die Infos die man braucht, damit es funktioniert, sind in dem Thread etwas "verteilt". Man muss da mehrmals lesen und genau aufpassen.  ;) Ich stelle mal mein funktionierendes Beispiel hier rein, ich habe ja selbst noch nicht komplett verstanden, wie und warum es funktioniert. ;D Das mit den farbigen Pfeilen je nach In/Out habe ich noch nicht hinbekommen. Vielleicht schafft ihr das ja? Würde mich dann über die Lösung freuen.

In die CFG:
# Logfile der Anrufe (Fritzbox)
define FileLog_Callmon FileLog /fhem/log/Callmon-%Y.log Callmon
attr FileLog_Callmon logtype text

# Callmonitor mit scrollender Anruferliste:
define Callmon FB_CALLMONITOR 192.168.0.10:1012
attr Callmon icon phone_call
attr Callmon local-area-code 030
attr Callmon reverse-search all
attr Callmon reverse-search-cache 1
attr Callmon reverse-search-phonebook-file /fhem/fb_phonebook.xml
attr Callmon userReadings eing0 eing1 eing2 eing3 eing4 A0 A1 A2 A3 A4 B0 B1 B2 B3 B4 C0 C1 C2 C3 C4 D0 D1 D2 D3 D4 E0 E1 E2 E3 E4
attr Callmon verbose 0

# Telefonevents für Anzeige abfangen:
define Func_TelMon_N notify Callmon:.* { \
  TelefonMonitor ($EVENT);; \
}

# Anzeige der Anrufe generieren:
define Anrufliste readingsGroup Callmon:A0,B0,C0,D0,E0 Callmon:A1,B1,C1,D1,E1 Callmon:A2,B2,C2,D2,E2 Callmon:A3,B3,C3,D3,E3 Callmon:A4,B4,C4,D4,E4
attr Anrufliste mapping {'Callmon.A0' => '1.', 'Callmon.A1' => '2.', 'Callmon.A2' => '3.', 'Callmon.A3' => '4.', 'Callmon.A4' => '5.'}
attr Anrufliste nameStyle style="font-weight:bold"
attr Anrufliste noheading 0
attr Anrufliste nolinks 1
attr Anrufliste nostate 1
attr Anrufliste notime 1
attr Anrufliste room 0_Überblick
# attr Anrufliste style style="font-size:20px"
# Style ( noch machen): Pfeile und/oder Nummern farbig je nach in/out:
# attr Anrufliste valueStyle {($READING eq "A0" && $A[$callID] = "<-")?'style="color:red"':'style="color:green"'}



Viel Erfolg!

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

coolice

Guten Abend Frank,

habe alles nach meinem Wissen angepasst. Die Readingsgroup wird als Feld (siehe Anhang) angezeigt.
Natürlich nicht so wie ich es gerne hätte. Die Events werden nach wie vor richtig angezeigt und in die richtigen Attr. geschrieben (ebenfalls siehe Anhang). Wäre nett wenn Du mal drüber schauen würdest.

Mirco

fiedel

Ha,  ;) in der Utils- Datei musste auch noch dein "Fritz_Box" engesetzt werden, anstatt meinem "Callmon..."
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

coolice

Guten Abend. Danke Frank für das bereits angepasste Script. Hatte gesucht und nichts mehr gefunden. Dachte mir "was meint er?"
Da kam mir der Gedanke...er hat meine Arbeit gemacht. :D

Leider bekomme ich nichts angezeigt. Das Log sieht gut aus 2014.01.29 17:56:10 0: Server shutdown
2014.01.29 17:56:13 1: Including fhem.cfg
2014.01.29 17:56:15 3: telnetPort: port 7072 opened
2014.01.29 17:56:16 3: WEB: port 8083 opened
2014.01.29 17:56:16 3: WEBphone: port 8084 opened
2014.01.29 17:56:16 3: WEBtablet: port 8085 opened
2014.01.29 17:56:16 2: eventTypes: loaded 590 events from ./log/eventTypes.txt
2014.01.29 17:56:17 3: Opening CUL_0 device /dev/ttyACM0
2014.01.29 17:56:17 3: Setting CUL_0 baudrate to 38400
2014.01.29 17:56:17 3: CUL_0 device opened
2014.01.29 17:56:17 3: CUL_0: Possible commands: BCFiAZEGMRTVWXefmltux
2014.01.29 17:56:17 2: Switched CUL_0 rfmode to HomeMatic
2014.01.29 17:56:21 3: Opening Fritz_Box device 192.168.143.1:1012
2014.01.29 17:56:21 3: Fritz_Box device opened
2014.01.29 17:56:21 2: FB_CALLMONITOR: Fritz_Box found FritzBox phonebook /var/flash/phonebook
2014.01.29 17:56:21 2: FB_CALLMONITOR: Fritz_Box read 4 contacts from FritzBox phonebook
2014.01.29 17:56:21 3: FB_CALLMONITOR: loading cache file ./log/Fritz_Box-%Y.log Fritz_Box
2014.01.29 17:56:21 2: FB_CALLMONITOR: Fritz_Box read 4 contacts from Cache
2014.01.29 17:56:21 1: Including ./log/fhem.save
2014.01.29 17:56:22 1: usb create starting
2014.01.29 17:56:23 1: usb create end
2014.01.29 17:56:23 2: SecurityCheck:  WEB,WEBphone,WEBtablet has no basicAuth attribute. Running with root privileges. Restart fhem for a new check if the problem is fixed, or set the global attribute motd to none to supress this message.
2014.01.29 17:56:23 0: Server started with 49 defined entities (version $Id: fhem.pl 4709 2014-01-21 18:00:07Z rudolfkoenig $, os linux, user root, pid 16042)
2014.01.29 17:56:26 3: Device Heizung.Bad added to ActionDetector with 000:10 time
2014.01.29 17:56:26 3: Device Heizung.Kueche added to ActionDetector with 000:10 time
2014.01.29 17:58:35 2: CUL_HM set Heizung.Bad_ClimRT_tr getConfig
Im Eventmonitor sieht auch alles gut aus. Hast Du eine Idee?

Grüße
Mirco

holzwurm83

Hallo Frank,

danke für deine Zusammenfassung! Ich habe alles reinkopiert und nur das nötigste angepasst. Allerdings zeigt er bei mir auch nichts in der readingGroup an.

Hier Mal das was im Log steht:
2014.01.29 19:09:31 1: readingsUpdate(,A4,-) missed to call readingsBeginUpdate first.
2014.01.29 19:09:31 1: readingsUpdate(,B4,-) missed to call readingsBeginUpdate first.
2014.01.29 19:09:31 1: readingsUpdate(,C4,-) missed to call readingsBeginUpdate first.
2014.01.29 19:09:31 1: readingsUpdate(,D4,-) missed to call readingsBeginUpdate first.
2014.01.29 19:09:31 1: readingsUpdate(,E4,-) missed to call readingsBeginUpdate first.
2014.01.29 19:09:31 1: readingsUpdate(,A3,-) missed to call readingsBeginUpdate first.
2014.01.29 19:09:31 1: readingsUpdate(,B3,-) missed to call readingsBeginUpdate first.
2014.01.29 19:09:31 1: readingsUpdate(,C3,-) missed to call readingsBeginUpdate first.
2014.01.29 19:09:31 1: readingsUpdate(,D3,-) missed to call readingsBeginUpdate first.
2014.01.29 19:09:31 1: readingsUpdate(,E3,-) missed to call readingsBeginUpdate first.
2014.01.29 19:09:31 1: readingsUpdate(,A2,-) missed to call readingsBeginUpdate first.
2014.01.29 19:09:31 1: readingsUpdate(,B2,-) missed to call readingsBeginUpdate first.
2014.01.29 19:09:31 1: readingsUpdate(,C2,-) missed to call readingsBeginUpdate first.
2014.01.29 19:09:31 1: readingsUpdate(,D2,-) missed to call readingsBeginUpdate first.
2014.01.29 19:09:31 1: readingsUpdate(,E2,-) missed to call readingsBeginUpdate first.
2014.01.29 19:09:31 1: readingsUpdate(,A1,-) missed to call readingsBeginUpdate first.
2014.01.29 19:09:31 1: readingsUpdate(,B1,-) missed to call readingsBeginUpdate first.
2014.01.29 19:09:31 1: readingsUpdate(,C1,-) missed to call readingsBeginUpdate first.
2014.01.29 19:09:31 1: readingsUpdate(,D1,-) missed to call readingsBeginUpdate first.
2014.01.29 19:09:31 1: readingsUpdate(,E1,-) missed to call readingsBeginUpdate first.
2014.01.29 19:09:31 1: readingsUpdate(,A0,-> ) missed to call readingsBeginUpdate first.
2014.01.29 19:09:31 1: readingsUpdate(,B0,19:09:26 29.01.2014) missed to call readingsBeginUpdate first.
2014.01.29 19:09:31 1: readingsUpdate(,C0,unknown) missed to call readingsBeginUpdate first.
2014.01.29 19:09:31 1: readingsUpdate(,D0,01635424437) missed to call readingsBeginUpdate first.
2014.01.29 19:09:31 1: readingsUpdate(,E0, 0:00) missed to call readingsBeginUpdate first.


Und hier meine cfg:
# Logfile der Anrufe (Fritzbox)
define FileLog_Callmon FileLog ./log/Callmon-%Y.log Callmon
attr FileLog_Callmon logtype text

# Callmonitor mit scrollender Anruferliste:
define Callmon FB_CALLMONITOR 192.168.6.1:1012
attr Callmon icon phone_call
attr Callmon local-area-code 0965
attr Callmon reverse-search all
attr Callmon reverse-search-cache 1
attr Callmon reverse-search-phonebook-file /fhem/phonebook.xml
attr Callmon userReadings eing0 eing1 eing2 eing3 eing4 A0 A1 A2 A3 A4 B0 B1 B2 B3 B4 C0 C1 C2 C3 C4 D0 D1 D2 D3 D4 E0 E1 E2 E3 E4
attr Callmon verbose 0

# Telefonevents für Anzeige abfangen:
define Func_TelMon_N notify Callmon:.* { \
  TelefonMonitor ($EVENT);; \
}

# Anzeige der Anrufe generieren:
define Anrufliste readingsGroup Callmon:A0,B0,C0,D0,E0 Callmon:A1,B1,C1,D1,E1 Callmon:A2,B2,C2,D2,E2 Callmon:A3,B3,C3,D3,E3 Callmon:A4,B4,C4,D4,E4
attr Anrufliste mapping {'Callmon.A0' => '1.', 'Callmon.A1' => '2.', 'Callmon.A2' => '3.', 'Callmon.A3' => '4.', 'Callmon.A4' => '5.'}
attr Anrufliste nameStyle style="font-weight:bold"
attr Anrufliste noheading 0
attr Anrufliste nolinks 1
attr Anrufliste nostate 1
attr Anrufliste notime 1
attr Anrufliste room 0_Überblick
# attr Anrufliste style style="font-size:20px"
# Style ( noch machen): Pfeile und/oder Nummern farbig je nach in/out:
# attr Anrufliste valueStyle {($READING eq "A0" && $A[$callID] = "<-")?'style="color:red"':'style="color:green"'}
- Fhem auf einem MacMini Server
- CUL; HMLAN; CUNO2 für FS20; HM-Wired RS485 LAN Gateway
- HMW_Sen_SC_12_FM; HMW_LC_Sw2_DR; HMW_LC_Bl1_DR; HMW_IO_12_Sw7; HMW_IO_12_Sw14_DR; HMW_IO_12_FM; HBW_1W_T10
- HM-TC-IT-WM-W-EU; HM-CC-RT-DN

fiedel

Hm, ist schon wieder ne weile her, dass ich das eingerichtet habe. Was könnte das noch sein?

@coolice:
- mal ein Update machen
- auch immer gerne:
attr global userattr devStateIcon devStateStyle sumERROR sumStatus webCmd

@holzwurm83
- guck mal in der zweiten Utils- Datei (mein letzter Post vor diesem): Dort muss alles was "Fritz_Box" heißt, umbenannt werden in   
   "Callmon". Also so wie der Callmonitor heißt.

Gruß

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

coolice

Tja.leider kein Erfolg. Wenn es wenigstens eine Fehlermeldung gäbe. :(

holzwurm83

So, wie es aussieht geht es jetzt.  :)
Jetzt muss ich nur noch die Darstellung hier und da anpassen.

@ coclice: hast du schon mal einen Anruf getätigt und dann geschaut ob es geht?
- Fhem auf einem MacMini Server
- CUL; HMLAN; CUNO2 für FS20; HM-Wired RS485 LAN Gateway
- HMW_Sen_SC_12_FM; HMW_LC_Sw2_DR; HMW_LC_Bl1_DR; HMW_IO_12_Sw7; HMW_IO_12_Sw14_DR; HMW_IO_12_FM; HBW_1W_T10
- HM-TC-IT-WM-W-EU; HM-CC-RT-DN