Bond Bridge QuickApp for Z-Box

For several months I’ve been working with a QuickApp to interface my Z=Box Hub with the Bond Bridge to control window shades. The QuickApp is based upon the hub’s “Base Shutter Type Without Positioning” Lua class. There are several rudimentary QuickApps out there if you search for them–but they really are only example code for controlling a window blind or another example to control fans. Neither handles the idea of a Bond Bridge Scene or Group.

This one does. It primarily is intended to controls window shades, but fans, fireplaces, lights, awnings, or whatever can be controlled by a Bond Bridge can be handled by using groups or scenes. I have tested with a ceiling fan (using Bond scenes) and it works just fine…

The details…

My application has provision for individual window blinds, as well as scenes or groups to “open all blinds,” “close all blinds,” or just close blinds on fixed windows. (In other words, a sensor on a window that is open might cue you not to close that blind!) For example, every evening at sunset, all window blinds might be closed or just the window blinds on fixed windows. Or perhaps you might set up a Z-Box Scene that closes the blinds at some known time only if the outside temperature is above some level. (There will be more about that in an upcoming post about something called Solar Noon.)

This QuickApp requires your Bond Bridge be on the same network as your Z-Box Hub or reachable by it via your router. (A discussion of how to do that is beyond the scope of this post! :wink:) It is assumed your bridge is already set up and operational from the Bond App on your phone.

Two ways to install

Simple: Download the .fqa file from the GitHub repository and upload it straight to your Z-Box — no coding required.

Advanced: Grab the Lua source code from the repo if you want to dig in, customize, or modify it for your specific use(s).

Configuration

There are a few steps you must take to configure the QuickApp for your specific installation:

  1. Edit the QuickApp and fill in the two tables near the beginning of the file as described, below. There are samples shown to guide you in the file.
    tBlinds - populate with window blind device or group IDs, using the ID for each device or group as shown in the Bond app. Fill in the ‘type’ field with either ‘devices’ or ‘groups.’ The ‘label’ field takes your preferred label text shown in the QuickApp user interface.
    tScenes - populated similarly with the ID of each scene shown in the Bond app and your preferred label text.

  2. Enter your Bond hub IP address in the Bond_IP QuickApp variable. You may find the address by examining the Bond Bridge configuration in the Bond app (it is found by tapping on the bridge in the app, tapping Advanced Settings, then Network Info).
    IMPORTANT: it is recommended to reserve this address in your router settings or configure the bridge to use a Static IP address by utilizing the options under Advanced Network Settings in the Bond app to guard against a changing IP address being assigned to your bridge device.

  3. Copy your bridge’s Local Token as shown in the Bond app into the Bond_TOKEN QuickApp variable.

That’s it! You may control the devices from your hub’s app or by setting up Scenes to handle scheduled actions. If you run into issues or have feature requests, GitHub Issues is the best place to track them — or just reply here. I reserve the right to accept or reject changes, but you’re free to use this code simply as a starting place and go nuts!

4 Likes