Any way to test zone automations easily?

I’m trying to learn how to set up automations using zones. I have a push notification being sent to my phone as the action.

Without getting in the car and driving all over in and out of zones to test the triggers, is there some way I can do that without driving all over?

You might try to use the device_tracker.see service as documented at the end of this page

Use it from the services section in the developer tools.

If you go to developer tools, under the states tab, you can put in the entities you’re tracking (persons or tracking devices) and set the state to whatever you want to test. (This does not set the actual device. It just sets how HA sees it.)
Using this, I was able to test a number of zone-related interactions without leaving my desk chair.

2 Likes

Perfect. Exactly what I was looking for. I’ll check that out, thank you!

From the above comments I don’t think it’s clear how to test the triggering of an automation like this:

alias: Send notification when leaving home
description: ''
trigger:
  - platform: zone
    entity_id: person.christian
    zone: zone.home
    event: leave
action:
  - service: notify.mobile_app_christians_phone
    data:
      message: Christian left home
mode: single

Setting the state to “away” for person.christian doesn’t work for me. What would work?

It will be one of the device trackers attached to the person that you want to manipulate, you can’t just change the state of the person entity. You need to use the service device_tracker.see to manually change the GPS coordinates of the device tracker to make Home Assistant register a change of location.