TurnOfAFriendlyCard / Domoticz-GPSLogger-Plugin

Capture location data obtained via GPS Logger app in Domoticz devices.
https://www.buymeacoffee.com/turnofafriendlycard
MIT License
0 stars 0 forks source link

Away from home does generate errors... Location not recognized ..Battery and Speed are recorded #6

Closed Sloeber71 closed 4 months ago

Sloeber71 commented 4 months ago

Hi,

When I leave home the location is not logging into Domoticz. Speed and Battery working correctly.

These are the logs and rawdata

Error log 2024-04-02 14:19:14.064 Error: GPS: File "/home/hans/domoticz/plugins/Domoticz-GPSLogger-Plugin/plugin.py", line 236, in onHeartbeat 2024-04-02 14:19:14.064 Error: GPS: distanceToLoc = haversine(float(self.circleLatitude),float(self.circleLongitude),float(line[1]),float(line[2])) 2024-04-02 14:19:14.064 Error: GPS: ~~~~^^^ 2024-04-02 14:19:14.064 Error: GPS: IndexError: list index out of range 2024-04-02 14:19:29.065 Error: GPS: Call to function 'onHeartbeat' failed, exception details: 2024-04-02 14:19:29.066 Error: GPS: Traceback (most recent call last): 2024-04-02 14:19:29.066 Error: GPS: File "/home/hans/domoticz/plugins/Domoticz-GPSLogger-Plugin/plugin.py", line 317, in onHeartbeat 2024-04-02 14:19:29.066 Error: GPS: _plugin.onHeartbeat() 2024-04-02 14:19:29.066 Error: GPS: File "/home/hans/domoticz/plugins/Domoticz-GPSLogger-Plugin/plugin.py", line 236, in onHeartbeat 2024-04-02 14:19:29.066 Error: GPS: distanceToLoc = haversine(float(self.circleLatitude),float(self.circleLongitude),float(line[1]),float(line[2])) 2024-04-02 14:19:29.066 Error: GPS: ~~~~^^^

All 2024-04-02 14:27:11.373 GPS: Pushing 'CPluginMessageBase' on to queue 2024-04-02 14:27:11.410 GPS: Processing 'CPluginMessageBase' message 2024-04-02 14:27:11.410 GPS: Acquiring GIL for 'CPluginMessageBase' 2024-04-02 14:27:11.410 GPS: Message handler 'onDeviceModified' not callable, ignored. 2024-04-02 14:27:11.410 GPS: Acquiring GIL for 'CPluginMessageBase' 2024-04-02 14:27:14.019 GPS: Pushing 'onHeartbeatCallback' on to queue 2024-04-02 14:27:14.069 GPS: Processing 'onHeartbeatCallback' message 2024-04-02 14:27:14.069 GPS: Acquiring GIL for 'onHeartbeatCallback'

Rawdata 024-04-02 14:15:07 51.20056442;3.20621609;0.4;74.0 gpslogger (IP: 109.139.110.22) 2024-04-02 14:14:51 51.20071317;3.20661446;1.22;74.0 gpslogger (IP: 109.139.110.22) 2024-04-02 14:14:35 51.20077359;3.20687328;1.26;74.0 gpslogger (IP: 109.139.110.22) 2024-04-02 14:14:19 51.2005407;3.20709648;2.17;74.0 gpslogger (IP: 109.139.110.22) 2024-04-02 14:14:02 51.20017685;3.20717661;1.07;74.0 gpslogger (IP: 109.139.110.22) 2024-04-02 14:13:45 51.19994451;3.20733283;1.46;74.0 gpslogger (IP: 109.139.110.22) 2024-04-02 14:13:28 51.20003934;3.20764131;0.93;74.0 gpslogger (IP: 109.139.110.22) 2024-04-02 14:13:11 51.20007831;3.2080205;0.59;75.0 gpslogger (IP: 109.139.110.22) 2024-04-02 14:12:55 51.2000259;3.2082493;0.0;75.0 gpslogger (IP: 109.139.110.22) 2024-04-02 14:12:39 51.1998179;3.2082673;0.0;75.0 gpslogger (IP: 109.139.110.22) 2024-04-02 14:12:36 51.1998192;3.2083579;0.0;75.0 gpslogger (IP: 109.139.110.22) 2024-04-02 14:12:00 51.1997733;3.2084258;0.0;75.0 gpslogger (IP: 10.10.3.115)

Using the latest plugin version... installed using git pull

TurnOfAFriendlyCard commented 4 months ago

The plugin chrashes when it tries to process the locations in the location.txt file. Can you validate your location.txt file please (or share with me so I can analyse as well). Example file looks like this:

Name,Latitude,Longitude,Radius Town Hall Rotterdam,51.922710,4.479160,50

First line are the headers. Next line(s) the location(s) you would like to use. Be aware no empty lines after the last line (so after Town Hall Rotterdam) as well.

Sloeber71 commented 4 months ago

This is my locations file locations.txt

TurnOfAFriendlyCard commented 4 months ago

Please remove the empty lines after the last line - Colruyt (I can see there are three empty lines).

Sloeber71 commented 4 months ago

OK, first edited the file with internal editor WinSCP, Notepad++ indeed shows 3 empty lines... Corrected that... I will test this and report.

Sloeber71 commented 4 months ago

The locations are now getting logged into Domoticz. Tested also a location with a named place record in the file.. OK

I was walking for almost 20 minutes. Now I see that the speed is not recorded all of the time, just once...at start.. then nothing. Also I walked quicker then the 2km/h... My cadence is at 5 tot 6 km/h. See attachments

[chart.csv]

(https://github.com/TurnOfAFriendlyCard/Domoticz-GPSLogger-Plugin/files/14841976/chart.csv) location table 2024-04-02_19-56-00 speed chart 2024-04-02_19-53-52

TurnOfAFriendlyCard commented 4 months ago

Great the location issue is resolved now. I've adjusted the instruction (readme) on this. Will leave this issue open for adding a check on empty lines in the location.txt file to be discarded. On the speed topic, this is captured from GPSLogger, there is nothing the plugin does with this value other than capturing and storing in the device.

Sloeber71 commented 4 months ago

I will further investigate the speed issue. Maybe off topic, but I will create a script in dzvents to give me the same alerts Life360 gives me, when someone is arriving and leaving a named place stored in the locations file. Maybe someone already did this ? Just asking, can I post the script somewhere for testing... here or other topic ?

Sloeber71 commented 4 months ago

Hi, I do not agree... the speed is recorded as it should and reported to the rawdata. Is it possible that domoticz just stores the value every 5 minutes... I did ride the bike during 5 minutes. That is less then the next interval at 10 min...

rawdata 2024-04-03_11-17-33 speed 2024-04-03_11-20-50

TurnOfAFriendlyCard commented 4 months ago

I will further investigate the speed issue. Maybe off topic, but I will create a script in dzvents to give me the same alerts Life360 gives me, when someone is arriving and leaving a named place stored in the locations file. Maybe someone already did this ? Just asking, can I post the script somewhere for testing... here or other topic ?

Created new issue #7 to follow up on alerts in DzVents. Please share the scripts will store them.

TurnOfAFriendlyCard commented 4 months ago

I will close this original issue on locations as this resolved. And create a new issue on speed. Could indeed be related to Domoticz behavior.

Sloeber71 commented 4 months ago

just adding a xls

speed.xls