Home Assistant/Local API Integration Questions

I’ve integrated my Bond Bridge with Home Assistant. However, I’m currently not impressed with the limited amount of control that I have by default.

My fans have a single button for the light. If you press it quickly, it turns the lights on and off. If you hold down the button, it starts dimming. My fan doesn’t have separate buttons to increase and decrease brightness, and it’s a dumb fan that has no idea what the current brightness level is (there is no screen on the remote).

In the Bond app, I can press a button to start dimming, and press again to stop. So, the Bond device supports a command to start dimming and a separate command to stop dimming.

When I’m in Home Assistant, I can’t see a way to initiate those same commands. How can I get this set up?

I see that there is a Bond Local API, and I think there is a way to send curl commands from Home Assistant and assign those to buttons if I do some research. I also see that there are actions such as StartDimmer(): and Stop(), so it appears that the Local API has a way to do this.

So, I’m wondering - am I on the right track? Is this the only way I might be able to do it or is there an easier way? Or is this completely impossible?

Quick update. I was able to figure out enough with using curl commands to get some control over my device, but I’ve hit a snag.

This is the exact command I’m sending from my Home Assistant terminal:

curl -H "Bond-Token: (token)" -i http://192.168.x.x/v2/devices/(deviceid)/actions/StartDimmer -X PUT -d "{\"argument\": 3}"

When I use that command, I get a HTTP/1.1 200 OK response, but nothing happens (my light doesn’t start changing brightness).

If I use that exact same curl command but switch StartDimmer for ToggleLight, my light will turn on or off.

Can anyone help with this? I’m wondering if the StartDimmer action isn’t expecting the 3 at the end?

@merck @bdraco You two seem to know your stuff when it comes to integration with Home Assistant, I’m hoping one of you might know what I’m doing wrong?

Within minutes of posting this, @Jpfamily was able to help me get the answer.

The appropriate curl command is:

curl -H "Bond-Token: (token)" -i http://192.168.x.x/v2/devices/(deviceid)/actions/StartDimmer -X PUT -d "{}"

I wanted to post this so that anyone else trying to find this answer later will be able to. If you have a fan with a single button to turn the light on and off, as well as to dim the brightness, you can send this curl command from your Home Assistant terminal, and it will start to cycle the brightness up and down.

Before sending the curl command, replace (token) with your token from your Bond app. Set the IP address to the IP of your Bond bridge, and replace (deviceid) with the device ID that your fan has been assigned.

You can find out your device ID by going to the Bond Local API documentation and following the “Getting Started” steps. It will teach you how to send your first few curl commands including how to find out your device IDs. Also, I highly recommend using your router settings to set a static IP for your Bond Bridge before trying to do this integration.

Then you should be able to use a service in Home Assistant to send that command, and you can set a certain interval with an automation until it sends a Stop command (that’s what I plan to do).

This won’t be a perfect solution to get brightness to exactly where I want, but at least I’ll be able to get the brightness to change (somewhat unpredictably) via voice commands by integrating Home Assistant with Alexa. Slightly unpredictable voice control is still better than nothing!

Can you post the supported_actions from your diagnostics file? ex: "supported_actions": [ "BreezeOn", "TurnOff", "DecreaseSpeed", "SetSpeed", "TogglePower", "BreezeOff", "TurnOn", "SetTimer", "IncreaseSpeed", "SetBreeze" ]

Hi, thanks for replying. I actually got the solution with the help of @Jpfamily and replied with it here in case anyone else needs the solution. The problem is that I edited my reply too many times (adding instructions to help other people later) and the forum’s automatic spam filter has hidden my message until a staff member reviews it.

StartDimmer was among the supported actions for my fan, but I can certainly see why you wanted to confirm that first.

The solution ended up being to tweak the curl code to:

curl -H "Bond-Token: (token)" -i http://192.168.x.x/v2/devices/(deviceid)/actions/StartDimmer -X PUT -d "{}"

It looks like none of these are mapped in Home Assistant. It looks like we only have StartIncreasingBrightness and StartDecreasingBrightness buttons in Home Assistant

http://docs-local.appbond.com/#section/Features/Misc-including-dimmers

We need to add them here

Right, none of those other functions are mapped. Are you talking about how I can add that for my installation, or are you talking about updating Home Assistant to make these features native for everybody?

If that’s something I can do myself, I’m not sure how to get access to the components folder to edit button.py. I’ve read somewhere about making a custom component/changing the manifest file with a different revision number, but haven’t tried it personally and I’m not sure if there is more to it than that.

Initially, I figured I was going to call a service to send curl commands directly to the Bond bridge to accomplish what I wanted.

I only have 2 weeks of experience with Home Assistant, so I’m still trying to learn.

Interesting. I would have expected our firmware to give you a 400 error if it did not like that you provided an argument. Added to our backlog here to add new unit tests.

We need to add the missing mapping. PR here for 2022.8 release