Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 95919

Google_maps last_seen attribute goes backwards

$
0
0

@pnbruckner wrote:

Has anyone else noticed that the google_maps device_tracker integration sometimes gets updates out of order? I.e., it seems sometimes the last_seen attribute for an update is older than the last_seen attribute from the previous update. I’ve also looked at the latitude and longitude attributes when this happens and it seems sometimes an older update happens a second time (after some other updates with newer last_seen timestamps.)

I have a fix for this that I’m considering submitting as a PR, but I wanted to see if it was happening to anyone else before doing so. I came up with the following as a way to track this happening:

notify:
  - name: google
    platform: file
    filename: google.log
    timestamp: true
automation:
- trigger:
    platform: event
    event_type: state_changed
  condition:
    condition: template
    value_template: >
      {{ trigger.event.data.entity_id.startswith('device_tracker.google_maps')
         and trigger.event.data.new_state is not none
         and trigger.event.data.old_state is not none
         and trigger.event.data.new_state.attributes.last_seen is defined
         and trigger.event.data.old_state.attributes.last_seen is defined
         and trigger.event.data.new_state.attributes.last_seen <
             trigger.event.data.old_state.attributes.last_seen }}
  action:
    service: notify.google
    data_template:
      message: >
        old: {{
          trigger.event.data.old_state.attributes.last_seen
        }} new: {{
          trigger.event.data.new_state.attributes.last_seen
        }} {{ trigger.event.data.new_state.name }}

This will write entries to a file named google.log in your config directory whenever this happens.

I’d be interested to hear if anyone else has noticed this, or if you give the logging technique a try and what your results are.

FWIW, sometimes this doesn’t happen for hours, maybe days, but generally it seems to happen several times a day.

Posts: 2

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 95919

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>