#Dynamic zone definition

1 messages · Page 1 of 1 (latest)

cunning cove
#

I would like to setup a zone based on a sensor. But this will not parse.

zone:
  - name: CamperPosition
    latitude: "{{ states('sensor.DecLatitude') | float }}"
    longitude: "{{ states('sensor.DecLongitude') | float }}"
    radius: 50
gleaming fable
#

You can create a device tracker and use the distance template

cunning cove
#

Thanks. Interesting. I want to set up a trigger if a dynamically or user input set latitude longitude is more than a set distance away from home. Is that possible? In my camper I want to set an alert if the camper (home) has moved from where I left it. I am using homeassistant.set_location service to dynamically set the home location.

torpid marlinBOT
gleaming fable
#

You can use that to get the distance between any device tracker and any zone

cunning cove
#

Ahhhh. Thanks- I will have a look now.

#

Many thanks for your suggestions. Much appreciated! If I use the proximity integration I want the device tracker location to a fixed location set by a script. And it is the home location that will be moving. I want to be able to press a button to set the device tracker location. And then it will remain fixed until the next time I press the button. Is this possible?

gleaming fable
#

Proxmity is for device to zone

cunning cove
#

So I can use Proximity because the zone will be the home zone and the device will hopefully be a device location I have set via a script / button. Does this make sense?

gleaming fable
#

Yes

cunning cove
#

Hmmm. But I don´t think I can set a Proximity integration device location manually or via a script. It needs to be a device like a trackable phone with the companion app installed.

gleaming fable
#

Sure, but you can create a device tracker entity and update that on demand