# Home Assistant/Local API Integration Questions

**URL:** <https://forum.bondhome.io/t/home-assistant-local-api-integration-questions/3363>\
**Category:** Integrations\
**Created:** [July 4, 2022, 6:56pm UTC](https://forum.bondhome.io/t/home-assistant-local-api-integration-questions/3363 "2022-07-04T18:56:39Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Beau](https://avatars.discourse-cdn.com/v4/letter/b/94ad74/32.png) [@Beau](https://forum.bondhome.io/u/Beau)\
**Post date:** [July 4, 2022, 6:56pm UTC](https://forum.bondhome.io/t/home-assistant-local-api-integration-questions/3363/1 "2022-07-04T18:56:39Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Beau](https://avatars.discourse-cdn.com/v4/letter/b/94ad74/32.png) [@Beau](https://forum.bondhome.io/u/Beau)\
**Post date:** [July 6, 2022, 3:03am UTC](https://forum.bondhome.io/t/home-assistant-local-api-integration-questions/3363/2 "2022-07-06T03:03:20Z")

</div>

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:

```auto
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?

---

<div class="post-metadata">

**Author:** ![Beau](https://avatars.discourse-cdn.com/v4/letter/b/94ad74/32.png) [@Beau](https://forum.bondhome.io/u/Beau)\
**Post date:** [July 6, 2022, 3:11am UTC](https://forum.bondhome.io/t/home-assistant-local-api-integration-questions/3363/3 "2022-07-06T03:11:32Z")

</div>

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

The appropriate curl command is:

```auto
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!

---

<div class="post-metadata">

**Author:** ![bdraco](https://avatars.discourse-cdn.com/v4/letter/b/c6cbf5/32.png) [@bdraco](https://forum.bondhome.io/u/bdraco)\
**Post date:** [July 6, 2022, 4:18am UTC](https://forum.bondhome.io/t/home-assistant-local-api-integration-questions/3363/4 "2022-07-06T04:18:24Z")

</div>

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

 ![Screen Shot 2022-07-05 at 11.16.17 PM](https://us1.discourse-cdn.com/flex019/uploads/bond1/original/1X/8c53a2c224aa3e27c953d0647c3fda39b7a18b39.png)

---

<div class="post-metadata">

**Author:** ![Beau](https://avatars.discourse-cdn.com/v4/letter/b/94ad74/32.png) [@Beau](https://forum.bondhome.io/u/Beau)\
**Post date:** [July 6, 2022, 5:13am UTC](https://forum.bondhome.io/t/home-assistant-local-api-integration-questions/3363/5 "2022-07-06T05:13:08Z")

</div>

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:

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

```

---

<div class="post-metadata">

**Author:** ![bdraco](https://avatars.discourse-cdn.com/v4/letter/b/c6cbf5/32.png) [@bdraco](https://forum.bondhome.io/u/bdraco)\
**Post date:** [July 6, 2022, 6:07am UTC](https://forum.bondhome.io/t/home-assistant-local-api-integration-questions/3363/6 "2022-07-06T06:07:30Z")

</div>

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](http://docs-local.appbond.com/#section/Features/Misc-including-dimmers)

> <https://github.com/bondhome/bond-async/blob/99bac42b19cb613ea5269ed72c72965e644f8696/bond_async/action.py#L33>

> <https://github.com/bondhome/bond-async/blob/99bac42b19cb613ea5269ed72c72965e644f8696/bond_async/action.py#L40>

> <https://github.com/bondhome/bond-async/blob/99bac42b19cb613ea5269ed72c72965e644f8696/bond_async/action.py#L41>

We need to add them here

> <https://github.com/home-assistant/core/blob/148035c8ca8c6d706ec2ddcc9a52475b086ccb0d/homeassistant/components/bond/button.py#L105>

---

<div class="post-metadata">

**Author:** ![Beau](https://avatars.discourse-cdn.com/v4/letter/b/94ad74/32.png) [@Beau](https://forum.bondhome.io/u/Beau)\
**Post date:** [July 6, 2022, 6:45am UTC](https://forum.bondhome.io/t/home-assistant-local-api-integration-questions/3363/7 "2022-07-06T06:45:03Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![merck](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.bondhome.io/merck/32/1238_2.png) [@merck](https://forum.bondhome.io/u/merck)\
**Post date:** [July 6, 2022, 1:46pm UTC](https://forum.bondhome.io/t/home-assistant-local-api-integration-questions/3363/8 "2022-07-06T13:46:56Z")

</div>

> [@Beau](#):
>
> The solution ended up being to tweak the curl code [to set the body to empty object].

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.

---

<div class="post-metadata">

**Author:** ![bdraco](https://avatars.discourse-cdn.com/v4/letter/b/c6cbf5/32.png) [@bdraco](https://forum.bondhome.io/u/bdraco)\
**Post date:** [July 7, 2022, 12:32am UTC](https://forum.bondhome.io/t/home-assistant-local-api-integration-questions/3363/9 "2022-07-07T00:32:03Z")

</div>

> [@Beau](#):
>
> 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?

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

> <https://github.com/home-assistant/core/pull/74555>
>
> \## Proposed change
> \<!--
> Describe the big picture of your changes here to com…municate to the
> maintainers why we should accept this pull request. If it fixes a bug
> or resolves a feature request, be sure to link to that issue in the
> additional information section.
> \--\>
> We only had mappings for the up and down lights,
> not the primary light
> 
> \## Type of change
> \<!--
> What type of change does your PR introduce to Home Assistant?
> NOTE: Please, check only 1! box!
> If your PR requires multiple boxes to be checked, you'll most likely need to
> split it into multiple PRs. This makes things easier and faster to code review.
> \--\>
> 
> \- \[\] Dependency upgrade
> \- \[\] Bugfix (non-breaking change which fixes an issue)
> \- \[\] New integration (thank you!)
> \- \[\] New feature (which adds functionality to an existing integration)
> \- \[\] Breaking change (fix/feature causing existing functionality to break)
> \- \[\] Code quality improvements to existing code or addition of tests
> 
> \## Additional information
> \<!--
> Details are important, and help maintainers processing your PR.
> Please be sure to fill out additional details, if applicable.
> \--\>
> 
> \- This PR fixes or closes issue: fixes #
> \- This PR is related to issue: 
> \- Link to documentation pull request: 
> 
> \## Checklist
> \<!--
> Put an \`x\` in the boxes that apply. You can also fill these out after
> creating the PR. If you're unsure about any of them, don't hesitate to ask.
> We're here to help! This is simply a reminder of what we are going to look
> for before merging your code.
> \--\>
> 
> \- \[\] The code change is tested and works locally.
> \- \[\] Local tests pass. \*\*Your PR cannot be merged unless tests pass\*\*
> \- \[\] There is no commented out code in this PR.
> \- \[\] I have followed the \[development checklist\]\[dev-checklist\]
> \- \[\] The code has been formatted using Black (\`black --fast homeassistant tests\`)
> \- \[x\] Tests have been added to verify that the new code works.
> 
> If user exposed functionality or configuration variables are added/changed:
> 
> \- \[\] Documentation added/updated for \[www.home-assistant.io\]\[docs-repository\]
> 
> If the code communicates with devices, web services, or third-party tools:
> 
> \- \[\] The \[manifest file\]\[manifest-docs\] has all fields filled out correctly.  
> Updated and included derived files by running: \`python3 -m script.hassfest\`.
> \- \[\] New or updated dependencies have been added to \`requirements\_all.txt\`.  
> Updated by running \`python3 -m script.gen\_requirements\_all\`.
> \- \[\] For the updated dependencies - a link to the changelog, or at minimum a diff between library versions is added to the PR description.
> \- \[\] Untested files have been added to \`.coveragerc\`.
> 
> The integration reached or maintains the following \[Integration Quality Scale\]\[quality-scale\]:
> \<!--
> The Integration Quality Scale scores an integration on the code quality
> and user experience. Each level of the quality scale consists of a list
> of requirements. We highly recommend getting your integration scored!
> \--\>
> 
> \- \[\] No score or internal
> \- \[\] 🥈 Silver
> \- \[\] 🥇 Gold
> \- \[\] 🏆 Platinum
> 
> \<!--
> This project is very active and we have a high turnover of pull requests.
> 
> Unfortunately, the number of incoming pull requests is higher than what our
> reviewers can review and merge so there is a long backlog of pull requests
> waiting for review. You can help here!
>   
> By reviewing another pull request, you will help raise the code quality of
> that pull request and the final review will be faster. This way the general
> pace of pull request reviews will go up and your wait time will go down.
>   
> When picking a pull request to review, try to choose one that hasn't yet
> been reviewed.
> 
> Thanks for helping out!
> \--\>
> 
> To help with the load of incoming pull requests:
> 
> \- \[\] I have reviewed two other \[open pull requests\]\[prs\] in this repository.
> 
> \[prs\]: https://github.com/home-assistant/core/pulls?q=is%3Aopen+is%3Apr+-author%3A%40me+-draft%3Atrue+-label%3Awaiting-for-upstream+sort%3Acreated-desc+review%3Anone+-status%3Afailure
> 
> \<!--
> Thank you for contributing \<3
> 
> Below, some useful links you could explore:
> \--\>
> \[dev-checklist\]: https://developers.home-assistant.io/docs/en/development\_checklist.html
> \[manifest-docs\]: https://developers.home-assistant.io/docs/en/creating\_integration\_manifest.html
> \[quality-scale\]: https://developers.home-assistant.io/docs/en/next/integration\_quality\_scale\_index.html
> \[docs-repository\]: https://github.com/home-assistant/home-assistant.io
