Support for Bond hub

New version released that now supports generic devices. Thanks @poelock for testing this out!

2 Likes

Hi. I’ve been using this app for a few weeks and last night I used voice control to Alexa to set a fan to 50% speed , now I’m seeing the following log message every 30 seconds...

app:812020-01-18 07:16:00.374 am debugTranslating 2 to BOND

Any idea what’s causing this. Rebooting Hubitat doesn’t resolve. Thanks.

You have debug logging turned on. If you don’t want to see the debug messages in the log turn that setting off.

Thanks. Yea, I realize I have debug on, but oddly, this message just only started appearing yesterday, coinciding with voice control of the fan. I’m using the Bond Alexa skill directly and not going through HE for voice control. Rebooting Bond doesn’t stop the polling either.

The polling is intentional, it's the only way for HE to get the BOND status. Rebooting is not supposed to stop it. The app polls your BOND Hub every 30 seconds to get each connected devices' status just like you're seeing. This is the app working as expected.

Thanks... just wanted to be sure that this was normal behavior. Just found it odd that only just started happening.

Was it the first time you’ve set a fan speed since installing the app?

No. I had done it before. The fan is still on in the guest room (they’re late risers LOL!). I’ll see if the message goes away when the fan is turned off. Appreciate the follow up.

Voice control to turn off the fan stopped the logging messages.

This is intentional. As soon as there’s any commands added with a Brightness-related action, the whole Brightness feature becomes available.

The intention is that a 3rd party client need only be concerned about supporting Brightness and need not be concerned with all the corner cases and different types of control protocols that exist.

The idea is, when you call the SetBrightness (75) Action with current brightness at 25%, Bond Bridge would send twice the IncreaseBrightness(25) Command that is available.

Similarly with TurnOn and ToggleLight — the best place to dead-reckon is on the Bridge. This support we will be improving in coming months.

I posted this on a different thread, but though I would cross post in case someone else is trying to get this to work as well.

I have a smart by bond fan controller:
https://www.homedepot.com/p/Universal-Smart-Wi-Fi-4-Speed-Ceiling-Fan-Remote-Works-with-Google-Assistant-SmartThings-and-Alexa-99434/311264804

and have it working with dman2306's bond integration.

I have it working by simply using the token and IP of the smart fan controller, but there seems to be a problem with getting the device ID: here is device list from curl output:

curl -H "BOND-Token: [mytoken]" -i http://[myip]/v2/devices
HTTP/1.1 200 OK
Content-Length: 39
Content-Type: application/json; charset=utf-8

{" ":"83777720","1":{" ":"f1013395"}}

If I hardcode 1 as the device ID in the function getDeviceById and getParmetersById, everything works.

outputting ${deviceId} at the line that calls this function reveals it is sending: "1={_=f1013395}" which ends up with a null result.

I am fine with the hardcoding, but would I be able to run a second instance of the app if I got another controller?

Could you show me where you hard coded it? When you run the app does it list your device? Also where are you seeing that the device id is wrong? We’re you getting errors? More info would probably help me figure out what’s going on.

In the app, If I change line 162:
path: "/v2/devices/${id}",

to
path: "/v2/devices/1",

and line 206 from:
path: "/v2/devices/${id}/properties",

to
path: "/v2/devices/1/properties",

then it lists a fan and it works in hubitat. If I did not, then getDeviceByID was returning null and there were no devices able to be selected.

On line 145 of the app, I used

logDebug "${deviceid}"

to show what was being passed to getDeviceById(deviceid);

and it outputs:

"1={_=f1013395}"

I got the "1" from the curl output in my post above.

Could you go to the app and click the gear and show me the properties? E.g. mine looks like this:

here it is

Could you test changing line 145 to getDeviceById(deviceid.key); I think that .key is needed. You'd need to uninstall and reinstall the app to really test.

That gave the error

app:362020-01-28 09:10:11.224 am errorgroovy.lang.MissingMethodException: No signature of method: groovy.lang.MissingMethodException.getResponse() is applicable for argument types: () values: [] Possible solutions: getMessage(), getMessage(), getMessage() on line 154 (prefListDevices)

Ok, I think that the following changes:

line 162:
path: "/v2/devices/${id.key}",

and line 206:
path: "/v2/devices/${id.key}/properties",

fixes the problem.

1 Like

You're absolutely right. It's a bug but I guess the BOND Hub works in spite of this. I have added your fix to the newest code. Thanks!

I was just wondering if I can use more than one hub. Thinking of getting another smart by bond controller like this one since it is now working really well.