Will do. Still don't have a bond compatible fan so definitely need help testing!
I just tried adding the Bond this afternoon, and when it gets to the devices after adding the IP and token, no devices are listed. I tried removing the drivers and app code and added again, but still have the same problem. I get this in the log - "java.lang.NullPointerException: Cannot invoke method size() on null object on line 247 (installed)" Line 247 refers to a fireplace, which I don't have.
I've got two fans set up and working in the Bond app if that helps any. Also, in the Bond app under settings, on the Associated devices it shows 0. Not sure if that means anything.
Want to grab the latest app code? I think I fixed this.
@KakaduDreamer I took a first stab at up/down lights (again untested since I have no fans!). To make it work you'll need the latest app code and then rerun through the setup steps of the app. It WILL delete the "light" child device of the fan and replace it with two separate devices, an up light and a down light (for fans that support both). If the fan only has 1 it'll still have a single light device. Sorry if that causes you so issues with RM or anything you integrated the light with! Let me know how it goes. Ideally it'd be great if someone could test with a fan that has a single light and a fan that has up/down lights to ensure both work.
Howdy @dman2306,
I will definitely try it out, although it probably won't be until sometime tomorrow... No worries on the light thing -- I actually held off on incorporating any light specific stuff in RM until more functionality was added to the app and drivers. The fan specific stuff has been working just fine this past week. As always, thank you for all your efforts!
Cool. Let me know how it goes, I think I also have the direction stuff ready to go but would like to test up/down lighting first.
Any chance you have dimmers for either up or down light? At some point I plan to add that
Yes, I have dimmers for both the up and down lights and can test that as well...
I updated the code and tried adding the device, but still nothing is showing up in the device list. I now get error "java.lang.NullPointerException: Cannot invoke method size() on null object on line 369 (updateDevices)"
I tried deleting the app as well as the drivers and re-added, but get the same error.
It has been a very long time since I've coded, but this thread has me really intrigued. Line 369 of the updateDevices function is
for (def i = 0; i < fireplaces.size(); i++)
It sounds like the fireplaces object has not been initialized at this point.
Searching for where this function is called, the only place I see it is another function called initialize
def initialize() {
logDebug "initializing"
cleanupChildDevices()
createChildDevices()
subscribeSensorEvents()
schedule("0/30 * * * * ? *", updateDevices)
}
If I'm being totally honest, I am not quickly finding where most of these objects are created, but I'm also not familiar with Groovy, so I may just be missing it. I suspect though that this can be fixed by a quick check for null before the for loop.
if (fireplaces != null) {
Do the thing
}
Yup that was pretty much the problem. I think I corrected every place that can occur if someone has time to test.
Just tested this out. I'm not getting any errors now, but when I click next after adding the IP and token, there are still no devices showing up even though I have two fans set up and working in the Bond app.
I added a bit of debug logging, can you try again and take a screenshot of the logs?
@bbuckles76 --
Just out of curiosity, since I had this same issue previously, under the Bond Bridge Settings screen in the Bond Home app...what is the "Devices associated" value? If the number is 0 it means your devices in Bond are not "local", they are still cloud based devices. In Hubitat they won't be available to select in the Bond Integration App if they're not local devices...
I have been able to test out the Top (Up) and Bottom (Down) lights using the latest version of your app and device driver code. Good news, it works! The dimmer functionality may need to wait because it turns out the remotes for my Emerson ceiling fans aren't currently in the Bond database, so the dimmer function isn't available to me at this time. However, I can now toggle the lights on/off which is actually all I really care about for now...
As for the fan direction (forward/reverse), I notice you created a new Bond Fan Direction device driver for that. I'm curious why that new code needs a separate device driver instead of simply being part of the existing Bond Fan device instead...
@KakaduDreamer I'm kind of having a debate regarding the direction stuff. Not every fan is going to support that functionality. I came up with 3 options:
1.) Another device driver
2.) Where I create two drivers, BOND Fan and BOND Fan With Direction
3.) Just make it available on every fan, and it just does nothing if the fan doesn't actually support it
I really couldn't find a good example of a scenario like this for any other drivers so if anyone has any thoughts I'd love to hear it.
I think either option #2 or #3 would be fine and probably better than #1.
EDIT: would it be easiest/simplest to do #3 option?
Yeah #3 would be easiest, but I want to do it right too... I went with option 2. If you grab the latest app and the BOND Fan With Direction driver you should be good to go. You will, however, need to go into your fan devices and change the Type dropdown to BOND Fan With Direction. Let me know how it goes
Okay, sounds good! Will report back after doing some testing...
Yep, that looks like the problem. I'm showing 0 associated devices. I just saw the post from bond-jacob too. I'm guessing at this point I just have to wait until a local instance is available or something?
@bond-jacob would probably be the best person to guide you with getting your fans setup to run local which entails using the Bond Home app and the version 2.x firmware. There are multiple steps I had to go through to get it working correctly and I'm still having a couple issues as my Emerson ceiling fan remotes aren't yet part of the Bond device database. (For example, I had to create some of the commands manually from my remotes to get the top/bottom lights working.) The local control capability is still in beta testing but I think it will be rolled out to everyone in the next month or so...