In this example, we'll update a variable value based on location (geolocation). For this to work, you'll need:
- the Reflector name of your Indigo Server -- MyReflectorName
- a valid API key -- looks something like "c2xr7q35-9385-10f9-3652-12z765j99vnv" (this one's fake)
- the full url to your Indigo Reflector -- https://MyReflectorName.indigodomo.net/v2/api/command/?api_key=c2xr7q35-9385-10f9-3652-12z765j99vnv (Note: you must use HTTPS with the Indigo Reflector Service.)
- an HTTP API command message payload -- {"message": "indigo.variable.updateValue","objectId": 12345678,"parameters": {"value": "false",}}
- the Home Remote App installed on your iPhone.
Open the Home Remote app and select [Tap to Add Action...] at the top.
Enter an Action Name in the top field and then select [URL] (do not select Indigo as Home Remote's Indigo integration only works with the RESTful API, not the new HTTP API).
Enter the full URL above into the URL field and then select the [POST/PUT] button.
Select [POST] (not PUT) and [JSON] (not TEXT or NAME:PASS) and enter the appropriate payload JSON into Data field. Our example payload is going to update an Indigo Variable ("indigo.variable.updateValue") with the ID of 12345678, and the variable's new value: "false". IMPORTANT: Indigo variables are always stored as strings (text) so you must send a string value (enclosed in double-quotes). All other value types will be rejected. It's also important to note that JSON does not allow single quotes except as part of a string, and those must be "escaped" like this: "Indigo\'s variables are always strings."
When you're done, press the [Add to Action] button.
That will bring you back to this screen:
Make sure "Repeat Interval in Seconds" and "Double Tap - Security" are set to your liking; it's recommended to leave these as default at first. Then select [Add Action]. The action will now be set to your Home Remote action list.
Tap on the action you just created, and you can select the pencil icon to edit your action, or select the [GPS] icon to continue. Select [Geofence] and complete the following steps to set the Geofence to your liking.
You should now have a Home Remote action that fires any time your phone leaves or enters the Geofence. In our example "false" means the iPhone is not inside the Geofence. Repeat the process to set another action to revert the value to "true" when the phone returns. Of course, the two fences can be different--in case you want things to happen at different distances.
For more information on using the HTTP API, see the documentation.