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?