Automatically disarming when device is in home zone

Hey all,

I’m extremely new to Home Assistant and please bare with me as I’m still learning. I researched this online, but can’t get an immediate answer.

In a nutshell, I set up OwnTracks and MQTT to integrate with my iPhone. With the appropriate settings, Home Assistant knows when my device is at home or away. What I’m trying to accomplish is to get my alarm.com panel to disarm when I’m close to my house. I know there is a forum to where there is an alarm.com issue. But that is unaffected by me under OSX. I can arm and disarm to my content.

Here is what I configured within my configuration.yaml

automation:
  trigger:
    platform: state
    entity_id: device_tracker.myphone_deviceiphone
    # trigger for determining when at home
    from: 'not_home'
    to: 'home'

  action:
    service: alarm_control_panel.alarm_disarm
    data:
      entity_id: alarm_control_panel.ha_alarm

I renamed the config to “myphone” just for security purposes. With this config, my system does not disarm. If I look at the Logbook within the UI, here is what I see:

1:33 PM "Myphone is Away"
2:21 PM "Myphone is at home"
2:21 PM "Automation, 0 has been triggered"

If I’m understanding correctly, the problem is with the trigger? I’m guessing that maybe the problem is with “not_home”. If I look at the history, maybe this should be “not home” since that is what’s displayed in history. I was simply following an example. Also, is there a way that I can run my action somewhere in Homeassistant, just to make sure that’s correct.

I know some of you may caution me about disarming with geolocation. This is just a proof of concept. In addition, I’m doing extensive auditing by using a separate alarm.com account for all these actions. I appreciate any input you may have on where I went wrong with this rule.

Found out the issue here. My automation rule was set up correctly. The issue is that the alarm.com plugin does not sync with whatever the status is at alarm.com. So when I armed with my HomeKit and Vera or the alarm.com app, it would still show as disarmed in home assistant. Because the system is already disarmed, a signal doesn’t get set to the panel. I’ll research a way of triggering an armed status when I arm outside of HA. If I can do a URL call, that would be great as I use an email trigger from alarm.com to trigger away in my Vera.

One thing I noticed is that if I press disarm in alarm.com or run my disarm scene within HomeKit, a disarm command is set to the panel even if the system is automatically disarmed,