Hello all,
So I’m still fairly new to the ZigBee & SmartThings platforms, but I’ve worked with Arduino for quite some time. I am attempting to replicate the functionality of the SmartThings Arduino Shield that was discontinued some time ago and have gotten close (as least I think so) over the past few weeks.
So far I’ve managed to successfully get a ‘Xbee S2C’ to join the ‘SmartThings Hub V2’ network and show up as a thing using XCTU and following George’s guide here (https://www.falco.co.nz/electronic-projects/xbee-to-smartthings/).
EDIT: I should also note that I am communicating between the ‘XBee S2C’ and ‘XCTU’ pc application using a Seeeduino Xbee Shield V2.1. In order to configure the Xbee, I first upload a blank sketch in the ‘Arduino IDE’ and then open up XCTU and ‘Add Radio’ to connect to the Xbee. Afterwards, I swap the RX/TX adjustable pins so that data from the Arduino will be sent to the Xbee, rather than the Arduino acting strictly as a programmer for the ‘Xbee’ during initial configuration.
I’ve also gotten the Arduino to send the DS18B20 temperature data in the correct hex format over TX (read in the serial console), and it should be sending to the RX of the Xbee, I just don’t think the Xbee is configured properly to understand the data it’s seeing.
Note: The Xbee he used was not the same as my Xbee S2C module, so the profile configuration file he linked did not work by default. To get it to work with the S2C module, I just went through and replaced each field manually and then re-saved it as a profile for the S2C and following the rest of the tutorial worked fine.
I’ve been playing around with the code in the ST_Anything libraries that were originally written for the SmartThings shield and I believe that I have the code on the Arduino side working as expected (it sends a temperature value from a DS18B20 in hex over TX (checked from the console), but I do not think I fully grasp the configuration of the profile ID and cluster used for reading in data to the Xbee and then transferring to the SmartThings Hub V2.
The specific libraries I am trying to adapt & get working are the:
(https://github.com/DanielOgorchock/ST_Anything) by Daniel Ogorchock
ST_Anything -> Arduino -> Sketches -> ST_Anything_DS18B20_Temperature
ST_Anything -> Groovy -> ST_Anything_Temperatures (adapted to use only the DS18B20 instead of all of the other sensors for temperature & humidity)
The example from George uses an On/Off function (Cluster ID: 0x0006 - pg 8. of the ZCL.pdf) and my goal is to read data over TX, so I’d imagine the correct cluster ID for my project would be under ‘2.2.2.5 Measurement and Sensing’ - pg. 11 - in the ZigBee Cluster Library (ZCL) pdf document.
0x0402 - Temperature Measurement - attributes and commands for configuring the measurement of temperature, and reporting temperature measurements.
The trouble I’m having is in the ‘Simple Descriptor Response’ (the third frame sent in George’s guide on his site).
I understand that the ‘04 01’ corresponds to Home Automation, but I’m not quite sure how the ‘02 00’ which says the device is an on/off output, can be related to something different such as temperature sensing. From the example it seems like it goes…
04 01: set for home automation
02 00: says device is on/off output
00 00: First cluster type - Basic
03 00: ID clusters
06 00: On/off clusters
Does anyone know where the ‘02 00’ is referred to in the ZCL? For the last 3 clusters, I’m assuming the only one that would need changed is the ‘06 00’ to ‘02 04’ for Temperature measurement, but I’m not quite sure what the ‘02 00’ would be changed to along with it.
I will post any updates to this thread if I can figure them out.