Home Remote Using New HTTP API

Posted on
Fri Mar 24, 2023 12:17 pm
DaveL17 offline
User avatar
Posts: 6741
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Home Remote Using New HTTP API

It is possible to use the new HTTP API with the iOS Home Remote app (available through the Apple App Store as of 2023-03-24). Note: The example below refers to using an Indigo API Key. It's a good idea to generate one to use specifically with the Home Remote app, which will allow you to essentially turn off the app's if your key gets compromised but without affecting other integrations you use.

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.

IMG_5607.PNG
IMG_5607.PNG (417.41 KiB) Viewed 808 times


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).

IMG_5612.PNG
IMG_5612.PNG (425.26 KiB) Viewed 808 times


Enter the full URL above into the URL field and then select the [POST/PUT] button.

IMG_5614.PNG
IMG_5614.PNG (424.47 KiB) Viewed 800 times


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.

IMG_5616.PNG
IMG_5616.PNG (424.24 KiB) Viewed 800 times


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.

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 2 guests