Brice,
That sounds like an awesome option. I’ll start looking into that. In the mean time, would you by chance, have any URL links, I should look at to learn about the web server/LAN option? Thanks for your help!
There’s actually really good documentation from SmartThings on this. You can also look at examples of existing device types. My ObyThing Music works this way. The device and manager are available on Github.
Really curious about your experience here…
Does your ObyThing Music example allow for unsolicited data from the LAN attached device to be sent to the ST Hub, and subsequently update the ST Cloud? Or does your code bypass the ST Hub altogether and attach to an OAUTH endpoint on the ST Cloud servers?
One limitation of using the LAN connected devices via the ST Hub that I have found is that you need to poll them via the ST Cloud in order to get data from them. This is fine for devices that are just waiting to be commanded to perform a function. However, for devices that are continuously monitoring sensors and sending data to the ST Hub (like temperature, humidity, open/close door sensors, etc…) it really is not practical. This is why I have used the ThingShield in the past, since it provides true two-way communication, where either device can initiate the conversation.
Jason,
You could possibly also turn the Arduino + ThingShield into a sort of ST Gateway. Other Arduinos could communicate to the Gateway node via less expensive RF Arduino compatible devices. Take a look at http://www.mysensors.org/ for ideas of how you might be able to accomplish this. I have always wanted to incorporate some of the MySensors design into my ST_Anything project to allow one to extend the capability beyond one Arduino, without requiring multiple $35 ThingShields.
Here is a thread you might find useful. My son and I wrote this library a while back to help make using the Arduino + ThingShield simpler for everyone.
Good point. I was never able to get the communication from the device to the hub to work over the LAN, only hub to device. This is why ObyThing Music doesn’t show the current playing song, or doesn’t show the correct status if the music is paused outside of SmartThings. It works with UPnP devices though, so I still think it should be possible to make it work.
On a side note, a future update (that has been a long time coming) will use the OAuth endpoints as you mentioned above so that all of this is available, but it will still use the local LAN for communication from the hub to the app, since it works quicker and more reliably this way (and hopefully could run locally on the hub v2).
Dan,
Just to be sure I’m picking up what your laying down.
Instead of figuring out a way to having all the equipment talk directly to the ST hub, start having things talk to the Arduino/ThingShield and use Arduino/ThingShield as the conduit to the ST hub?
Update: I read over your project and found the answer to my own question. Your project is freaking awesome. I really appreciate the work you did and especially appreciate you sharing it with the rest of the community. I currently have an Arduino Mega being shipped to me
a suggestion; keep things simple.
no need to setup complex servers, use cloud-cloud intermediates, use LAN port, etc.
option1) just add a z-wave/zigbee chip to your arduino. hackster.io has demo’ed a use case on the cheap.
budget: ~18USD. $3 arduino clone, $15 zigbee chip from a cree bulb.
alternatively, you can buy a $3 zigbee chip from alibaba direct but then you won’t have a templated device type already worked out like the cree bulbs. Another option would be to use a monoprice door sensor for its chip too but that ~ $25.
repurposing an exisiting zwave or zigbee chips makes it local and secure. if you need more complex communication other than state changes like on/off, this may not work for you.
option2) keep with the ST shield method; you have experience with this and its proven to work; down side is the cost.
A YUN has built in WiFi and REST endpoints, but it is probably overkill and wouldn’t be any cheaper. You could use it as a gateway to other Arduinos though.