Well you might consider using Geohopper. You can create a Geo Fence around your house, and when you LEAVE, as a condition, it can check to see if you've hid the "D" key(or check to see if some of the actions hitting the "D" key causes has occurred", and if they have, do nothing, and if they haven't, execute the group.
When I depart, I do my own version of your "D" key, and part of the action is to arm the security system to the AWAY mode. When my phone crosses the Geofence(usually just a few blocks from home), if the alarm is in AWAY mode, nothing happens... and if it is NOT in the AWAY mode, the same Action Group executes as if I were home pushing my "D" button.
You can also use GeoFence to trigger stuff as you Arrive home. In my case, about a block away, A/C on Lights On, Ceiling Fans On... Alarm Off.....ect...