I wrote some code to allow me to setup prioritized events to control my devices. For example, when the sun sets turn on the lights with a priority of 50. Another rule says to turn off the lights after midnight with a priority of 60. Yet another says when I enter a geofence to turn the lights on if the sun has set and set that to a priority of 70. For each device, it determines which rule has is valid and has the highest priority then takes that action. Seems to be working fairly well and I found an iphone app that supports triggering URLs based on geofencing.
I think this forum is dead (no one has ever replied to any of my posts), but I'm happy to share the code if someone wants it. Written in c# as well.