Autor Thema: OwnTracks mit Mqtt2 ohne livetracking  (Gelesen 235 mal)

Offline andre07

  • Full Member
  • ***
  • Beiträge: 222
OwnTracks mit Mqtt2 ohne livetracking
« am: 28 Mai 2021, 14:18:20 »
Hallo
Ich habe es endlich geschafft Mqtt2 mit Owntrack zum laufen zu bekommen
nun frage ich mich ist es vielleicht möglich das auch ohne livetracking
zu tun die readings gleich direkt mit in das mqtt2 Device
zu schreiben.Hat das vielleicht schon jemand versucht umzusetzen.
Meine beiden Device wie Sie zur Zeit konfiguriert sind
defmod s9_tracking MQTT2_DEVICE owntracks_mikelsoft_S9:{"_type":"location","acc":14,"alt":404,"batt":59,"bs":1,"conn":"w","created_at":1620986322,"inregions":["home","wayhome"],"lat":48.7576541,"lon":11.6768455,"tid":"01","tst":1620986321,"vac":3,"vel"
attr s9_tracking DbLogExclude .*
attr s9_tracking readingList owntracks/mikelsoft/S9:.* s9mobil\
owntracks/mikelsoft/S9.* raw\
owntracks/mikelsoft/S9/event:.* place\
owntracks/mikelsoft/S9/waypoints:.* wegpunkt\
\
\
\

attr s9_tracking room MQTT2_DEVICE
attr s9_tracking userReadings maplink { my @loc = split(/,/, ReadingsVal("$name","location", "0,0"));; return "http://www.openstreetmap.org/?mlat=" . $loc[0] . "&mlon=" . $loc[1] . "&zoom=15&layers=M";; }

defmod trackingS9 livetracking
attr trackingS9 userattr goneradius homeradius leavetounderway:0,1 wayhomeradius
attr trackingS9 DbLogExclude .*
attr trackingS9 addressReading 1
attr trackingS9 event-on-change-reading .*
attr trackingS9 event-on-update-reading .*
attr trackingS9 filterAccuracy 1200
attr trackingS9 home 48.75761, 11.6769
attr trackingS9 homeradius 100
attr trackingS9 icon rc_dot@blue
attr trackingS9 owntracksDevice s9_tracking
attr trackingS9 room Position
attr trackingS9 roundAltitude 5
attr trackingS9 roundDistance 0.1
attr trackingS9 stateFormat {(split('',ReadingsNum("trackingS9","distance",0)))[0]}
attr trackingS9 userReadings maplink { my @loc = split(/,/, ReadingsVal("s9_tracking","location", "0,0"));; return "http://www.openstreetmap.org/?mlat=" . $loc[0] . "&mlon=" . $loc[1] . "&zoom=15&layers=M";; }, { ReadingsVal($name,"distance",999)< 10 ? "present" : "absent" },Standort {my @addr=(split(/\n/,ReadingsVal("trackingS9","location","na")));; return $addr[0] . ", " . $addr[1] . ", " . $addr[2]}
attr trackingS9 wayhomeradius 4000
attr trackingS9 zonename_0 home
attr trackingS9 zonename_1 arbeit
attr trackingS9 zonename_2 wayhome

Diese readings werden vom mqtt2 Device angelegt
place:     
{"_type":"transition","acc":12.655,"desc":"home","event":"enter","lat":48.7576144,"lon":11.6768661,"t":"l","tid":"01","tst":1622001325,"wtst":1549370108}
 raw:  {"_type":"location","acc":14,"alt":404,"batt":45,"bs":1,"conn":"w","created_at":1622202617,"inregions":["home","wayhome"],"lat":48.7576107,"lon":11.6768586,"t":"p","tid":"01","tst":1622156901,"vac":3,"vel":0}
 s9mobil:   {"_type":"location","acc":14,"alt":404,"batt":45,"bs":1,"conn":"w","created_at":1622202617,"inregions":["home","wayhome"],"lat":48.7576107,"lon":11.6768586,"t":"p","tid":"01","tst":1622156901,"vac":3,"vel":0}




Offline Otto123

  • Tester
  • Hero Member
  • ****
  • Beiträge: 19660
  • schon mal restore trainiert?
    • Otto's Technik Blog
Viele Grüße aus Leipzig
RaspberryPi B B+ B2 B3 B3+ ZeroW,HMLAN,HMUART,Homematic,Fritz!Box 7490+7412,WRT1900ACS-OpenWrt,Sonos,VU+,Arduino nano,ESP8266