<?xml version="1.0" encoding="UTF-8"?>        <rss version="2.0"
             xmlns:atom="http://www.w3.org/2005/Atom"
             xmlns:dc="http://purl.org/dc/elements/1.1/"
             xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
             xmlns:admin="http://webns.net/mvcb/"
             xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
             xmlns:content="http://purl.org/rss/1.0/modules/content/">
        <channel>
            <title>
									Lokalizacja telefonów za pomocą Google Maps - OpenHAB				            </title>
            <link>https://www.smartnydom.pl/forum/openhab/lokalizacja-telefonow-za-pomoca-google-maps/</link>
            <description>Discussion Board</description>
            <language>pl-PL</language>
            <lastBuildDate>Mon, 15 Jun 2026 08:19:40 +0000</lastBuildDate>
            <generator>wpForo</generator>
            <ttl>60</ttl>
							                    <item>
                        <title>ODP: Lokalizacja telefonów za pomocą Google Maps</title>
                        <link>https://www.smartnydom.pl/forum/openhab/lokalizacja-telefonow-za-pomoca-google-maps/#post-32107</link>
                        <pubDate>Mon, 27 Nov 2023 17:42:41 +0000</pubDate>
                        <description><![CDATA[Tak czułem że pałeczka leży po stronie google.
Na osi czasu jest trasa z całego dnia jakby odczyt był co metr, a na podglądzie w OH już tak nie jest.]]></description>
                        <content:encoded><![CDATA[<p>Tak czułem że pałeczka leży po stronie google.</p>
<p>Na osi czasu jest trasa z całego dnia jakby odczyt był co metr, a na podglądzie w OH już tak nie jest.</p>]]></content:encoded>
						                            <category domain="https://www.smartnydom.pl/forum/openhab/">OpenHAB</category>                        <dc:creator>szpila86</dc:creator>
                        <guid isPermaLink="true">https://www.smartnydom.pl/forum/openhab/lokalizacja-telefonow-za-pomoca-google-maps/#post-32107</guid>
                    </item>
				                    <item>
                        <title>ODP: Lokalizacja telefonów za pomocą Google Maps</title>
                        <link>https://www.smartnydom.pl/forum/openhab/lokalizacja-telefonow-za-pomoca-google-maps/#post-32069</link>
                        <pubDate>Sat, 25 Nov 2023 13:26:23 +0000</pubDate>
                        <description><![CDATA[@szpila86 Domyślnie jest to 60s i można zmienić poprzez zmienną środowiskową INTERVAL (uzupełniłem dokumentacje w repo).
Nie wiem tylko czy to zwiększy częstotliwość odczytu pozycji. Czy to...]]></description>
                        <content:encoded><![CDATA[<p>@szpila86 Domyślnie jest to 60s i można zmienić poprzez zmienną środowiskową INTERVAL (uzupełniłem dokumentacje w repo).</p>
<p>Nie wiem tylko czy to zwiększy częstotliwość odczytu pozycji. Czy to nie jest tak, że usługi Google same decydują, kiedy nastąpi przesłanie aktualnej pozycji telefonu, a my tylko mamy wpływ na to, jak często odczytujemy pozycję z usługi Google.</p>]]></content:encoded>
						                            <category domain="https://www.smartnydom.pl/forum/openhab/">OpenHAB</category>                        <dc:creator>kamiKAC</dc:creator>
                        <guid isPermaLink="true">https://www.smartnydom.pl/forum/openhab/lokalizacja-telefonow-za-pomoca-google-maps/#post-32069</guid>
                    </item>
				                    <item>
                        <title>ODP: Lokalizacja telefonów za pomocą Google Maps</title>
                        <link>https://www.smartnydom.pl/forum/openhab/lokalizacja-telefonow-za-pomoca-google-maps/#post-32061</link>
                        <pubDate>Fri, 24 Nov 2023 15:33:40 +0000</pubDate>
                        <description><![CDATA[Co ile następuję odświeżenie pozycji czy da się zmienić częstotliwość?]]></description>
                        <content:encoded><![CDATA[<p>Co ile następuję odświeżenie pozycji czy da się zmienić częstotliwość?</p>]]></content:encoded>
						                            <category domain="https://www.smartnydom.pl/forum/openhab/">OpenHAB</category>                        <dc:creator>szpila86</dc:creator>
                        <guid isPermaLink="true">https://www.smartnydom.pl/forum/openhab/lokalizacja-telefonow-za-pomoca-google-maps/#post-32061</guid>
                    </item>
				                    <item>
                        <title>ODP: Lokalizacja telefonów za pomocą Google Maps</title>
                        <link>https://www.smartnydom.pl/forum/openhab/lokalizacja-telefonow-za-pomoca-google-maps/#post-31995</link>
                        <pubDate>Wed, 15 Nov 2023 19:30:44 +0000</pubDate>
                        <description><![CDATA[Pojawiło się pytanie:
Jak zainstalować obraz dockerowy na QNAPie (model z Container Station)?
Wszystkie parametry, łącznie z nazwą obrazu są podane w compose.yaml podanym w linku w poradni...]]></description>
                        <content:encoded><![CDATA[<p>Pojawiło się pytanie:</p>
<p>Jak zainstalować obraz dockerowy na QNAPie (model z Container Station)?</p>
<p>Wszystkie parametry, łącznie z nazwą obrazu są podane w compose.yaml podanym w linku w poradniku (uruchomienie z docker compose).</p>
<p>W dokumentacji w <a href="https://github.com/kamiKAC/google-location" target="_blank" rel="noopener">repo</a> jest też pokazane jak uruchomić obraz bez docker compose, więc można stamtąd wziąć konfigurację.</p>
<p>Obraz jest dostępny na <a href="https://hub.docker.com/" target="_blank" rel="noopener">DockerHubie</a>.</p>
<p>W Container Station docker compose występuje jako Container Station Application, więc można wrzucić tego YAMLa i powinno też działać :</p>
<p><a href="https://www.qnap.com/en/how-to/tutorial/article/how-to-use-container-station-3" target="_blank" rel="noopener">https://www.qnap.com/en/how-to/tutorial/article/how-to-use-container-station-3</a></p>]]></content:encoded>
						                            <category domain="https://www.smartnydom.pl/forum/openhab/">OpenHAB</category>                        <dc:creator>kamiKAC</dc:creator>
                        <guid isPermaLink="true">https://www.smartnydom.pl/forum/openhab/lokalizacja-telefonow-za-pomoca-google-maps/#post-31995</guid>
                    </item>
				                    <item>
                        <title>ODP: Lokalizacja telefonów za pomocą Google Maps</title>
                        <link>https://www.smartnydom.pl/forum/openhab/lokalizacja-telefonow-za-pomoca-google-maps/#post-31681</link>
                        <pubDate>Tue, 17 Oct 2023 07:24:14 +0000</pubDate>
                        <description><![CDATA[UPDATE:
Zaktualizowałem program i nie potrzeba już transform oraz rules.
mqtt.things
Thing mqtt:topic:googlelocation_User1 &quot;Google Location: User1&quot; (mqtt:broker:mosquitto){
	Channels:
	...]]></description>
                        <content:encoded><![CDATA[<p>UPDATE:</p>
<p>Zaktualizowałem program i nie potrzeba już transform oraz rules.</p>
<p><em>mqtt.things</em></p>
<pre contenteditable="false">Thing mqtt:topic:googlelocation_User1 "Google Location: User1" (mqtt:broker:mosquitto){
	Channels:
		Type number   : Accuracy         
		Type string   : Address          
		Type number   : Battery_Level    
		Type contact  : Charging         
		Type string   : Country_Code     
		Type datetime : Timestamp        
		Type string   : Full_Name        
		Type string   : Id_number        
		Type number   : Latitude         
		Type number   : Longitude        
		Type string   : Photo_URL        
		Type string   : Coordinates      
	}</pre>
<p><em>location.items</em></p>
<pre contenteditable="false">Number   GPSLocation_User1_Accuracy       "Accuracy"       (Logged) {channel="mqtt:topic:googlelocation_User1:Accuracy"}
String   GPSLocation_User1_Address        "Address"        (Logged) {channel="mqtt:topic:googlelocation_User1:Address"}
Number:Dimensionless   GPSLocation_User1_Battery_Level  "Battery Level "  (Logged) {channel="mqtt:topic:googlelocation_User1:Battery_Level"}
Contact  GPSLocation_User1_Charging       "Charging"       (Logged) {channel="mqtt:topic:googlelocation_User1:Charging"}
String   GPSLocation_User1_Country_Code   "Country Code"   (Logged) {channel="mqtt:topic:googlelocation_User1:Country_Code"}
DateTime GPSLocation_User1_Timestamp      "Timestamp "      (Logged) {channel="mqtt:topic:googlelocation_User1:Timestamp"}
String   GPSLocation_User1_Full_Name      "Full Name"      (Logged) {channel="mqtt:topic:googlelocation_User1:Full_Name"}
String   GPSLocation_User1_Id_number      "ID Number"      (Logged) {channel="mqtt:topic:googlelocation_User1:Id_number"}
Number   GPSLocation_User1_Latitude       "Latitude"       (Logged) {channel="mqtt:topic:googlelocation_User1:Latitude"}
Number   GPSLocation_User1_Longitude      "Longitude"      (Logged) {channel="mqtt:topic:googlelocation_User1:Longitude"}
Location GPSLocation_User1_Location       "Location"       (Logged) {channel="mqtt:topic:googlelocation_User1:Coordinates"}
String   GPSLocation_User1_Photo_URL      "Photo URL"      (Logged) {channel="mqtt:topic:googlelocation_User1:Photo_URL"}
</pre>
<p>Pozdrawiam i życzę udanego śledzenia ;)</p>]]></content:encoded>
						                            <category domain="https://www.smartnydom.pl/forum/openhab/">OpenHAB</category>                        <dc:creator>kamiKAC</dc:creator>
                        <guid isPermaLink="true">https://www.smartnydom.pl/forum/openhab/lokalizacja-telefonow-za-pomoca-google-maps/#post-31681</guid>
                    </item>
				                    <item>
                        <title>Lokalizacja telefonów za pomocą Google Maps</title>
                        <link>https://www.smartnydom.pl/forum/openhab/lokalizacja-telefonow-za-pomoca-google-maps/#post-31680</link>
                        <pubDate>Mon, 16 Oct 2023 20:04:05 +0000</pubDate>
                        <description><![CDATA[Cześć
Postanowiłem podzielić się sposobem na odczyt lokalizacji telefonów za pomocą usługi lokalizacyjnej Google. Oczywiście można to zrealizować za pomocą np. GPSTracker Binding, ale wykor...]]></description>
                        <content:encoded><![CDATA[<p>Cześć</p>
<p>Postanowiłem podzielić się sposobem na odczyt lokalizacji telefonów za pomocą usługi lokalizacyjnej Google. Oczywiście można to zrealizować za pomocą np. GPSTracker Binding, ale wykorzystanie usług Google ma niezaprzeczalne zalety:</p>
<ul>
<li>nie wymaga instalacji żadnego oprogramowania (usługi Google są standardowo w telefonach z Androidem)</li>
<li>nie powoduje zwiekszonego zużycia baterii</li>
<li>lokalizuje telefony dzieci, jeśli mają zainstalowanego FamilyLinka</li>
<li>lokalizuje telefony, na których udostepniono lokalizację do podłączonego konta</li>
</ul>
<p>Inspirowałem się tym wpisem <a href="https://community.openhab.org/t/google-family-location-sharing-in-openhab-via-python-and-mqtt/" target="_blank" rel="noopener">https://community.openhab.org/t/google-family-location-sharing-in-openhab-via-python-and-mqtt/.</a></p>
<p>Jako, że od jakiegoś czasu jestem fanem kontenerów zatem zaczynamy od instalacji dockera</p>
<pre contenteditable="false">curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh
sudo usermod -aG docker $USER
</pre>
<p>Ostatnia komenda pozwoli używać dockera bez używania sudo. Aby tak się stało należy ponownie zalogować się do konsoli.</p>
<p>Kolejnym krokiem jest pozyskanie ciastka:</p>
<ul>
<li>instalujemy dodatek do Firefoxa do zapisywania ciastek (np. <a href="https://addons.mozilla.org/en-US/firefox/addon/export-cookies-txt/" target="_blank" rel="noopener">https://addons.mozilla.org/en-US/firefox/addon/export-cookies-txt/</a>)</li>
<li>otwieramy nowe okno prywatne i wpisujemy adres <a href="https://maps.google.com/" target="_blank" rel="noopener">https://maps.google.com/</a></li>
<li>logujemy się na konto google</li>
<li>klikamy ikone dodatku “Export cookies”, a następnie “All Domains” i zapisujemy ciastko.</li>
</ul>
<p>Następnie tworzymy folder, w którym umieścimy konfigurację dockera i ciastko, które pozwoli uzyskać dostęp do konta Google.</p>
<pre contenteditable="false">mkdir -p google_location
cd google_location
wget https://github.com/kamiKAC/google-location/raw/main/compose.yaml</pre>
<p> Do folderu google_location wrzucamy pobrane z przegladąrki ciastko jako googlemaps_cookie.txt (jeśli zapiszemy pod inną nazwą, to trzeba potem uwzględnić to w pliku <em>compose.yaml</em>).</p>
<p>Otwieramy plik compose.yaml edytorem i konfigurujemy</p>
<pre contenteditable="false">nano compose.yaml</pre>
<p>Niezbędne jest wpisanie naszego emaila.  Jeśli nasz serwer MQTT znajduje się na tym samym hoście, co nasz kontener dockera, działa na domyślnym porcie 1883 i nie wymaga autentykacji, to można pozostawić wartości domyślne w tym pliku.</p>
<p>Po zapisaniu pliku, uruchamiamy kontener (domyślnie kontener jest tak skonfigurowany, że uruchamia się automatycznie po uruchomieniu system operacyjnego, zatem nie ma potrzeby używania do tego żadnych skryptów).</p>
<pre contenteditable="false">docker compose up -d</pre>
<p>Jeśli nie popełniliśmy błędu to kontener powinien działać, logi widać po wydaniu komendy</p>
<pre contenteditable="false">docker logs -f  google_location-google-location-1</pre>
<p>Zatrzymujemy (niszczymy) kontener dockera komendą</p>
<pre contenteditable="false">docker compose down</pre>
<p> </p>
<p>Aby odczytać dane lokalizacji dodajemy do <em>mqtt.things</em> (przyjmujemy, że mamy już skonfigurowany bridge o nazwie <em>mosquitto)</em></p>
<pre contenteditable="false">Thing mqtt:topic:googlelocation_User1 "Google Location: User1" (mqtt:broker:mosquitto){
	Channels:
		Type number   : Accuracy         
		Type string   : Address          
		Type number   : Battery_Level    
		Type contact  : Charging         
		Type string   : Country_Code     
		Type datetime : Timestamp        
		Type string   : Full_Name        
		Type string   : Id_number        
		Type number   : Latitude         
		Type number   : Longitude        
		Type string   : Photo_URL        
	}</pre>
<p>Plik <em>googletimestamp.js</em> (folder <em>transform)</em></p>
<pre contenteditable="false">(function(timestamp){
    return timestamp.substring(0,10) + 'T' + timestamp.substring(11,24) + timestamp.substring(26,29) + timestamp.substring(30,32)
})(input)</pre>
<p>Plik <em>location.items</em></p>
<pre contenteditable="false">Number   GPSLocation_User1_Accuracy       "Accuracy"       (Logged) {channel="mqtt:topic:googlelocation_User1:Accuracy"}
String   GPSLocation_User1_Address        "Address"        (Logged) {channel="mqtt:topic:googlelocation_User1:Address"}
Number:Dimensionless   GPSLocation_User1_Battery_Level  "Battery Level "  (Logged) {channel="mqtt:topic:googlelocation_User1:Battery_Level"}
Contact  GPSLocation_User1_Charging       "Charging"       (Logged) {channel="mqtt:topic:googlelocation_User1:Charging"}
String   GPSLocation_User1_Country_Code   "Country Code"   (Logged) {channel="mqtt:topic:googlelocation_User1:Country_Code"}
DateTime GPSLocation_User1_Timestamp      "Timestamp "      (Logged) {channel="mqtt:topic:googlelocation_User1:Timestamp"}
String   GPSLocation_User1_Full_Name      "Full Name"      (Logged) {channel="mqtt:topic:googlelocation_User1:Full_Name"}
String   GPSLocation_User1_Id_number      "ID Number"      (Logged) {channel="mqtt:topic:googlelocation_User1:Id_number"}
Number   GPSLocation_User1_Latitude       "Latitude"       (Logged) {channel="mqtt:topic:googlelocation_User1:Latitude"}
Number   GPSLocation_User1_Longitude      "Longitude"      (Logged) {channel="mqtt:topic:googlelocation_User1:Longitude"}
Location GPSLocation_User1_Location       "Location"       (Logged) 
String   GPSLocation_User1_Photo_URL      "Photo URL"      (Logged) {channel="mqtt:topic:googlelocation_Weronika:Photo_URL"}
</pre>
<p>Plik <em>location.rules</em></p>
<pre contenteditable="false">rule "Position - User1"

when 
    Item GPSLocation_User1_Latitude changed or
	Item GPSLocation_User1_Longitude changed
then
	if (GPSLocation_User1_Latitude.state !== "UNDEF" &amp;&amp; GPSLocation_User1_Longitude.state !== "UNDEF") {
		GPSLocation_User1_Location.postUpdate(new PointType(GPSLocation_User1_Latitude.state.toString + "," + GPSLocation_User1_Longitude.state.toString))
		}
	else {
		GPSLocation_User1_Location.postUpdate("-")
		}
end</pre>
<p> Mam nadzieję, że komus się przyda - ja korzystam od kilku miesięcy i działa bardzo dobrze :)</p>]]></content:encoded>
						                            <category domain="https://www.smartnydom.pl/forum/openhab/">OpenHAB</category>                        <dc:creator>kamiKAC</dc:creator>
                        <guid isPermaLink="true">https://www.smartnydom.pl/forum/openhab/lokalizacja-telefonow-za-pomoca-google-maps/#post-31680</guid>
                    </item>
							        </channel>
        </rss>
		
<!--
Performance optimized by W3 Total Cache. Learn more: https://www.boldgrid.com/w3-total-cache/?utm_source=w3tc&utm_medium=footer_comment&utm_campaign=free_plugin

Object Caching 48/57 objects using Memcached
Page Caching using Memcached (Requested URI contains query) 
Database Caching 8/40 queries in 0.020 seconds using Memcached

Served from: www.smartnydom.pl @ 2026-06-15 10:19:40 by W3 Total Cache
-->