Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add "last seen" sensor for tracked devices with timestamp #202

Open
sdholden28 opened this issue May 21, 2024 · 4 comments
Open

Add "last seen" sensor for tracked devices with timestamp #202

sdholden28 opened this issue May 21, 2024 · 4 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@sdholden28
Copy link

Describe the solution you'd like
I'd like a "last seen" sensor for each tracked device. This sensor would have the last contacted proxy and a timestamp. This would be useful in a "find my device" approach to get an idea of where the item was last known to be and when.

Describe alternatives you've considered
I could create this with a triggered template sensor for each tracked device, but it would be nicer if this was an available entity from the integration so it would show up on the device pages and could be enabled/disabled for each device as desired.

@agittins agittins self-assigned this May 22, 2024
@agittins agittins added the enhancement New feature or request label May 22, 2024
@agittins
Copy link
Owner

I'm for this, just need to let it bubble away in my brain a bit to find the implementation I want to go with.

Are you often trying to find things that were left somewhere and then powered off? For me I'm usually looking for things that are still transmitting (so the current sensors work for me 98% of the time) and otherwise I'd click the sensor and look at the history - but if you have a use-case where things are no longer transmitting then I can see the benefit in having a dedicated sensor for it.

I think if I create the sensor as disabled-by-default then it has no impact on folks who don't need it, so that might be way to go (which does mean it only helps if one has already enabled it before needing it!)

@sdholden28
Copy link
Author

Dead battery is the primary use case for me. Left phone in a room, battery died, can't locate it now, etc. Watch, rechargeable wallet tracker, etc are use cases where knowing the "last ping" before the battery died would be helpful, to me. I agree with the "disabled-by-default" approach.

@agittins
Copy link
Owner

Cool, yeah that sounds good. I should be able to get it into the next release, just not sure how soon that will be. Not too long, I hope :-) I'll give you a heads-up once I have it in main as well.

@mogorman
Copy link

i did this with a template

{% if state_attr('sensor.lina_area', 'area_name') == None or is_state_attr('sensor.lina_area', 'area_name', 'unknown') or is_state_attr('sensor.lina_area', 'area_name', 'unavailable')  -%}
{{ states('sensor.lina_filtered') }}
{%- else %}
{{ state_attr('sensor.lina_area', 'area_name')  }}
{%- endif %}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants