Bond Fan Controller - Update state belief

I use Bond’s “trust tracked state” feature with a toggling-only light. It works great, most of the time. Every few days I have to go into the Bond app and hit the “fix tracked state” switch when things get out of sync.

I’d really like to be able to do this via Home Assistant. Primarily because I’m going to add a Lutron Pico remote (can’t use the RF remote if we’re tracking state) and want to program the “fix tracked state” command to one of the Pico buttons, so my wife stops asking me to fix it for her! For this I need Home Assistant to be able to send that command.

Here’s the API: Bond Local API (appbond.com)

I’m interested in working on this myself via PR, but as I’m new to both Home Assistant and Python, there is a learning curve.

I believe this should be a first-class feature in the integration, but this is working for me in the meantime. Only real downside is once you flip the state belief switch, it takes a few seconds for the light state to update in HA. Not sure if there’s any way to force a refresh. But it works.

# Bond tracked state belief switches
switch:
  - platform: template
    switches:
      office_fan_light_state_belief:
        friendly_name: "Office Fan Light State Belief"
        value_template: "{{ is_state('light.office_fan', 'on') }}"
        turn_on:
          service: shell_command.bond_set_state_belief
          data_template:
            bond_id: ZZDD35784
            bond_token: !secret bond_token
            device_id: 1312bb7c
            type: light
            value: 1
        turn_off:
          service: shell_command.bond_set_state_belief
          data_template:
            bond_id: ZZDD35784
            bond_token: !secret bond_token
            device_id: 1312bb7c
            type: light
            value: 0

shell_command:
  bond_set_state_belief: 'curl -H "BOND-Token: {{bond_token}}" -i http://{{bond_id}}.local/v2/devices/{{device_id}}/state -X PATCH -d "{\"{{type}}\": {{value}}}"'
1 Like

This would be a great addition to the Bond Integration. I am in a similar situation where the state gets out of sync on the bond periodically primarily due to someone using an RF Remote. It is not a big issue other than needing to go through the Bond App to fix it takes a more menus than desired. A simple toggle or button in HA to do it would be great. Jeremy’s script is great, (I have 9 devices controlled by the bond but the only change will be the device ID, so I can handle that via a parameter in an script call) but this would be so much simpler if a Service Data element was added for “fix_tracked_state” and defaulted to “false” that could be used for either toggle, turn_on, or turn_off to have the service call just update the state and not cause the command to be performed.

This is a good idea. Currently I just have all remotes disabled, as it was getting to be way too annoying for me. :joy: Might give this a shot soon!

I added a pull request to the API. Once that gets approved, I should be able to make the changes to the plugin to add that feature :slight_smile:

https://github.com/prystupa/bond-api/pull/11

1 Like

Pull request added

This should be going into the next release :slight_smile:

Thank you Josh! This is very exciting