Support for Bond hub

Here you go. This is the logs showing as I tried to adjust speeds from high to medium to low...

EDIT: I don't know specifically what value needs to get sent to the Bond Bridge from the app in Hubitat but my fan speeds in the Bond app show as - speed 1, speed 2, speed 3 (for low, medium high)....

The bodies should be {"argument": 1}, the same for 2, and so on. The documentation for SetSpeed is here. When in doubt, if the API documentation isn't clear (and do let us know if it isn't!), you can also examine the device's commands via the local API. For example, your device should have a command that has some metadata {"action": "SetSpeed", "argument": 1}, etc..

Also, for debugging purposes, I'd recommend printing out the body on Bad Requests. They contain a short error message.

Yup this is just a screw up on my part. 8 know what to do. Unfortunately my wife gave me the "you've been on the computer way too long face" so I'll work on the fix some time tomorrow. Thanks for testing it out!

2 Likes

Understood, no worries! Glad I could help this project along today. Making great progress!

@bond-jacob -- thanks also for your help today!

Think I fixed that piece. Let me know if it works.

Things I have not implemented (let me know if your fan supports any of this so I can have someone to test with)

  • up vs. down lights
  • dimmer
  • fan direction
  • breeze controls

And like I said, I still need to add support for detecting the number of fan speeds

I've also started toying with this driver/app and can help test. I only have a pair of fans to work with. Let me know if I can be of assistance.

I updated the code. Take a look at the attached logs. Still seeing errors and no actual change in fan speed (tried switching from high to medium to low). I think the argument that has to get passed is an integer (1, 2 or 3) instead of a string (“1”, “2” or “3”)...

I've tried manually posting the commands and many return an error_id of 61 - action not supported. The Bond does not appear to be responding to the listed actions.

The actions that appear to be working properly are: TurnOff, ToggleDirection, TurnLightOn, TurnLightOff, ToggleLight, SetDirection, StartDimmer

DecreaseSpeed doesn't throw any error, but doesn't do anything either.

@dman2306

So I've been spending some time perusing the code for your BOND Home Integration app. I didn't want to go too far down the rabbit hole but nevertheless wanted to see if I could try to figure out how to get the fan speed piece working. After some trial and error code tweaking I finally found success by changing the following:

  1. Changed all references (for code specific to fans only, no changes to fireplaces)
    from: device.sendEvent(name: "setSpeed", value:
    to: device.sendEvent(name: "speed", value:

  2. In the executeAction function with the argument parameter I changed the code
    from: body: '{"argument": "' + argument +'"}'
    to: body: '{"argument": ' + argument + '}'

Although this seems to work I'm not familiar enough with Groovy code or the Bond local API to be confident that these changes won't negatively impact other aspects of the app and associated Bond device drivers. I also don't know much about using GitHub either so didn't try doing a pull request, which is why I thought I'd share these details here.

you are right on both accounts. Glad you got it working! I made some modifications (including what you suggested) so this works and also added support for detecting how many fan speeds are supported.

Could you show me an example of a request body that you're POSTing? I could help debug.

Interesting, I'll look into this. Are you passing an argument in the body?

I'm glad I could contribute a little something to the coding side of this project!

One other issue I'm noticing is the specific scenario of selecting "off" as a fan speed. When doing so the switch value changes to "off" and the fan physically turns off but the "speed" value as shown under Current States on the device page doesn't also update to show as "off".

I think this behavior should be consistent with the other fan control devices in Hubitat (such as the Lutron Fan Control of which I have several).

However, I'm not quite sure where in the app code to make the necessary change for this...

Agreed, I just added this. I don't have any fans controlled by Hubitat... how does it normally work when you set the speed to on?

Sounds like a bond issue to me, have you tried posting on their forums?

@dman2306

Thanks, that fixed that issue!

As for what happens when you turn the fan back on after setting the fan speed to off, I think it should work like the Lutron Fan Control (the only other fan device type I'm familiar with in Hubitat).

If you look at the screenshot in my earlier post you can see for the Lutron Fan Control there is a State Variable called lastSpeed. So if the fan is turned off (whether by turning the switch value off or the fan speed value to off) whatever the previous fan speed happened to be is saved. Then if the switch is turned back on the lastSpeed value is used.

I'm not sure how this is accomplished behind the scenes in the device code for the Lutron Fan Control but from a consistency standpoint it would be nice if the Bond Fan devices could also have that same behavior....

I think I can do that, however, it would be the last speed set via hubitat meaning if you do it through Alexa talking to Bond, or even directly with the remote, I'd have no idea that you changed the "lastSpeed"

Huh, I hadn't even thought of the Alexa aspect of this or, for that matter, changing the speed of a fan device (such as a Lutron fan control) in HomeKit. Likely beyond the scope of this project! So I think whatever the last speed value is as set in Hubitat, if it can be saved and then used when the switch is turned back on that would be awesome.

PS. Don't get in trouble with the wife spending a lot of time on this stuff! All your efforts are much appreciated but there is absolutely no need to rush. Wife Approval always trumps Home Automation!

Haha, I'll give it one quick try. Download the new Bond Fan driver. I added a pauseExecution(500) in there between the turn on and setting the speed. I figured there might need to be a small delay to not send RF commands to the fan too quickly. I set it at 500ms as a starting point. I'm not even sure if it is needed, but you might want to try adjusting that number up/down if it doesn't work as expected. If that doesn't work I'll take look tomorrow evening.

Sounds good, I will take a look at this later on this evening. Wife Factor in force here as well. :grin: