dcmeglio / hubitat-bond

BOND Home Integration for Hubitat
32 stars 19 forks source link

feature request: support motorized shade Preset command #13

Open scelfo opened 3 years ago

scelfo commented 3 years ago

The Somfy motorized shades have a Preset command which Bond can send to mimic "MY" button on the Somfy remotes which will make the motorized shades move to a preset position.

This is a feature request to support sending the Preset command. There is a convention in the Hubitat and SmartThings communities to use a magic position value of 50 to do this. By mapping position value of 50 to the Preset command we can add preset control to Hubitat automation rules as well as via Alexa integration since windows shade devices seem to universally support a position level 0-100.

I have a patch that adds this support and I'll send you a pull request. I wanted to file the feature request first for tracking.

dcmeglio commented 3 years ago

Interesting. It was my understanding bond didn’t support the presets? Where’d you find docs on this command?

scelfo commented 3 years ago

I figured it must because the Bond iOS app supports sending the Preset command. I looked for something on http://docs-local.appbond.com/ but didn't find it. I ended up using curl to fetch the available commands from one of my window shades that I had already configured and sure enough a "Preset" command was visible in the list. I tried it and it worked!

scelfo commented 3 years ago

Here's the curl command and response:

$ curl -H "BOND-Token: " -i http:///v2/devices/376d9de4 HTTP/1.1 200 OK Content-Length: 272 Content-Type: application/json; charset=utf-8

{"name":"Door Right Shade","type":"MS","location":"Entry","template":"RMS12","actions":["Pair","Close","Hold","Preset","Open","Stop","ToggleOpen"],"":"7f16f6a6","commands":{"":"6920d683"},"state":{"":"d94e6124"},"properties":{"":"40385812"},"skeds":{"_":"66ea4a02"}}