Modul: 98_livetracking - Geokoordinaten von OwnTracks / Life360 / Swarm (4Sq)

Begonnen von Markus M., 22 Mai 2015, 02:01:46

Vorheriges Thema - Nächstes Thema

Baumi

Zitat von: Markus M. am 20 Januar 2016, 20:52:26
Macht aber eigentlich nichts, da man stattdessen ja einfach die Entfernung zum Zuhause verwenden kann.
Das zusammen mit dem neuen Filter auf Accuracy sollte klappen.

Kannst Du kurz erklären, wie das mit der Entfernung zu einem bestimmten Punkt geht? Oder steht das schon im Thread hier und ich hab's nur übersehen?

Markus M.

Sollte im ersten Post sein: ins Attribut home einfach die Location eintragen, dann bekommst du ein Reading distance.
Aktuell weder Smarthome noch FHEM vorhanden

Baumi

Zitat von: Markus M. am 21 Januar 2016, 16:18:45
Sollte im ersten Post sein: ins Attribut home einfach die Location eintragen, dann bekommst du ein Reading distance.

Danke, hatte ich tatsächlich übersehen. Funktioniert super.

Markus M.

Man kann jetzt auch mehr als ein Wort an OwnTracks senden und die TTL in einem Attribut festlegen.
Mehrere Zonen sind über ein Event aktivierbar (RegEx im Zonennamen)

;) Markus

P.S.: Irgendwelche Gründe (abgesehen von der noch fehlenden Doku), die gegen eine offizielle Veröffentlichung des Moduls sprechen? Meinem Gefühl nach läuft es mittlerweile stabil genug.
Aktuell weder Smarthome noch FHEM vorhanden

klausw

Hatte noch immer keine Zeit die Zonen zu testen, aber abgesehen davon...
Läuft stabil, wäre super wenn es in das SVN reinkommt.
RasPi B v2 mit FHEM 18B20 über 1Wire, LED PWM Treiber über I2C, Luchtdruck-, Feuchtesensor und ein paar Schalter/LED\'s zum testen
Module: RPI_GPIO, RPII2C, I2C_EEPROM, I2C_MCP23008, I2C_MCP23017, I2C_MCP342x, I2C_PCA9532, I2C_PCF8574, I2C_SHT21, I2C_BME280

klausw

Ist die Frage:
Zitat von: Markus M. am 21 Januar 2016, 00:24:14
Weiss zufällig jemand wie ich die SetFn nur aktiviere wenn das OwnTracks Attribut gesetzt ist?
noch aktuell?
RasPi B v2 mit FHEM 18B20 über 1Wire, LED PWM Treiber über I2C, Luchtdruck-, Feuchtesensor und ein paar Schalter/LED\'s zum testen
Module: RPI_GPIO, RPII2C, I2C_EEPROM, I2C_MCP23008, I2C_MCP23017, I2C_MCP342x, I2C_PCA9532, I2C_PCF8574, I2C_SHT21, I2C_BME280

Markus M.


Zitat von: klausw am 01 Februar 2016, 16:49:42
Ist die Frage:noch aktuell?

Ja, das fehlt noch.
Klappt aber wahrscheinlich nicht wirklich, das beim Anlegen des Attributs im UI zu aktivieren.
Aktuell weder Smarthome noch FHEM vorhanden

klausw

Zitat von: Markus M. am 01 Februar 2016, 18:24:56
Ja, das fehlt noch.
Klappt aber wahrscheinlich nicht wirklich, das beim Anlegen des Attributs im UI zu aktivieren.
Doch, das sollte klappen:

Die Sets werden dynamisch erzeugt: Wenn du die Detailseite vom Modul aufrufst, dann führt die fhem.pl "set name ?" aus.
Dann sollte deine SetFn sowas wie
Unknown argument ? choose one of deine sets mit leerzeichen getrennt
an die fhem.pl zurückliefern. Diese werden dann auf der Detailseite angezeigt.
Wenn undef zurückgeliefert wird, dann wird set auf der Detailseite nicht angezeigt.

Also an der Stelle wo du sowas wie:
return 'Unknown argument ' . $cmd . ', choose one of ...
ausführst, einfach mit
AttrVal($name, "attributname", "defaultvalue")
auf das Attribut prüfen und mit
return undef
die Sets verschwinden lassen, wenn das Attribut nicht vorhanden ist.
RasPi B v2 mit FHEM 18B20 über 1Wire, LED PWM Treiber über I2C, Luchtdruck-, Feuchtesensor und ein paar Schalter/LED\'s zum testen
Module: RPI_GPIO, RPII2C, I2C_EEPROM, I2C_MCP23008, I2C_MCP23017, I2C_MCP342x, I2C_PCA9532, I2C_PCF8574, I2C_SHT21, I2C_BME280

Markus M.

Aktuell weder Smarthome noch FHEM vorhanden

Markus M.

Hier mal ein Beispiel für eine 24h History als Grafik:

define history_map weblink htmlCode {'<div style="pointer-events:none;; overflow: hidden;; width: 620;; height: 455px;;"><img src="'.maphistory().'" width="620" height="480" style="border:0;; margin-top: 0px;; margin-bottom: -25px;;"></img></div>'}

sub maphistory {
  my $seconds = $_[0];
  $seconds = 24*60*60 if(!defined($seconds));

  my $googlekey = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
  my $dblogdevice = "fhemDbLog";

  my $from = FmtDateTime(time()-$seconds);
  my $to = FmtDateTime(time());
  $from =~ s/\ /_/g;
  $to   =~ s/\ /_/g;
  my $path = '';

  ########################################
  my $livetrackingdevice = "livetracking";
  my $currentlocation = ReadingsVal($livetrackingdevice,'location','');
  my $locationhistory = fhem("get $dblogdevice - - $from $to $livetrackingdevice:location",1);
  my @locations = split("\n", $locationhistory);
  $path .= "&markers=color:reduce|label:M|$currentlocation";
  $path .= "&path=color:0xff0000dd|weight:2";

  my $oldlat = '';
  my $oldlon = '';
  foreach my $location (@locations)
  {
    next if($location =~ /#/);
    $location =~ s/^.* //g;
    my @latlon = split(",",$location);
    my $lat = substr($latlon[0],0,7);
    my $lon = substr($latlon[1],0,7);

    $path .= "|".$lat.",".$lon if(length($path) < 1800 && ($lat ne $oldlat || $lon ne $oldlon));
    $oldlat = $lat;
    $oldlon = $lon;
  }
########################################

  return "https://maps.googleapis.com/maps/api/staticmap?language=en&size=620x480&scale=2&key=$googlekey&style=feature:poi|element:labels|visibility:off&style=feature:transit|element:labels|visibility:simplified|saturation:-80&maptype=roadmap$path";
}
Aktuell weder Smarthome noch FHEM vorhanden

Luigi

Ich bekomm seit einiger Zeit immer wieder folgende Fehlermeldung:

Modification of non-creatable array value attempted, subscript -1 at ./FHEM/98 livetracking.pm line 839.

und FHEM stürzt ab.


Internals:
   CHANGED
   NAME       tracking
   NOTIFYDEV  owntracks
   NR         731
   NTFY_ORDER 999-tracking
   STATE      46.xxxxx,12.xxxx
   TYPE       livetracking
   Readings:
     2016-03-01 20:56:14   accuracy        20 m
     2016-03-01 20:56:14   battery         38 %
     2016-03-01 20:56:14   distance        0 km
     2016-03-01 20:56:14   location        46.xxxx,12.xxxx
     2016-03-01 19:17:35   place           atWork
     2016-03-01 19:20:03   zone_1          inactive
   Helper:
     lastOwnTracks 1456862174
Attributes:
   comment    1
   event-on-change-reading place,location,zone_0,zone_1
   filterAccuracy 100
   home       46.xxxx,12.xxxx
   room       99_System
   stateFormat location
   zonename_0 atHome
   zonename_1 atWork


Gruß Luigi

Markus M.

Zitat von: Luigi am 01 März 2016, 21:09:03
Ich bekomm seit einiger Zeit immer wieder folgende Fehlermeldung:
Modification of non-creatable array value attempted, subscript -1 at ./FHEM/98 livetracking.pm line 839.
und FHEM stürzt ab.

Dann probier doch mal die aktuelle Version aus dem ersten Post.
Bei der steht in Zeile 839 nämlich nur ein Kommentar ;)
Aktuell weder Smarthome noch FHEM vorhanden

regenbieger

hi, leider schaffe ich es nicht mit Openstreetmap linien zu zeichnen, fallback ist nun doch eine Googleapikey.
@Markus M. vielen dank für deine Vorlage, hier nun meine Version: (Pos schaltet die Info durch,Ani schaltet Mäusekino an und aus)

define history_map weblink htmlCode {getGWebMap()}

sub getGWebMap() {
    my $seconds = $_[0];
  $seconds = 24*60*60 if(!defined($seconds));

  my $dblogdevice = "FILLinYOURdblogdevice";
  my $livetrackingdevice = "FILLinYOURlivetrackingdevice";
  my $googlekey = "FILLinYOURkey";


  my $OSMCreate = '';
  my $OSMPath = '';
  my $OSMMarkers = '';
  my $OSMInfo = '';

  my $from = FmtDateTime(time()-$seconds);
  my $to = FmtDateTime(time());
  $from =~ s/\ /_/g;
  $to   =~ s/\ /_/g;

  my $currentlocation = ReadingsVal($livetrackingdevice,'location','');
  my $locationhistory = fhem("get $dblogdevice - - $from $to $livetrackingdevice:location",1);
  my @locations = split("\n", $locationhistory);

  my @cclatlon = split(",",$currentlocation);
  my $oldlat = '0';
  my $oldlon = '0';


  foreach my $location (@locations)
  {
    next if($location =~ /#/);
    my @nfoct = split(" ",$location);
    my @nfott = split("_",$nfoct[0]);
    $location =~ s/^.* //g;
    my @latlon = split(",",$location);
    #my $lat = substr($latlon[0],0,7);
    #my $lon = substr($latlon[1],0,7);
    my $lat = $latlon[0];
    my $lon = $latlon[1];
    my $dist = abs($lat-$oldlat) + abs($lon-$oldlon);
    if($dist > 0.0002) {
       $OSMInfo .= "infowins.push(new google.maps.InfoWindow({content:'".$nfott[1]."',disableAutoPan: true}));";
       $OSMMarkers .= "markers.push(new google.maps.Marker({position:{lat:".$lat.",lng:".$lon;
       $OSMMarkers .= "},map: map,title:'".$nfott[1]."',";
       $OSMMarkers .= "icon: {path: google.maps.SymbolPath.CIRCLE,scale:6,";
       $OSMMarkers .= "fillColor:'yellow',fillOpacity: 0.4,strokeColor:'blue',strokeWeight:1}}));";
       $OSMPath .= "{lat:".$lat.",lng:".$lon."},";
       $oldlat = $lat;
       $oldlon = $lon;
    }
   }

    $OSMInfo .= "infowins.push(new google.maps.InfoWindow({content:'Jetzt',disableAutoPan: true}));";
    $OSMMarkers .= "markers.push(new google.maps.Marker({position:{lat:".$cclatlon[0].",lng:".$cclatlon[1];
    $OSMMarkers .= "},map: map,title:'Jetzt',";
    $OSMMarkers .= "icon: {path: google.maps.SymbolPath.CIRCLE,scale:6,";
    $OSMMarkers .= "fillColor:'yellow',fillOpacity: 0.4,strokeColor:'blue',strokeWeight:1}}));";
    $OSMPath .= "{lat:".$cclatlon[0].",lng:".$cclatlon[1]."}";

  $OSMCreate .= "<!DOCTYPE html>";
  $OSMCreate .= "<html><head><title>Kartograph</title>";
  $OSMCreate .= "<style>#floating-panel {position: absolute;top: 4px;left: 25%;";
  $OSMCreate .= "z-index: 5;background-color: #fff;padding: 1px;border: 1px solid #999;";
  $OSMCreate .= "text-align: center;font-family: 'Roboto','sans-serif';line-height: 18px;";
  $OSMCreate .= "padding-left: 3px;}</style>";
  $OSMCreate .= "</head>";
  $OSMCreate .= "<body><div id='floating-panel'>";
  $OSMCreate .= "<input onclick='clearMarkers();' type=button value='Pos'>";
  $OSMCreate .= "<input onclick='showMarkers();' type=button value='Ani'>";
  $OSMCreate .= "</div>";
  $OSMCreate .= "<div id='mapdiv' ";
  $OSMCreate .= "style='width:800px;height:600px;border:1px solid #CECECE;'";
  $OSMCreate .= "></div>";
  $OSMCreate .= "<script>";
  $OSMCreate .= "var map;";
  $OSMCreate .= "var statemark = 2;";
  $OSMCreate .= "var stateani = 1;";
  $OSMCreate .= "var markers = [];";
  $OSMCreate .= "var infowins = [];";
  $OSMCreate .= "function initMap() {";
  $OSMCreate .= "map = new google.maps.Map(document.getElementById('mapdiv'), {";
  $OSMCreate .= "zoom:16,center: {lat: ".$cclatlon[0].", lng: ".$cclatlon[1]."},mapTypeId: google.maps.MapTypeId.ROADMAP});";
  $OSMCreate .= "var LLCoordinates = [".$OSMPath."];";
  $OSMCreate .= "var lineSymbol = { path: google.maps.SymbolPath.FORWARD_OPEN_ARROW };";
  $OSMCreate .= "var LLPath = new google.maps.Polyline({ path: LLCoordinates , geodesic: true,";
  $OSMCreate .= "strokeColor: '#FF0000', strokeOpacity: 0.5, strokeWeight: 3,";
  $OSMCreate .= "icons: [{ icon: lineSymbol, offset: '2%' , repeat: '2%' }] });";
  $OSMCreate .= "LLPath.setMap(map);";
  $OSMCreate .= $OSMMarkers;
  $OSMCreate .= $OSMInfo;
  $OSMCreate .= "animateCircle(LLPath);}";
  $OSMCreate .= "function animateCircle(line) {var count = 0;window.setInterval(function() {";
  $OSMCreate .= " count = (count + 1) % 2000;if (stateani == 1){var icons = line.get('icons');";
  $OSMCreate .= " icons[0].offset = (count / 20) + '%';line.set('icons', icons);}}, 20);}";
  $OSMCreate .= "function setMapOnAll(map) { for (var i = 0; i < markers.length; i++) {";
  $OSMCreate .= "markers[i].setMap(map);}}";
  $OSMCreate .= "function setInfoOffAll() { for (var i = 0; i < infowins.length; i++) {";
  $OSMCreate .= "infowins[i].close();}}";
  $OSMCreate .= "function setInfoOnAll(map) { for (var i = 0; i < markers.length; i++) {";
  $OSMCreate .= "infowins[i].open(map, markers[i]);}}";
  $OSMCreate .= "function clearMarkers() {";
  $OSMCreate .= "if (statemark == 0){setInfoOffAll();setMapOnAll(null);}";
  $OSMCreate .= "if (statemark == 1){setMapOnAll(map);}";
  $OSMCreate .= "if (statemark == 2){setInfoOnAll(map);}";
  $OSMCreate .= "statemark = statemark + 1;";
  $OSMCreate .= "if (statemark == 3){statemark = 0;}";
  $OSMCreate .= "}";
  $OSMCreate .= "function showMarkers() {if (stateani == 1){stateani=0;}else{stateani=1;}}";
  $OSMCreate .= "</script>";
  $OSMCreate .= "<script async defer src='https://maps.googleapis.com/maps/api/js?";
  $OSMCreate .= "key=".$googlekey."&signed_in=true&callback=initMap&libraries=geometry'></script>";
  $OSMCreate .= "</body></html>";

    return $OSMCreate;
}


Übrigens, die Ruhe hier im Thread ist aus meiner Sicht ein Zeichen für die Zufriedenheit der User und keine Leichenstarre  ;) also wenn es jemand mal einchecken könnte wäre es toll  ::)
FHEM und WEEWX auf Raspberry

Lowbird

Hallo Freunde des gepflegten Trackings!

Ich benötige eure Hilfe. Ich habe mich jetzt tagelang daran versucht, es zum laufen zu bringen. Aber es klappt noch nicht so ganz.

Was habe ich bis jetzt gemacht?:

Ich habe Mosquitto am laufen...

# Place your local configuration in /etc/mosquitto/conf.d/
#
# A full description of the configuration file is at
# /usr/share/doc/mosquitto/examples/mosquitto.conf.example

pid_file /var/run/mosquitto.pid

persistence true
persistence_location /var/lib/mosquitto/
log_timestamp true
password_file /etc/mosquitto/passwd


autosave_interval 60
connection_messages true
log_dest stderr
log_dest topic
log_type error
log_type warning
log_type notice
log_type information
log_type all
log_type debug
log_timestamp true
listener 1883 127.0.0.1
listener 8883


log_dest file /var/log/mosquitto/mosquitto.log

include_dir /etc/mosquitto/conf.d


In Mosquitto einen User test angelegt. FHEM und Mosquitto laufen beide auf dem selben System (Jessie)


Hier mal die List´s der angelegten Devices:

MQTT: Internals:
   DEF        127.0.0.1:8883
   DeviceName 127.0.0.1:8883
   FD         4
   NAME       mqtt
   NOTIFYDEV  global
   NR         134
   NTFY_ORDER 50-mqtt
   PARTIAL
   STATE      opened
   TYPE       MQTT
   buf
   msgid      3
   ping_received 1
   timeout    60
   Readings:
     2016-08-03 14:52:46   connection      active
     2016-08-02 23:19:22   state           opened
   Messages:
     1:
       timeout    1470173861.09593
     10:
       timeout    1470206979.07882
     100:
       timeout    1470208139.17011
     101:
       timeout    1470208146.41438
     102:
       timeout    1470208153.19134
     103:
       timeout    1470208160.30522
     104:
       timeout    1470208167.1802
     105:
       timeout    1470208174.33053
     106:
       timeout    1470208181.18651
     107:
       timeout    1470208188.35399
     108:
       timeout    1470208195.19315
     109:
       timeout    1470208202.40021
     11:
       timeout    1470206979.15666
     110:
       timeout    1470208209.18443
     111:
       timeout    1470208216.36186
     112:
       timeout    1470208223.26511
     113:
       timeout    1470208230.33551
     114:
       timeout    1470208237.2272
     115:
       timeout    1470208244.42288
     116:
       timeout    1470208251.22663
     117:
       timeout    1470208258.33852
     118:
       timeout    1470208265.20626
     119:
       timeout    1470208274.56868
     12:
       timeout    1470206994.4941
     120:
       timeout    1470208296.57577
     121:
       timeout    1470208308.39703
     122:
       timeout    1470208310.41228
     123:
       timeout    1470208310.41859
     124:
       timeout    1470208310.42436
     125:
       timeout    1470208310.43
     126:
       timeout    1470208317.61233
     127:
       timeout    1470208322.23252
     128:
       timeout    1470208330.69051
     129:
       timeout    1470208330.85422
     13:
       timeout    1470207012.2736
     130:
       timeout    1470208330.86022
     131:
       timeout    1470208330.86577
     132:
       timeout    1470208330.87142
     133:
       timeout    1470208330.87687
     134:
       timeout    1470208337.25443
     135:
       timeout    1470208354.57176
     136:
       timeout    1470208357.51454
     137:
       timeout    1470208369.22504
     138:
       timeout    1470208370.04456
     139:
       timeout    1470208380.12586
     14:
       timeout    1470207025.26716
     140:
       timeout    1470208380.44387
     141:
       timeout    1470208380.44996
     142:
       timeout    1470208392.31026
     143:
       timeout    1470208401.68704
     144:
       timeout    1470208409.43351
     145:
       timeout    1470208416.2671
     146:
       timeout    1470208423.18233
     147:
       timeout    1470208430.29404
     148:
       timeout    1470208437.18266
     149:
       timeout    1470208444.36084
     15:
       timeout    1470207039.81215
     150:
       timeout    1470208450.19103
     151:
       timeout    1470208456.29951
     152:
       timeout    1470208462.19593
     153:
       timeout    1470208469.3912
     154:
       timeout    1470208475.29222
     155:
       timeout    1470208481.50097
     156:
       timeout    1470208487.19313
     157:
       timeout    1470208493.32506
     158:
       timeout    1470208499.16023
     159:
       timeout    1470208506.33767
     16:
       timeout    1470207051.02613
     160:
       timeout    1470208513.21227
     161:
       timeout    1470208520.37575
     162:
       timeout    1470208527.20295
     163:
       timeout    1470208534.37304
     164:
       timeout    1470208541.20382
     165:
       timeout    1470208548.37031
     166:
       timeout    1470208555.18397
     167:
       timeout    1470208562.42922
     168:
       timeout    1470208570.25383
     169:
       timeout    1470208579.43198
     17:
       timeout    1470207062.38729
     170:
       timeout    1470208588.34125
     171:
       timeout    1470208590.49457
     172:
       timeout    1470208597.36265
     173:
       timeout    1470208606.33604
     174:
       timeout    1470208614.28538
     175:
       timeout    1470208622.47768
     176:
       timeout    1470208630.16023
     177:
       timeout    1470208637.33842
     178:
       timeout    1470208637.40286
     179:
       timeout    1470208645.28171
     18:
       timeout    1470207076.45512
     180:
       timeout    1470208652.46605
     181:
       timeout    1470208660.19866
     182:
       timeout    1470208668.35362
     183:
       timeout    1470208668.60894
     184:
       timeout    1470208676.21851
     185:
       timeout    1470208684.33201
     186:
       timeout    1470208684.39295
     187:
       timeout    1470208691.24874
     188:
       timeout    1470208698.29547
     189:
       timeout    1470208698.3638
     19:
       timeout    1470207414.6578
     190:
       timeout    1470208705.25883
     191:
       timeout    1470208713.37666
     192:
       timeout    1470208721.23948
     193:
       timeout    1470208728.35462
     194:
       timeout    1470208735.26021
     195:
       timeout    1470208743.39509
     196:
       timeout    1470208743.46621
     197:
       timeout    1470208751.20754
     198:
       timeout    1470208758.32818
     199:
       timeout    1470208765.20167
     2:
       timeout    1470174090.0028
     20:
       timeout    1470207439.16311
     200:
       timeout    1470208772.36167
     201:
       timeout    1470208772.42991
     202:
       timeout    1470208779.20219
     203:
       timeout    1470208786.3824
     204:
       timeout    1470208793.2033
     205:
       timeout    1470208800.38091
     206:
       timeout    1470208808.25153
     207:
       timeout    1470208817.50318
     208:
       timeout    1470208826.39738
     209:
       timeout    1470208828.56437
     21:
       timeout    1470207447.30438
     210:
       timeout    1470208834.57566
     211:
       timeout    1470208842.35969
     212:
       timeout    1470208850.19748
     213:
       timeout    1470208858.33388
     214:
       timeout    1470208858.40436
     215:
       timeout    1470208865.2328
     216:
       timeout    1470208872.36208
     217:
       timeout    1470208872.43214
     218:
       timeout    1470208879.25393
     219:
       timeout    1470208887.34924
     22:
       timeout    1470207456.38369
     220:
       timeout    1470208895.27931
     221:
       timeout    1470208903.41419
     222:
       timeout    1470208911.33545
     223:
       timeout    1470208919.38909
     224:
       timeout    1470208919.45138
     225:
       timeout    1470208927.25272
     226:
       timeout    1470208935.35599
     227:
       timeout    1470208943.21932
     228:
       timeout    1470208951.40626
     229:
       timeout    1470208951.47989
     23:
       timeout    1470207465.28295
     230:
       timeout    1470208959.21241
     231:
       timeout    1470208967.35292
     232:
       timeout    1470208967.40358
     233:
       timeout    1470208976.3494
     234:
       timeout    1470208979.48885
     235:
       timeout    1470208986.47798
     236:
       timeout    1470208998.32927
     237:
       timeout    1470209012.37402
     238:
       timeout    1470209029.4478
     239:
       timeout    1470209045.42921
     24:
       timeout    1470207474.49216
     240:
       timeout    1470209057.42199
     241:
       timeout    1470209068.36852
     242:
       timeout    1470209079.48497
     243:
       timeout    1470209090.40424
     244:
       timeout    1470209101.35877
     245:
       timeout    1470209112.37736
     246:
       timeout    1470209123.46969
     247:
       timeout    1470209134.35247
     248:
       timeout    1470209143.41852
     249:
       timeout    1470209152.42408
     25:
       timeout    1470207485.25276
     250:
       timeout    1470209161.43787
     251:
       timeout    1470209170.38832
     252:
       timeout    1470209179.38197
     253:
       timeout    1470209188.38013
     254:
       timeout    1470209197.38579
     255:
       timeout    1470209207.38749
     256:
       timeout    1470209218.38229
     257:
       timeout    1470209229.35458
     258:
       timeout    1470209239.42121
     259:
       timeout    1470209249.41937
     26:
       timeout    1470207574.5386
     260:
       timeout    1470209258.44246
     261:
       timeout    1470209267.35995
     262:
       timeout    1470209276.40934
     263:
       timeout    1470209285.35246
     264:
       timeout    1470209294.40315
     265:
       timeout    1470209303.43329
     266:
       timeout    1470209311.25075
     267:
       timeout    1470209320.35211
     268:
       timeout    1470209329.36976
     269:
       timeout    1470209331.58819
     27:
       timeout    1470207585.35397
     270:
       timeout    1470209338.58234
     271:
       timeout    1470209347.37396
     272:
       timeout    1470209356.49325
     273:
       timeout    1470209365.39134
     274:
       timeout    1470209377.41154
     275:
       timeout    1470209425.34618
     276:
       timeout    1470209436.13572
     277:
       timeout    1470209445.41251
     278:
       timeout    1470209454.52022
     279:
       timeout    1470209465.30082
     28:
       timeout    1470207604.11792
     280:
       timeout    1470209506.43658
     281:
       timeout    1470209613.73629
     282:
       timeout    1470216214.8207
     283:
       timeout    1470216214.84598
     284:
       timeout    1470216214.85205
     285:
       timeout    1470216214.85771
     286:
       timeout    1470216214.86333
     287:
       timeout    1470216214.8688
     288:
       timeout    1470216214.87476
     289:
       timeout    1470216214.88027
     29:
       timeout    1470207604.22788
     290:
       timeout    1470216214.88636
     291:
       timeout    1470216214.89193
     292:
       timeout    1470216214.89752
     293:
       timeout    1470216214.90315
     294:
       timeout    1470216214.90878
     295:
       timeout    1470216214.91475
     296:
       timeout    1470216214.92026
     297:
       timeout    1470216214.9257
     298:
       timeout    1470216214.93128
     299:
       timeout    1470216215.83426
     3:
       timeout    1470176226.48803
     30:
       timeout    1470207612.33902
     300:
       timeout    1470216215.85531
     301:
       timeout    1470216215.86138
     302:
       timeout    1470216215.86711
     303:
       timeout    1470216215.87267
     304:
       timeout    1470216215.87824
     305:
       timeout    1470216215.88417
     306:
       timeout    1470216215.88985
     307:
       timeout    1470216215.89592
     308:
       timeout    1470216215.9015
     309:
       timeout    1470216215.90712
     31:
       timeout    1470207620.2042
     310:
       timeout    1470216215.91258
     311:
       timeout    1470216215.91809
     312:
       timeout    1470216215.92354
     313:
       timeout    1470216215.92944
     314:
       timeout    1470216216.01111
     315:
       timeout    1470216216.01719
     316:
       timeout    1470216216.89538
     317:
       timeout    1470216216.90158
     318:
       timeout    1470216216.90715
     319:
       timeout    1470216216.91255
     32:
       timeout    1470207629.36139
     320:
       timeout    1470227870.75878
     321:
       timeout    1470228143.16068
     322:
       timeout    1470228174.52611
     323:
       timeout    1470228204.2091
     33:
       timeout    1470207638.32379
     34:
       timeout    1470207640.47039
     35:
       timeout    1470207647.35961
     36:
       timeout    1470207655.19294
     37:
       timeout    1470207666.37134
     38:
       timeout    1470207670.20534
     39:
       timeout    1470207679.62941
     4:
       timeout    1470206917.3947
     40:
       timeout    1470207679.89305
     41:
       timeout    1470207684.22152
     42:
       timeout    1470207690.55142
     43:
       timeout    1470207699.5669
     44:
       timeout    1470207704.54522
     45:
       timeout    1470207711.77368
     46:
       timeout    1470207718.35889
     47:
       timeout    1470207718.44691
     48:
       timeout    1470207725.09093
     49:
       timeout    1470207732.27942
     5:
       timeout    1470206917.45889
     50:
       timeout    1470207739.15512
     51:
       timeout    1470207746.47747
     52:
       timeout    1470207753.33581
     53:
       timeout    1470207760.35448
     54:
       timeout    1470207767.17194
     55:
       timeout    1470207774.35062
     56:
       timeout    1470207781.16496
     57:
       timeout    1470207788.34036
     58:
       timeout    1470207795.16546
     59:
       timeout    1470207802.29566
     6:
       timeout    1470206917.4649
     60:
       timeout    1470207811.33878
     61:
       timeout    1470207824.34428
     62:
       timeout    1470207846.38926
     63:
       timeout    1470207866.33045
     64:
       timeout    1470207881.36549
     65:
       timeout    1470207890.41116
     66:
       timeout    1470207897.20427
     67:
       timeout    1470207904.34682
     68:
       timeout    1470207911.1706
     69:
       timeout    1470207918.35911
     7:
       timeout    1470206917.47049
     70:
       timeout    1470207925.18665
     71:
       timeout    1470207932.32017
     72:
       timeout    1470207939.21134
     73:
       timeout    1470207946.33136
     74:
       timeout    1470207953.20824
     75:
       timeout    1470207960.33356
     76:
       timeout    1470207966.16958
     77:
       timeout    1470207972.39701
     78:
       timeout    1470207978.27068
     79:
       timeout    1470207985.28365
     8:
       timeout    1470206935.40293
     80:
       timeout    1470207992.19675
     81:
       timeout    1470207999.3682
     82:
       timeout    1470208007.2187
     83:
       timeout    1470208017.32633
     84:
       timeout    1470208029.33073
     85:
       timeout    1470208029.40157
     86:
       timeout    1470208040.49284
     87:
       timeout    1470208049.49158
     88:
       timeout    1470208057.18866
     89:
       timeout    1470208064.37215
     9:
       timeout    1470206951.2831
     90:
       timeout    1470208071.20285
     91:
       timeout    1470208078.40086
     92:
       timeout    1470208084.2073
     93:
       timeout    1470208091.31106
     94:
       timeout    1470208098.15192
     95:
       timeout    1470208105.47387
     96:
       timeout    1470208112.23004
     97:
       timeout    1470208118.4608
     98:
       timeout    1470208125.2817
     99:
       timeout    1470208132.37418
Attributes:
   room       Tracking
   verbose    5


owntracks: Internals:
   CHANGED
   IODev      mqtt
   NAME       owntracks
   NR         135
   STATE      incoming publish received
   TYPE       MQTT_DEVICE
   qos        1
   retain     0
   Readings:
     2016-08-03 14:42:24   transmission-state incoming publish received
   Message_ids:
   Publishsets:
     :
       topic      owntracks/test/iphone
       values:
   Sets:
   subscribe:
     owntracks/test/iphone
   subscribeExpr:
     ^owntracks\/test\/iphone$
   Subscribereadings:
     owntracks/test/iphone .*
Attributes:
   IODev      mqtt
   autoSubscribeReadings owntracks/test/iphone
   event-on-change-reading iphone,iphoneevent
   publishSet owntracks/test/iphone
   qos        at-least-once
   room       Tracking
   stateFormat transmission-state
   subscribeReading_.* owntracks/test/iphone


tracking (livetracking):
Internals:
   NAME       tracking
   NOTIFYDEV  owntracks
   NR         136
   NTFY_ORDER 999-tracking
   STATE      Initialized
   TYPE       livetracking
   Helper:
Attributes:
   owntracksDevice owntracks
   room       Tracking
   stateFormat location
   verbose    5


Das Endgerät, was die Daten sendet, ist ein iphone. Der Status der OwnTracks App steht auf Connected, daher sollte ja zumindest mal der Mosquitto richtig laufen.

Ich bekomme auch im Log Daten angezeigt, die auch defintiv zum Telefon passen.

2016.08.03 09:25:47.387 5: SW: 400200ff
2016.08.03 09:25:58.379 5: MQTT mqtt message received: Publish/at-least-once owntracks/test/iphone/256
  7b 22 63 6f 67 22 3a 37 31 2c 22 62 61 74 74 22  {"cog":71,"batt"
  3a 36 34 2c 22 6c 6f 6e 22 3a 31 33 2e 32 38 39  :64,"lon":13.289
  31 30 36 38 32 33 35 31 36 33 35 2c 22 61 63 63  10682351635,"acc
  22 3a 35 2c 22 70 22 3a 31 30 30 2e 36 31 36 37  ":5,"p":100.6167
  37 35 35 31 32 36 39 35 33 2c 22 76 65 6c 22 3a  755126953,"vel":
  36 38 2c 22 76 61 63 22 3a 38 2c 22 6c 61 74 22  68,"vac":8,"lat"
  3a 35 32 2e 35 33 32 38 37 31 30 33 30 33 31 39  :52.532871030319
  39 37 2c 22 74 73 74 22 3a 31 34 37 30 32 30 39  97,"tst":1470209
  31 35 32 2c 22 61 6c 74 22 3a 34 32 2c 22 5f 74  152,"alt":42,"_t
  79 70 65 22 3a 22 6c 6f 63 61 74 69 6f 6e 22 2c  ype":"location",
  22 74 69 64 22 3a 22 63 68 22 7d                 "tid":"ch"}
2016.08.03 09:25:58.382 5: MQTT mqtt message sent: PubAck/at-most-once 256
2016.08.03 09:25:58.382 5: SW: 40020100
2016.08.03 09:26:09.352 5: MQTT mqtt message received: Publish/at-least-once owntracks/test/iphone/257
  7b 22 63 6f 67 22 3a 33 37 2c 22 62 61 74 74 22  {"cog":37,"batt"
  3a 36 34 2c 22 6c 6f 6e 22 3a 31 33 2e 32 39 31  :64,"lon":13.291
  37 39 34 31 34 35 34 39 32 31 38 2c 22 61 63 63  79414549218,"acc
  22 3a 31 30 2c 22 70 22 3a 31 30 30 2e 36 35 32  ":10,"p":100.652
  31 30 37 32 33 38 37 36 39 35 2c 22 76 65 6c 22  1072387695,"vel"
  3a 36 38 2c 22 76 61 63 22 3a 38 2c 22 6c 61 74  :68,"vac":8,"lat
  22 3a 35 32 2e 35 33 33 37 34 35 36 34 30 30 30  ":52.53374564000
  36 34 31 2c 22 74 73 74 22 3a 31 34 37 30 32 30  641,"tst":147020
  39 31 36 33 2c 22 61 6c 74 22 3a 33 39 2c 22 5f  9163,"alt":39,"_
  74 79 70 65 22 3a 22 6c 6f 63 61 74 69 6f 6e 22  type":"location"
  2c 22 74 69 64 22 3a 22 63 68 22 7d              ,"tid":"ch"}
2016.08.03 09:26:09.354 5: MQTT mqtt message sent: PubAck/at-most-once 257
2016.08.03 09:26:09.354 5: SW: 40020101


Wenn ich die Koordinaten vergleiche, dann passt das zu dem Bewegungsmuster meines Handys.  ;)

Also scheint die Schnittstelle FHEM zu Mosquitto auch zu funktionieren. Zumindest schließe ich das aus den vorhanden Logeinträgen.


Jetzt allerdings meine Frage(n): Was genau macht das Device tracking (livetracking). Ich weiß nicht wie ich das einbinden soll oder kann. Egal welches Device ich als owntracksDevice deklariere, es ändert sich nichts.

Woher kommen die Timeouts beim Device mqtt, und beeinträchtigen Sie die Funtktion?

Ich habe keine Readings, welche es mir erlaubt die Positionsdaten zu loggen. Evtl für einen späteren Verlauf.


Ich hoffe ich habe erstmal ausreichend Informationen dargestellt um eine Hilfestellung zu bekommen.

Wenn weitere Infos benötigt werde, immer raus damit!


Seid bitte nachsichtig mit mir, ich stehe noch am Anfang was pearl und FHEM angeht. Ich habe auch versucht aus der CommandRef schlau zu werden, aber leider ist Diese für mich als DAU doch sehr spärlich beschrieben, bzw verstehe ich es nicht so ganz.  :-\


Ich danke im Voraus

LG Chris



FHEM 5.7
FritzBox 7490
Vu+ Duo2
IP-Cam Instar 6012HD
IP-Cam Instar 5907HD

Markus M.

Als owntracksDevice musst du ein MQTT_DEVICE definieren.
Das muss die passenden Subscriptions haben.
(Siehe Screenshot)


Update: OwnTracks Messaging angepasst auf neue Featured Funktion
Aktuell weder Smarthome noch FHEM vorhanden