Skip to content

Commit

Permalink
Merge pull request #1 from exsilium/feature/smartthings
Browse files Browse the repository at this point in the history
Integration with SmartThings Hub
  • Loading branch information
exsilium committed Oct 25, 2017
2 parents 9db652b + 383f374 commit 9f53c1f
Show file tree
Hide file tree
Showing 4 changed files with 590 additions and 247 deletions.
13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# pxbee-trigger

Programmable XBee Trigger that is ZigBee Home Automation profile compliant. The testing of this feature branch is carried out using [SmartThings](https://www.smartthings.com) Hub and a default ZigBee device handler.

## Bill of Materials

| Component | Manufacturer | Quantity | SKU / Part nr. | Mandatory / Optional |
Expand Down Expand Up @@ -28,12 +30,11 @@

## Trigger

Send the following Explicit Addressing Command Frame to trigger the connected relay for 125ms:
Send a Unicast ZCL "On" command to trigger the connected relay for 125ms. The state of the switch remains in "Off" state. Broadcast command is ignored by default.

```
sourceEndpoint: 0xE8,
destinationEndpoint: 0xEA,
Endpoint: 0xEA,
clusterId: 0x0006,
profileId: 0xEAA4,
data: 0x03
```
profileId: 0x0104,
command: 0x01
```
20 changes: 17 additions & 3 deletions include/custom.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,27 @@
* the project.
*
*/

/* Additional XBee settings */
#define XBEE_PARAM_ZS 2
#define XBEE_PARAM_NJ 0x5A
#define XBEE_PARAM_NH 0x1E
#define XBEE_PARAM_NO 3
#define XBEE_PARAM_AP 2
#define XBEE_PARAM_EE 1
#define XBEE_PARAM_EO 1
#define XBEE_PARAM_KY "5A6967426565416C6C69616E63653039"

/* Ignore On command received via Broadcast message */
#define PXBEE_TRIGGER_IGNORE_BROADCAST

#include <zigbee/zdo.h>

extern wpan_ep_state_t zdo_ep_state;
#define ZIGBEE_ZDO_VERBOSE
extern wpan_ep_state_t custom_ha_ep_state;

#define CUSTOM_ENDPOINT 0xEA
#define CUSTOM_EP_PROFILE 0xEAA4
#define CUSTOM_EP_PROFILE 0x0104

/* With this macro the prototypes of clusters' callbacks and extern variables are included in endpoints.c
* Array custom_ep_data_clusters[] is declared in main.c
Expand All @@ -21,7 +35,7 @@ extern wpan_ep_state_t zdo_ep_state;

/* This is a wpan_endpoint_table_entry_t structure, see its declaration in aps.h, the '{}' are because they
* will be included in endpoints_table[] in endpoints.c */
#define ADDITIONAL_ENDPOINTS {CUSTOM_ENDPOINT, CUSTOM_EP_PROFILE, custom_ep_default_cluster, NULL, 0x0000, 0x00, custom_ep_clusters}, \
#define ADDITIONAL_ENDPOINTS {CUSTOM_ENDPOINT, CUSTOM_EP_PROFILE, custom_ep_default_cluster, &custom_ha_ep_state, 0x0002, 0x00, custom_ep_clusters}, \
ZDO_ENDPOINT(zdo_ep_state)

/* This macro is automatically defined if Process Incoming frames, Node Discovery Support or Over-the-Air
Expand Down
5 changes: 3 additions & 2 deletions include/xbee_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
#define __XBEE_CONFIG_H_

/* Project definitions */
#define APP_VERSION_STRING "Trigger v0.0.1"
#define APP_VERSION_STRING "Trigger v0.1.0"
#define CONFIG_XBEE_ZB
#define CONFIG_XBEE_THT
#define CONFIG_XBEE_S2B
#define CONFIG_XBEE_S2CTH
#define CONFIG_XBEE_FLASH_LEN 32

/* system0 component */
Expand Down Expand Up @@ -59,6 +59,7 @@

/* xbee_config0 component */
//#define XBEE_ATCMD_PARAM_ID "0123456789ABCDEF"
#define XBEE_ATCMD_PARAM_SC 0x7FFF
#define XBEE_ATCMD_PARAM_NI "PROGRAMMABLE TEST 1"

/* GROVE LED component on the XBee Carrier (I2C socket) */
Expand Down

0 comments on commit 9f53c1f

Please sign in to comment.