Smartthings Shield - General reference and specific question about sending strings

(j w) #1

Does anyone know where a comprehensive reference guide is for the Shield? I’m just simply trying to send strings to the clould through the shield without using the Arduino library. To be clear, I have serial communication working great both ways, so I’m doing ok. But when I look at the Arduino library, it seems like it’s sending strings by converting them to hex and sending the following line:

raw 0x0 {00 00 0A 0A 62 75 74 74 6f 6e 20 64 6f 77 6e }\nsend 0x0 1 1\n

When I do this I see this in my developer console log…

dd6dfb38-7b99-4274-8aa9-7366c21b787e ‎8‎:‎47‎:‎19‎ ‎PM: debug Parsing ‘catchall: 0104 0000 01 01 0140 00 B69F 00 00 0000 0A 00 0A627574746F6E20646F776E’

So the information is being sent, but obviously this isn’t very usable to me (yes, I could parse the hex at the end, but that’d be a nightmare). There has to be some better way to simply send a string from my device to the shield/cloud, but I can’t find reference material on the commands the shield accepts, and therefore I can’t figure out a simpler syntax for sending the strings.

Can anyone help or point me in the right direction?

(j w) #2

As an fyi, here’s the code that’s showing the description in the log, just for additional reference. Maybe there’s something in the smartapp language that will convert the raw information to a string?

def parse(String description) {
	log.debug "Parsing $description"

	def result = createEvent(name: 'switch', value: 'on')
    log.debug "Parse returned ${result?.descriptionText}"
    return result

(j w) #3

And… just like that, I found the solution! For anyone else who cares, this is how you get the string…

def value = zigbee.parse(description)?.text

(Ben Edwards) #4

Thank you for posting your answer. It will help the next person.