Bond Fan Controller

I am not capturing the state of the light. Bond uses their own cloud MQTT server to track the light state, and it breaks if someone uses the remote manually, so I’m pretty sure it would be worthless locally too.

Here is how I control my master bedroom fan with shell commands:

# Master Bedroom Fan Controls

mst_fan_light_toggle: 'curl -H "BOND-Token: xxxxxxxxxxxxxxxx" -i http://x.x.x.x/v2/devices/fan_id/commands/command_id/tx -X PUT -d {}'

mst_fan_spd_1: 'curl -H "BOND-Token: xxxxxxxxxxxxxxxx" -i http://x.x.x.x/v2/devices/fan_id/commands/command_id/tx -X PUT -d {}'

mst_fan_spd_2: 'curl -H "BOND-Token: xxxxxxxxxxxxxxxx" -i http://x.x.x.x/v2/devices/fan_id/commands/command_id/tx -X PUT -d {}'

mst_fan_spd_3: 'curl -H "BOND-Token: xxxxxxxxxxxxxxxx" -i http://x.x.x.x/v2/devices/fan_id/commands/command_id/tx -X PUT -d {}'

mst_fan_pwr: 'curl -H "BOND-Token: xxxxxxxxxxxxxxxx" -i http://x.x.x.x/v2/devices/fan_id/commands/command_id/tx -X PUT -d {}'

You will need to replace the token, fan_id, and command_id with the items in your Bond API

1 Like

It is open to the public now

1 Like

Now I just need somebody to dumb it down for HA integration and I’ll be all set.

Awesome, thanks! I’ve got it working using some basic shell commands like mentioned above, along with a bunch if input_booleans and input_selects to create a template_switch, a switch_light, and a template_fan. It’s working, but is messy as hell.

Unfortunately the API doesn’t have the action or state functionality currently and the commands interface feels very clunky. I think any HA integration should wait until those exist.

Can you share the yaml you used to accomplish this?

Alright, I spent some time creating a much better, more robust, and entirely functional implementation that’ll work until the API leaves beta and a proper integration can be created.

I call it “Hacky Bond Integration”! It’s fairly long, so I put it up here:
https://pastebin.com/wHewNTtX

Some additional notes with further tinkering:

  1. I already had a “switch” key in my config closer to the top like:

    switch: !include_dir_merge_list switches
    

    … and including another “switch” key was causing none of my other switches to be configured correctly. I just moved the switches for bond into a bond.yaml file in my switches directory. Seems this is true for most of the components, so you’ll likely need to break the yaml up depending on how your config file is set up.

  2. I went ahead and created switches to toggle the fan on/off as well so that way I could control it via emulated_hue and homekit without needing to deal with homekit’s weird speed rules. I mostly just wanted the ability to toggle the fan on and off. Once the fan switch is in homekit you can set it as a fan and it has a fancy little animation.

4 Likes

So I have a BB serial Bond and I was very interested in doing this with mine. Unfortunately, all the Bonds that don’t have a ZZ serial number are still on version 1. I talked to Bonds customer service and they did tell me they’ll be upgrading all the remaining Bonds to V2 sometime this year which should give the rest of us access to the API. So fingers crossed. This would be the last integration I would need to have so I don’t have to go through IFTTT to access Bond through HA.

@MisterWil I could use a hand getting “Hacky Bond Integration” up and running. I was able to get all my API calls all tested and added to my shell_command.yaml file. When I try to execute them via the services panel I get nothing. I have the same strings added to the .bashrc file of my WSL debian instance as aliases and they fire every time. Is there a better way to test them?

Also I am having a problem wrapping my head around the scripts…

Thanks

Do you get any errors when you execute the shell command from the services panel? You might have better luck converting them to rest commands like this (untested):

rest_command:
  master_fan_light_toggle:
    url: http://192.168.86.107/v2/devices/DEVICEID/commands/COMMANDID/tx
    method: PUT
    headers:
      BOND_Token: xxxxxxxxxxxxxxxx
    payload: '{}'

@MisterWil, I never even considered that! I tested the Restful approach using PostMan and that work alright. I am writing the config updates now, I will let you know how it goes…

Thanks!
UPDATE:
I got all the shell_commands converted to rest_commands and they work great!

example:

  office_fan_light_toggle:
    method: PUT
    url: http://<BOND_ip_address>/v2/devices/<DEVICEID>/commands/<COMMANDID>/tx
    headers:
      content_type: 'application/json'
      'BOND-Token': !secret BOND_Token
    payload: '{}'

I was able to take the rest of your scripting and fully deploy my two fans! Thanks for the help!!

3 Likes

Awesome, I’m glad that’s working well! I haven’t had any issues with curl shell commands, and had I thought of it from the start I’d probably have used REST commands anyways.

@MisterWil I have all of the command strings added to my alias list in Linux and I have noticed that the Rest commands might actually be a little faster on the wire. Either way I am looking forward to being able to read state from the BOND. This is if the BOND can collect state from the fans… :slight_smile:Thanks for your help!!

Unfortunately, last I read, BOND will only keep track of state in the same way as my hacky integration does. That is, if anyone changes the fan with the fan’s real remote, or if the fan gets powered off at the switch and BOND is sending commands, then it’ll become out-of-sync with the actual state.

In any case, I’m looking forward to BOND finishing up their work so an actual HA integration can be developed.

Honestly, I am good with it. I changed the speed on a fan out of sync and I was back where I needed to be.

How many fans does everyone have? And what is the distance to be able to control those fans? Will it cover and entire house? I have 6 ceiling fans. The specs say 6 fans and 2500sq ft… I am curious about real world experience

1800 sqft house with 6 fans and I don’t have any problems with the Bond way over in 1 corner of the house.

1 Like

@MisterWil just wanted to drop in and say thanks for your efforts on this. I managed to integrate all 5 of my fans using your scripts as a base. Works perfectly!

2 Likes

Any other options to control ceiling fats than BOND? they can not be the only player on this spectrum. Just wonder if there is an alternative that can be intergraded into HA.

Lots of options depending on your fan interface. If its infra-red, an IR blaster either directly connected to your HA or built into an off the shelf interface such as Broadlink or Harmony Hub. If its radio frequency, then again an RF blaster directly connected or a shelf interface such as Broadlink (does RF, but make sure you check the frequency of your fan is within the range of Broadlink).

I went for the Bond as it seemed to be the only off the shelf unit that can do 304mhz RF.

RF controlled.
Fan: F603-BN Como ceiling fan witch uses the WCS212 (RF remote info) wall controller.
Not sure what frequency the fans operate on. My home is not big, so it should be in range - so you think the Broadlink will work with my fans? How many IR devices does the broad link support?

I also have a fireplace remote that’s RF (fireplace remote) that I have confirmed with bond support will not work with their system.