Toggling Helper With Automation

Hi, new to all this and trying to learn. I have a helper set which I want to toggle whether I am at home or out. I will trigger it via a number of methods, but am just trying a few proof of concepts to get an understanding on how to use it properly. But I am getting the following error:

I just created a simple automation that when I leave my home zone, to toggle my helper off.
I got this error: Message malformed: required key not provided @ data[‘zone’]

I used the visual editor to do this:
Trigger: iphone leaves a zone

Condition: Zone Condition:
Entity with location: person: [myname]
Zone: Zone: Home

Actions: Service Call
Call A Service: Input Boolean: Turn Off
Target: Helper [My Name]

This is the resulting Yaml code:

description: ""
mode: single
trigger:
  - platform: device
    device_id: 8xxxxxxxxxxxxxb
    domain: device_tracker
    entity_id: device_tracker.xxxxxxxx_iphone
    type: leaves
condition:
  - condition: zone
    entity_id: person.xxxxxxxx
    zone: zone.home
action:
  - service: input_boolean.turn_off
    data: {}
    target:
      entity_id: input_boolean.jon_out
alias: xxxxxx Status

You are missing the zone variable in your trigger.

However, even with that added, this automation will never execute it’s actions because it requires that you both leave a zone and be in that zone… an impossibility. Remove the condition, and add the zone variable to the trigger as follows:

description: ""
mode: single
trigger:
  - platform: device
    device_id: 8xxxxxxxxxxxxxb
    domain: device_tracker
    entity_id: device_tracker.xxxxxxxx_iphone
    type: leaves
    zone: zone.home
condition: []
action:
  - service: input_boolean.turn_off
    data: {}
    target:
      entity_id: input_boolean.jon_out
alias: xxxxxx Status

While an input boolean may be necessary in some cases, there are much more functional methods. So, before you get too far down this path, make sure to read the Person entity docs and Getting Started with Presence Detection. By assigning one or more device trackers to your person entity you will be able to just reference the person in you automations instead of having to create additional helpers.

Thanks for posting this. it’s a good workaround until they add home assistant support (did talk to them about it. no ETA given to me atleast)

Works like a charm!