Hi,
until now I was using proximity entity to determine a distance to home for current device. I had proximity.home which showed the distance for the current device. How can I do the same now that proximity entity is removed in 2024.9?
Hi,
until now I was using proximity entity to determine a distance to home for current device. I had proximity.home which showed the distance for the current device. How can I do the same now that proximity entity is removed in 2024.9?
The proximity integration now creates a distance sensor: https://www.home-assistant.io/integrations/proximity/#distance
Yes I understand that, but I need to create the sensor for each device I want to track, so the sensor is not universal. Until now, when I checked proximity.home, I got the distance to home for whatever device I was currently on. It would show 0 on my home desktop computer and 100 for my mobile if I was 100km from home, without the need to specify which device I want to track. I’m not sure if I am explaining it clearly.
Ok, actually I can track person, which would help me in this case… So I create a sensor for myself and then on whichever device I access it, it will show me my distance. Not 100% the same thing, but works in this regard.
But no, this won’t work… I want an universal sensor so that I don’t have to use one sensor for myself and another for my wife for example.
So the original question is still valid. This is not a solution.
What you you mean by “current device”?
Ok, let’s make it simple.
I have a dashboard, there is a “Distance from home” which shows distance from home.
When I access it, it shows my distance from home, when my wife accesses it, it shows her distance from home. This is what proximity.home did for me until now. Is there any way how to do this now?
Is there really nobody with the same usecase that I have? I don’t believe…
Proximity works for me as usual, can’t see any difference.
And for your ‘current’ device.distance, the frontend GUI would need to know which is the current device🤔
So it sounds to me your issue is with the frontend (lovelace card?), and not with the integration itself.
PS: the proximity integration works on rhe home-assistant hardware keeping track of the distance of each tracked device. So you need a way to tell the frontend (opened on your ‘current’ device to show a specific device only).
What did you use to show the distance to hone?
Maybe an idea to use a history graph with all tracked devices?
I understand and you might be right it’s a lovelace thing, but I have used states[“proximity.home”].state to determine the distance of the device from home and it has worked (and still works as I did not upgrade due to this issue) for me.
It’s not much about the ‘current’ device, but it somehow gets the GPS location from the sensors and calculates the distance to home. I’m also not sure how it works under the hood and if it’s lovelace or the integration that does it. However, this always shows correct distance no matter what device it is opened on.
You could use a button to trigger an automation.
Then your user_id would be available:
{% set user_id = context.user_id %}
and this user_id you can use to update the value of the distance from home by using the users proximity
This all sounds like a workaround :-/ Why can’t it work like it has flawlesly worked until the proximity has been deprecated… hmm
I will have to think about what you suggested as it’s not as straightforward as the old approach.
I didn’t even know there was such a thing as distance.home…