Hallo Zusammen,
ich versuche seit ein paar Tagen fhem dazu zu bringen mein Handy im Lan zu erkennen.
Wenn ich die diversen Anleitung richtig verstanden habe sollte es so eigentlich funktionieren:
define Handy PRESENCE lan-ping 192.168.2.18
attr Handy event-on-change-reading state
attr Handy verbose 5
Die Logdatei zeichnet auch auf das erfolgreich gepingt wurde:
2014.08.31 08:36:50 5: PRESENCE (Handy) - stopping timer
2014.08.31 08:36:50 5: PRESENCE (Handy) - starting blocking call for mode lan-ping
2014.08.31 08:36:50 5: PRESENCE (Handy) - starting ping scan: Handy|192.168.2.18|0|4
2014.08.31 08:36:53 5: PRESENCE (Handy) - ping command returned with output:
PING 192.168.2.18 (192.168.2.18) 56(84) bytes of data.
64 bytes from 192.168.2.18: icmp_req=1 ttl=64 time=170 ms
64 bytes from 192.168.2.18: icmp_req=2 ttl=64 time=50.7 ms
64 bytes from 192.168.2.18: icmp_req=3 ttl=64 time=274 ms
64 bytes from 192.168.2.18: icmp_req=4 ttl=64 time=199 ms
--- 192.168.2.18 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3003ms
rtt min/avg/max/mdev = 50.782/174.031/274.961/80.669 ms
Wenn ich den Befehl aber richtig verstehe sollte eigentlich entweder present oder absent als Status zurück kommen.
Bei mir steht unter STATE allerdings active und das ändert sich auch nicht, wenn das Handy nicht im WLAN ist.
Kann mir jemand sagen wo der Fehler liegt?
define Handy PRESENCE lan-ping 192.168.2.18 60
du hast kein zeitinterval angegeben.
gruss frank
hatte es eigentlich so verstanden, dass man das gar nicht braucht, da er dann alle 30 Sekunden pingt.
Habs jetzt aber mal dahinter gesetzt. Leider ohne Erfolg. Status bleibt bei active.
Dabei ist mir aber gerade aufgefallen, dass das Ping auch nur ausgeführt wird wenn ich fhem neu starte oder die config speichere.
Zitathatte es eigentlich so verstanden, dass man das gar nicht braucht, da er dann alle 30 Sekunden pingt.
stimmt. hab ich auch gerade gelesen.
fhem ist aktuell? was ergibt der befehl version?
Bei Version kommt:
# $Id: fhem.pl 6425 2014-08-19 20:55:00Z rudolfkoenig $
# $Id: 10_CUL_HM.pm 6478 2014-08-28 15:01:04Z martinp876 $
# $Id: 01_FHEMWEB.pm 6447 2014-08-24 07:38:52Z rudolfkoenig $
# $Id: 95_FLOORPLAN.pm 6174 2014-06-29 05:51:28Z ulimaass $
# $Id: 92_FileLog.pm 5876 2014-05-16 19:54:51Z rudolfkoenig $
# $Id: 00_HMLAN.pm 6471 2014-08-27 12:32:38Z martinp876 $
# $Id: 73_PRESENCE.pm 6341 2014-08-01 21:56:21Z markusbloch $
# $Id: 99_SUNRISE_EL.pm 5851 2014-05-13 19:39:03Z rudolfkoenig $
# $Id: 98_Text2Speech.pm 6290 2014-07-21 06:38:23Z tobiasfaust $
# $Id: 99_Utils.pm 6446 2014-08-23 10:09:44Z rudolfkoenig $
# $Id: 98_autocreate.pm 6436 2014-08-21 05:40:35Z rudolfkoenig $
# $Id: 98_dummy.pm 4934 2014-02-15 08:23:12Z rudolfkoenig $
# $Id: 91_eventTypes.pm 6428 2014-08-20 11:51:27Z rudolfkoenig $
# $Id: 91_notify.pm 6371 2014-08-07 05:33:37Z rudolfkoenig $
# $Id: 98_telnet.pm 4844 2014-02-08 07:54:03Z rudolfkoenig $
und bei fheminfo:
Fhem info:
Release : 5.5
Branch : DEVELOPMENT
OS : linux
Arch : arm-linux-gnueabihf-thread-multi-64int
Perl : v5.14.2
upTime : 00:01:38
Defined modules:
CUL_HM : 8
FHEMWEB : 8
FLOORPLAN : 1
FileLog : 2
HMLAN : 1
PRESENCE : 1
Text2Speech : 1
autocreate : 1
dummy : 2
eventTypes : 1
notify : 2
telnet : 1
Defined models per module:
CUL_HM : ActionDetector,HM-CC-RT-DN
Auf welcher Hardware läuft FHEM? (FritzBox, Raspberry etc)
Welches Betriebssystem hat das Mobiltelefon?
Was für ein Mobiltelefon?
Das Presence-Modul läuft bei mir problemlos mit der FritzBox (iPhone 4, Android)
Bei FHEM auf den Pi muss ich beim Xperia den Stamina-Modus deaktiveren, um korrekte Ergebnisse zu bekommen. Das iPhone 4 zickt immer noch.
Fhem läuft auf nem Pi und als Handy habe ich ein Samsung Galaxy S4 mit Android.
define Handy PRESENCE lan-ping 192.168.2.18
attr Handy eventMap present:Anwesend absent:Abwesend
Funktioniert das?
Also ich kann keine Veränderung feststellen. Log zeigt noch das selbe und State steht immer noch auf active
ich meine man muss weder mit eventmap noch event-on-change-reading hantieren.
in einer aktuellen fhemversion reicht
define Handy PRESENCE lan-ping 192.168.2.18
völlig aus. Den rest würde ich einfach mal entfernen
dein lanping funktioniert ja anscheinend auch
Zitat4 packets transmitted, 4 received
auch das bringt kein Ergebnis. Und am Handy liegt es wohl auch nicht. Wenn ich statt Handy mal den Router anpinge kommt auch kein anderes Ergebnis.
ZitatDabei ist mir aber gerade aufgefallen, dass das Ping auch nur ausgeführt wird wenn ich fhem neu starte oder die config speichere.
das ist doch erstmal das entscheidende. in fhem.log sollte doch alle x (30) sekunden ein ping-test zu finden sein. was steht denn im log nach restart? bei meiner fritzbox muss fhem mit rootrechten laufen. muss das beim pi auch sein, bzw ist das bei dir der fall?
Also fhem läuft wie gesagt auf nem pi und da er das pingen ja ein mal ausführt kann es glaube ich kein Rechteproblem sein.
Es wirkt eher so als würde er das Ergebnis nicht erkennen und dann abbrechen.
Dein Logauszug oben geht bis zur folgenden Stelle:
2014.08.31 08:36:50 5: PRESENCE (Handy) - stopping timer
2014.08.31 08:36:50 5: PRESENCE (Handy) - starting blocking call for mode lan-ping
2014.08.31 08:36:50 5: PRESENCE (Handy) - starting ping scan: Handy|192.168.2.18|0|4
2014.08.31 08:36:53 5: PRESENCE (Handy) - ping command returned with output:
PING 192.168.2.18 (192.168.2.18) 56(84) bytes of data.
64 bytes from 192.168.2.18: icmp_req=1 ttl=64 time=170 ms
64 bytes from 192.168.2.18: icmp_req=2 ttl=64 time=50.7 ms
64 bytes from 192.168.2.18: icmp_req=3 ttl=64 time=274 ms
64 bytes from 192.168.2.18: icmp_req=4 ttl=64 time=199 ms
--- 192.168.2.18 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3003ms
rtt min/avg/max/mdev = 50.782/174.031/274.961/80.669 ms
Was kommt denn danach? Denn ab da wird es erst interessant, warum kein Ergebnis kommt.
Denke das ist das Problem, danach kommt nichts mehr, was mit Present zu tun hätte.
Es geht dann weiter mit anderen Geräten:
2014.09.03 19:29:04 0: Server shutdown
2014.09.03 19:29:08 1: Including fhem.cfg
2014.09.03 19:29:08 3: telnetPort: port 7072 opened
2014.09.03 19:29:09 3: WEB: port 8083 opened
2014.09.03 19:29:09 3: WEBphone: port 8084 opened
2014.09.03 19:29:09 3: WEBtablet: port 8085 opened
2014.09.03 19:29:09 2: eventTypes: loaded 121 events from ./log/eventTypes.txt
2014.09.03 19:29:09 1: HMLAN_Parse: HMLAN1 new condition disconnected
2014.09.03 19:29:09 3: Opening HMLAN1 device 192.168.2.23:1000
2014.09.03 19:29:09 3: HMLAN1 device opened
2014.09.03 19:29:09 1: HMLAN_Parse: HMLAN1 new condition init
2014.09.03 19:29:12 1: Including ./log/fhem.save
2014.09.03 19:29:12 0: Server started with 24 defined entities (version $Id: fhem.pl 6425 2014-08-19 20:55:00Z rudolfkoenig $, os linux, user fhem, pid 31307)
2014.09.03 19:29:12 5: PRESENCE (Handy) - stopping timer
2014.09.03 19:29:12 5: PRESENCE (Handy) - starting blocking call for mode lan-ping
2014.09.03 19:29:12 5: PRESENCE (Handy) - starting ping scan: Handy|192.168.2.18|0|4
2014.09.03 19:29:12 1: HMLAN_Parse: HMLAN1 new condition ok
2014.09.03 19:29:15 5: PRESENCE (Handy) - ping command returned with output:
PING 192.168.2.18 (192.168.2.18) 56(84) bytes of data.
64 bytes from 192.168.2.18: icmp_req=1 ttl=64 time=381 ms
64 bytes from 192.168.2.18: icmp_req=2 ttl=64 time=214 ms
64 bytes from 192.168.2.18: icmp_req=3 ttl=64 time=137 ms
64 bytes from 192.168.2.18: icmp_req=4 ttl=64 time=56.7 ms
--- 192.168.2.18 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3002ms
rtt min/avg/max/mdev = 56.731/197.619/381.849/120.158 ms
2014.09.03 19:29:17 3: Device Heizung_WZ added to ActionDetector with 000:10 time
Danach kommt nichts mehr.
Hallo sw85.
Ich habe das gleiche Problem.
http://forum.fhem.de/index.php/topic,25580.msg185744.html#msg185744 (http://forum.fhem.de/index.php/topic,25580.msg185744.html#msg185744)
Leider auch keine Lösung, außer das ich die FHEM neu starte nach Modifikationen an FHEM.
Grüße Tim
Also MIT Zeitangabe funktioniert das bei mir einwandfrei:
"define Sony PRESENCE lan-ping 192.168.55.60 900"
Hallo guckt euch doch mal das Modul Roommate in Verbindung mit Geofency an. Sollte es auch (glaube ich) für Android geben. funktioniert super bei mir. (Iphone 5).
Hallo Zusammen,
ich habe noch mal ein bisschen rumprobiert. Für mich sieht es so aus, als würde PRESENCE das Ping-Ergebnis einfach nicht verarbeiten. Unabhängig davon ob das Handy im WLAN ist, hört zumindest die Log-Datei nach dem Ergebnis auf. Ich finde nirgends einen Eintrag, dass der Presense-Wert geändert wurde:
Handy abwesend:
2014.09.20 08:47:37 5: PRESENCE (Handy) - stopping timer
2014.09.20 08:47:37 5: PRESENCE (Handy) - starting blocking call for mode lan-ping
2014.09.20 08:47:38 5: PRESENCE (Handy) - starting ping scan: Handy|192.168.2.18|0|4
2014.09.20 08:47:38 1: HMLAN_Parse: HMLAN1 new condition ok
2014.09.20 08:47:42 3: Device Heizung_WZ added to ActionDetector with 000:10 time
2014.09.20 08:47:51 5: PRESENCE (Handy) - ping command returned with output:
PING 192.168.2.18 (192.168.2.18) 56(84) bytes of data.
--- 192.168.2.18 ping statistics ---
4 packets transmitted, 0 received, 100% packet loss, time 3005ms
Handy anwesend:
2014.09.20 08:54:11 5: PRESENCE (Handy) - stopping timer
2014.09.20 08:54:11 5: PRESENCE (Handy) - starting blocking call for mode lan-ping
2014.09.20 08:54:11 5: PRESENCE (Handy) - starting ping scan: Handy|192.168.2.18|0|4
2014.09.20 08:54:11 1: HMLAN_Parse: HMLAN1 new condition ok
2014.09.20 08:54:14 5: PRESENCE (Handy) - ping command returned with output:
PING 192.168.2.18 (192.168.2.18) 56(84) bytes of data.
64 bytes from 192.168.2.18: icmp_req=1 ttl=64 time=13.9 ms
64 bytes from 192.168.2.18: icmp_req=2 ttl=64 time=22.4 ms
64 bytes from 192.168.2.18: icmp_req=3 ttl=64 time=50.4 ms
64 bytes from 192.168.2.18: icmp_req=4 ttl=64 time=73.7 ms
--- 192.168.2.18 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3005ms
rtt min/avg/max/mdev = 13.941/40.156/73.776/23.653 ms
In beiden Fällen passiert nichts mehr (zumindest nichts was mit Precence zu tun hätte) bis ich fhem neu starte.
Geofency kommt nicht in Frage, da es das für Android nicht gibt.