Is there a Smartapp or DTH in the works yet?
I actually got an e-mail today from someone at Sense - he said theyāre just about to release a Hue integration (they did that one first because it was one of the easiest) but that theyāre planning to do lots more. Iāll ask him about plans with SmartThings.
That said, I got my sense monitor installed a couple days ago, and it just detected its first device (my garage door). Iāll see what I can explore with their API - based on what Iāve done with MyQ, I imagine I could do something pretty similar with Sense devices, and I donāt think it would take more than a few weeks to set up (if I can find the time
).
Is there anything you would need to know about Sense withing SmartThings other than a device turning on or off? Iāve been able to make that work with a virtual switch and IFTTT. Iāve thought about the API a bit, but the biggest obstacle is keeping the data in sync. I wouldnāt want anything that relies on polling the Sense API for current status.
That would be super interesting⦠Monitoring this!
It sounds interesting, but could be mainly used for notifications. You could create Pistons that would tell you when devices were on/off (ie. car charging, washer/dryer, iron etcā¦)
I would love to have this integration so I could show Grid consumption and Solar production tiles on my ActionTiles dashboard that hangs on the wall.
Ah, now ActionTiles integration could be fun. Ok, that may be worth some more API tinkering.
After playing with the Sense API a bit, the biggest obstacle seems to be that most of the useful data from Sense only comes through real-time calls that use a websocket, which is not something a SmartApp can handle.
That said, it should be possible to set up a node project that acts a proxy, and that could send data to SmartThings. A few other integrations around here are set up to do that. When I get some time, Iāll see if I can set something up to do that.
Iāve got something in the works now. It will require running a node server on the side, but I think I can make it as easy as possible to set up. Iāve got most of the node piece done, connecting to Sense and pulling real-time data, and Iāve proven I can push data to the hub locally. I think the final result will be pretty sweet. Will post here when Iāve got something good enough to play with.
Is this all to create a DTH/smartapp?
What uses are you imagining?
The ability to have identified, but non-IoT electronic devices ability to serve as triggers? e.g. When the dryer turns off, you can have it announced on your DLNA speakers or notification sent to your phone.
Sounds cool!
Getting closer⦠
Iāve got data updates from sense going to device in SmartThings. As things turn on or off, you could then drive whatever other actions you want through routines, webCoRE, or whatever you want. This basically replaces the IFTTT functionality and a lot more.
A few things will be special about this integration:
- Iām using totally local LAN calls with HubAction - no need for OAuth tokens or any of that mess.0
- All youāll need to do is install the node server on a PC or Raspberry Pi, put in the IP address of the ST hub on your network, then start it up. Once you have the SmartApp and DTH code installed in your account, Sense devices will be auto-imported. Iāll add a way to āexcludeā Sense devices you donāt care about.
- The data is being pushed to the hub. No polling or scheduling needed from SmartThings.
Nice work @brbeaird!
Iām curious why you are using ādevice.switchā for the tiles- wouldnāt ādevice.presenceā be a better UI element since you canāt toggle the device status, only view it?
Thatās a good thought - presence might be a good option. My most ideal setup would be a tile on ActionTiles that could combine both the on/off status and the usage amount - since I know there are switches out other now that also measure power use, I thought emulating one of those would be a good start.
I just posted a question in the AT forums asking about the possibility of combining this info into a single tile; if thereās no way to do it I may play around with the presence capability since it really is āread-onlyā info.
Below are some tiles from my AT panel that show both status and other information like battery level, current temperature readings, etc. I think you just have to define all the capabilities your DTH is utilizing and then make sure that the exposed properties of that capability that you want (e.g. cumulative watts consumed, current watts reading, etc) are defined with the tile UI.
I provided links to three DTHās used which might help.
Row 1: Contact sensors (some Zigbee, some wired) (DTH)
Row 2: Smoke/CO2 sensors (DTH)
Row 3: Motion detectors (battery % turned off) (DTH)
Row 4: Remote temperature sensors

Interesting. The DTH I created just has these capabilities:
Actuator
Power Meter
Switch
Sensor
I have two tiles set up in the DTH - one for switch and one for power.
When I go to add a āthingā in ActionTiles, I see both of those capabilities, but theyāre listed as separate boxes to check. I see in my contact sensor tiles where thereās a āTile footerā option where you can choose whether or not to show the battery indicator. Iām guessing AT has some code in place to recognize contact sensors and just offer the ability to combine those automatically. Iām not sure how to accomplish the same thing with power plus some other āonā indicator.
Looking through your examples, they appear to be doing the same thing Iām doing - including multiple capabilities and adding them as ātilesā within the ST mobile app itself; however, ActionTiles does not seem to directly pull from this info when deciding what tiles actually get multiple pieces of info combined.
My DTH tile:
Relevant code:
definition (name: āSense Monitor Deviceā, namespace: ābrbeairdā, author: āBrian Beairdā) {
capability āActuatorā
capability āPower Meterā
capability āSwitchā
capability āSensorā
}simulator { }
tiles (scale: 2){
standardTile("switch", "device.switch", width: 2, height: 2, canChangeIcon: true) { state "off", label: '${currentValue}', action: "switch.on", icon: "st.switches.switch.off", backgroundColor: "#ffffff" state "on", label: '${currentValue}', action: "switch.off", icon: "st.switches.switch.on", backgroundColor: "#00a0dc" } // value tile (read only) valueTile("power", "device.power", decoration: "flat", width: 2, height: 2) { state "power", label:'${currentValue} Watts' } main(["switch", "power"]) details(["switch", "power"]) }
Iām not an expert, but what I see in common with those DTH examples is their usage of the multiAttributeTile() which per the ST documentation:
āMulti-attribute tiles. These tiles can display information about multiple attribute of a device.ā
A few more previews of whatās to comeā¦
Iāve got the node proxy pretty much stable. Main thing thatās left is writing some logic to keep devices in sync and offer a way in the SmartApp to exclude devices from Sense you donāt care about. Wonāt be long now!
Iām definitely not a developer like you, but do have an RPI to use as a node, but am already using it as a Homebridge relay. Is there a way to run this process in its own āspaceā, so as to not mix required versions of needed components (like node.js, etc)? Any way to run this on FreeNAS node, which runs FreeBSD I believe?
Your work is awesome, and I canāt believe how quickly youāve turned this into a working solution!
Thanks for the kind words!
In my experience working with Node, Iāve not run into a lot of situations where things require specific versions of Node itself. Most things tend to be compatible across a pretty big range of versions. Assuming the node version youāre running isnāt super old, I think this should work. If not, I bet we could find a way to tweak things a bit.
If youāre curious enough to give it an early-version tryout, feel free to download the files here: https://github.com/brbeaird/SmartThings_SenseMonitor/tree/master/node_server
Open the config.js file and put in your login information. You can put your Hub IP in there if you want, but obviously without the SmartApp and Device Handler installed, your hub will just receive the data and throw it away.
Run npm install
Run node server.js
You should know pretty quick if it works pulling data back or not.
I did a lot of testing and tweaking over the weekend. Iāve got most of the basic documentation ready, so I should have something ready to go sometime later this week.
This is awesome⦠It triggered me to finally buy one of these⦠It will be here tomorrow!
Looking forward to playing with this⦠Let me know if you need any help with developmentā¦





