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 ) (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?
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?
Robert are you an iOS user? For Android users Garmin app has problems with using http:// addresses - it only allows the https:// version.
Did you organize a certificate for your Openhab somehow?
Email and password via basic authentication should do the trick.
Which app do you use on the Garmin side?
I tried APICall and MyHomeControl. The latter looks better, but the former is better documented and supported. I was able to get the myopenhab.org link working with APICall, but not with MyHomeControl, it was not clear there how to setup basic authentication.
Robert,
Set this up on my edge 840 using apicall, worked great.
Just wanted to give you a shout-out for documenting this so well on your blog, well done and thank you.