Integration with initialstate.com [Solved]

arduino
thingshield

(Pau Walko) #1

I have a question about a device handler I’m writing. It’s for an Arduino Thingshield which has 4 temp sensors and 6 switches in it. Each temp value is sent to smartthings like “temperature1” “temperature2”… and each switch is sent with a variable like “valve”, “water”… about what they control.
I’m using the “ST_Anything” library to do this.

For some reason, the data from this device doesn’t get forwarded to initialstate.com, even though the data from my other sensors do. Does anyone know what I need to do so the data from the arduino is forwarded from smartthings to initialstate.com?

Here’s my current code: https://goo.gl/yS0AP7


(David Sulpy) #2

Hey @paulwalko! Out of curiousity, does it show up in the list of selectable items when you go through the OAuth process from Initial State?


(Pau Walko) #3

I probably should’ve updated this once I found my solution, but yes it does.

I ended up using the SmartApp provided by initial state since the library I was using custom attributes. So in the device handler I had attributes temperature{1,2,3,4}, but the default configuration only recognized a single attribute named “temperature.” Once I added support for the custom attributes, everything worked great.

For future reference, here’s the updated event streamer code: https://gist.github.com/paulwalko/baee2e94acd0b0835d87305308af4383

and here’s the device handler code: https://gist.github.com/paulwalko/6034c1ec6a4756f0daa8daf1e477a863

Side note: since my device has so many custom attributes, I gave it it’s own capability to keep everything nice & organized.