add time_zone aware attribute 'last_seen' #1760
Replies: 6 comments 1 reply
-
Is there a particular reason that you can't use the device_tracker's last_updated/last_changed? |
Beta Was this translation helpful? Give feedback.
-
well, I thought I had described that reason above? In need of a timezone aware attribute, to be able to calculate the time difference between a traveling tracker and the home instance. Last_changed wouldn't be useful since the tracker wouldn't need to have changed at all, and yes I did look at last_updated, but that isn't timezone aware is it? did have a go at this:
but I am not very confident it does what I seek it to do, and I can't test it because I am at Home ;-) |
Beta Was this translation helpful? Give feedback.
-
I guess I'm not understanding what this would do to augment the device tracker. Are you looking for a new entity from the device for its current time zone? |
Beta Was this translation helpful? Give feedback.
-
Not a new entity per se, an attribute 'last_seen' for the existing device_tracker would do the job. I did have a look at the last_seen of the life360 integration but that too doesn't seem to be timezone aware
|
Beta Was this translation helpful? Give feedback.
-
Hi Zac, revisiting my HA templates, I wonder if this would be something you could once more have a look at. Still in 'need' for a native 'core' HA way to be able to calculate the time difference between the home server local time, and a device_trackers local time. To see how many hours earlier or later that specific tracker lives, compared to the home location. Hope you can once more consider this being a useful addition to the core sensors of mobile_app. |
Beta Was this translation helpful? Give feedback.
-
Personally, I think this would be better as a separate integration that makes a timestamp sensor, tz location sensor, and possibly other information. It's input would be a gps sensor, device_tracker, or person. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Is your feature request related to a problem? Please describe.
trying to replace as much custom components/integrations with core as possible, I am stuck here, using the Composite integration which allows me to use an attribute last_seen and calculate the timezone difference between home and the tracker:
Describe the solution you'd like
the above solution, but using an additional attribute to the current set of attributes for the device_tracker.
Additional context
https://community.home-assistant.io/t/how-to-get-to-or-template-last-seen-on-person-or-companion-app-sensors/242988
and
https://github.com/pnbruckner/ha-composite-tracker#time-zone-examples
further info:
though the sensor geocoded_location has the Time Zone attribute:
we cant use the utc_offset filter on it like in the offset template above like:
because of the type error:
so an time_zone aware attribute last_seen would be very much appreciated.
thanks for considering
Beta Was this translation helpful? Give feedback.
All reactions