GPSlogger extract Lat and Lon to compare to GEOfence

Hi

I have reached my level of understanding. I believe I need a funcion to do this task, but I have no idea how to write it. Could someone please help with the below?

My Flow

NB: There may be a lot simpler way to achieve this…

I have an app on my phone GPSlogger (Android)

I am trying to compare its GPS location with Node Red Geofence Locations.

Below is the Full msg I can see. I would like to extract the GSP Data to compare it to the Inside or Outside geofence locations.

Thanks

Hans

{“topic”:“device_tracker.hans_gpslogger”,“payload”:“home”,“data”:{“entity_id”:“device_tracker.hans_gpslogger”,“old_state”:{“entity_id”:“device_tracker.hans_gpslogger”,“state”:“home”,“attributes”:{“source_type”:“gps”,“latitude”:-26.458741,“longitude”:142.7459652,“gps_accuracy”:22,“battery”:35,“speed”:0,“direction”:0,“altitude”:52.400001525878906,“provider”:“network”,“activity”:"",“friendly_name”:“hans gpslogger”},“last_changed”:“2018-06-24T12:15:31.055553+00:00”,“last_updated”:“2018-06-24T12:29:57.684507+00:00”},“new_state”:{“entity_id”:“device_tracker.hans_gpslogger”,“state”:“home”,“attributes”:{“source_type”:“gps”,“latitude”:-26.4587416,“longitude”:142.7459652,“gps_accuracy”:22,“battery”:35,“speed”:0,“direction”:0,“altitude”:52.400001525878906,“provider”:“network”,“activity”:"",“friendly_name”:“hans gpslogger”},“last_changed”:“2018-06-24T12:15:31.055553+00:00”,“last_updated”:“2018-06-24T12:31:00.039979+00:00”}},"_msgid":“b5ee0937.997978”}

What has this to do with home assistant? I suggest you ask on a node-red forum.

No worries, thought this was a good place as it was the Node Red sub forum and I was using it within Home Assistant.