1. Overview
The Ubisys Smart Home Application for iPhone functions as a Zigbee virtual device (ZVD) and may be used to control Zigbee radio devices from a mobile device. In configurations that include both Zigbee direct devices (ZDD) and standard Zigbee devices, the ZDD acts as a bridge to relay commands from your phone to Zigbee devices without Bluetooth capabilities.
This demo shows an STM32WBA55 Zigbee direct device (ZDD) using the Ubisys ZVD iOS phone application to control a Zigbee device via Bluetooth. The ZVD joins the ZDD Zigbee network and controls the Zigbee device by sending On and Off commands.
Zigbee Direct Demo |
---|
2. Setup
In this section, we will:
- Download and install the Ubisys Smart Home application on an iPhone.
- Build and flash the Zigbee_zdd_onoff Zigbee application to the NUCLEO-WBA55CG.
- Retrieve the public Bluetooth address of the NUCLEO-WBA55CG for use with a sniffing solution.
2.1. iPhone application installation
To install the Ubisys Smart Home application on the iPhone to be used as the ZVD:
- Open the App Store app on your iPhone.
- Search "Ubisys Smart Home" in the App Store.
- Install the app.
2.2. STM32WBA55 ZDD configuration
To configure the STM32WBA55 as a ZDD:
- Build the Zigbee_zdd_onoff Zigbee application.
- Download the .out ELF image to the NUCLEO-WBA55CG.
2.3. Retrieve public Bluetooth® address
To retrieve the public Bluetooth address of the NUCLEO-WBA55CG:
- Connect the NUCLEO-WBA55CG to a computer via USB-serial.
- Open a serial terminal.
- Power on the NUCLEO-WBA55CG.
- Record the public Bluetooth address shown in the debug output.
- Use this address to configure your Bluetooth sniffing solution.
When you connect the NUCLEO-WBA55CG to a computer via USB-serial, you will have access to a limited command line. Type help
to get a listing of the commands available and their descriptions.
3. Demo Procedure
In this section, we will:
- Start the ZDD application on the NUCLEO-WBA55CG.
- Connect the iPhone to the STM32WBA55 ZDD.
- Add a Zigbee device to the ZDD’s Zigbee network.
- Add a component to the ubisys Smart Home application.
- Control the Zigbee device using the iPhone.
3.1. Start the ZDD application
To start the ZDD application on the NUCLEO-WBA55CG:
- Power on the NUCLEO-WBA55CG.
- The ZDD application starts and begins sending Bluetooth® Low Energy (BLE) advertisement messages.
3.2. Connect the iPhone to the STM32WBA55 ZDD
To connect the Ubisys Smart Home app to the ZDD:
- Open the Ubisys Smart Home app on your iPhone.
- A screen displaying "Connect Gateway…" appears.
- Press the "x" in the top left corner to skip this step.
- A screen displaying "Facilities" appears.
- If the Facilities screen does not automatically appear, access the screen from the main menu of the app by selecting the menu path: Settings > Facilities.
- Press the edit symbol in the top right.
- Select "New Facility."
- Select "Create via Bluetooth."
- Use the three dots to select the advertising ZDD.
- If the ZDD appears in the Facilities screen with the message "Does not permit joining," enter the "pjoin" command on the ZDD to re-enable joining.
- In the opened bubble, confirm that the ZDD has the expected Bluetooth® address and press OK.
- This will start the connection process. During this process, the ZVD also commissions the ZDD to form a Zigbee network. Wait for the connection process to finish.
- When the Discover Devices bubble appears, select "Yes, just the device."
The app begins searching for components. The process completes within a few seconds. At this point, an entry for your ZDD appears in the Facility menu along with an entry in the components menu under the menu path:
Configuration > Basic Configuration > Components
3.3. Managing components
The Ubisys app uses components to link UI controls to device functions. Functionalities of Zigbee devices are addressed via endpoints. Endpoints are displayed in the app with a preceding hashtag (#). The provided application will have an OnOff cluster on endpoint 1. In this section, we will:
- View the components on your device
- Edit the component name
- Create a room
- Add the component to the room
To manage components in the Ubisys app:
- Access the components menu by navigating to the menu path:
Configuration > Basic Configuration > Components.
- If you do not see your device as a component, refresh the components menu by swiping down.
- There may be a delay of a minute or so between the time a new device joins the network and when it appears in the components menu.
- Select the device with the correct Bluetooth® address from the components menu.
- Select the edit symbol and change the name of the device to "Light Switch".
- Navigate to the menu path:
- Select the edit symbol.
- Select the plus symbol located next to "New Room".
- Name the room and select the check mark.
- Select the newly created room.
- Navigate to the menu path:
- Select the light switch component (OnOff server) on the expected endpoint.
- Select the check mark.
- Select the check mark again to finish adding devices to the room.
Configuration > Basic Configuration > Rooms
Edit > Add device
3.4. Adding a Zigbee device
With the ZDD commissioned to form a network, ZVD-to-Zigbee only device control can be validated by adding a Zigbee device to the network. To add a Zigbee device to the network:
- Navigate to the menu path:
Configuration > Basic Configuration
- In the Select Open menu, choose New Devices.
- Have a Zigbee radio device join the network.
3.5. Sending On and Off Commands
To send On and Off commands to the Zigbee device:
- Navigate to the menu path:
Building Control > <Name of room>
- A circle button will appear to toggle the light switch on and off.
With this process complete, the circle button now signifies when the cluster is turned on by changing color to green.
3.6. Disconnecting the ZVD from the ZDD
To disconnect the ZVD from the ZDD:
- Navigate to the menu path:
Settings > Facilities > Edit
- Select the red minus symbol next to the device
- Confirm by selecting "delete"