Garmin MyHomeControl & myopenhab.org

Hi,

I’d like to use the Garmin MyHomeControl app to call OH REST APIs via myopenhab.org. Has anyone done this before? My requests work fine via Postman, but I cannot figure out how to set it up in MyHomeControl.

According to the MyHomeControl documentation, the URL can be defined like this:

Type/copy/paste the URL to trigger a device action (without http:// or https://, don’t use them because you’ll get an error :slight_smile: ) (e.g. 192.168.2.1/sw/23_and_command=on). You can add (optional) a json body as parameter of the url as well. (e.g. 192.168.2.1/sw/23_and_command=on?jspost={value1:morning,value2:11.00}). You can use jspost, jsget, jsdel and jsput as methods. Type “and” or “perc” or “space” or “po” or “pc” instead or “&” or “%” or " " or “{” or “}” in the url to prevent saving problems in Garmin Connect. The “xxx” symbols will be translated before executing the command.

But for openHAB I need a raw text body with the command, not sure how to achieve that with the name value pairs shown in the documentation above. Also I am not sure how to get the basic authentication to work with this syntax.

Has anyone here used MyHomeControl to call openHAB REST APIs? Or has an idea how this jspost method works beyond the simple example in the cited documentation?

All I know about accessing myopenhab over REST is this. I don’t think it’s what you’re asking, but posting in case it helps.

Thanks! The REST API call to myopenhab.org works fine from Postman, but I do not know how to build the same request from the Garmin app MyHomeControl.

The app documentation refers to a jspost method bit has no concrete examples and I could not find any further documentation on it.

I have been now looking at another Garmin app called APICall. Same idea, but better documentation. Unfortunately it states that Garmin generally only supports body content “application/json” or “application/x-www-form-urlencoded”, while openHAB expects the command in a “text/plain” body.

Is there a way to send the command as either “application/json” or “application/x-www-form-urlencoded” to openHAB?

I’ve no idea, but would guess that the answer is no.

EDIT: Just saw your post in another topic where Rich confirmed this. Hope you can find a solution!

1 Like

Yes, with the HTTP Webhook binding I could get Garmin to work with openHAB.