Arrive at home + driving automation

What am I missing?

It just doesn’t work. I tried using the front end automation using a condition of driving = true for Life360. However that never worked and from looking at the trace it appeared it was because the driving attribute of true was a Boolean while anything you could put into conditions statement always turned true into a string, and I figured true ≠ ‘true’.

So I switched it to a template looking at the life 360 attributes, but that isn’t working either. And I know it’s because of the driving clause. I don’t want to take it away though because if I’m not driving and let’s say just walking my dog or going for a jog when I arrive home I don’t want my back gate opening. I only want that opening when I’m in my car and come home.
Thanks I’m advance for anyone who helps me here. I’m sure it’s something minor.

Alias: Arrive at home
description: When Kyle arrives --> open gate and if at night —>turn on backyard
trigger:
  - platform: zone
    entity_id: person.kyle
    zone: zone.home
    event: enter
condition:
  - condition: template
    value_template: '{{ state_attr("device_tracker.life360_kyle_williams", "driving") == true}}'
action:
  - device_id: 204914c98ea2f27d4fe99aa08fca4251
    domain: cover
    entity_id: cover.williams_gate
    type: open
mode: single

https://community.home-assistant.io/t/how-to-help-us-help-you-or-how-to-ask-a-good-question/114371#oneone-format-it-properly

Thanks I think I figured that part out

Looking at it again now I still think it’s changing my logic which I’m looking for Boolean driving=true to a ‘true’ string. I can’t for the life of me figure out how to fix that.

Can’t see anything “obvious” why it shouldn’t work, sorry. :slight_smile:

But maybe it helps you, to try your value_template in the developer tools. It will give you the type, to see if it is boolean or a string. Just paste the value_template and on the right you should see the type. :slight_smile:

Btw. I wouldn’t do it that “simple”. What if you’re only driving by your house? Do you want the gate to open then? I would at least set something up, where you cross some kind of sensor with your car, eg. if you drive to the gate, there is a motion sensor, that is used as a trigger, and then the condition comes into play. I wouldn’t rely only a zone trigger. But that’s just me, what do I know, I don’t even have a front gate :rofl: :rofl:

Yea that’s a good point. I don’t just drive by my home too often ( actually in the 2.5 years here I can’t say I ever have done that) but it’s a good point. I’ll get an outdoor motion sensor soon and add that into the mix. Thanks for the tip.