SmartThings Community

Yet Another SmartApp example (under the newer 2018 SmartThings Ecosystem)

(Justinlhudson) #1

If it helps someone get started with the newer " SmartThings Ecosystem" then cool, else sorry.

I hate holding onto knowledge as sometimes the smallest code snippet helps me in my daily activities that someone else shared somewhere. :slight_smile:

I started this purely to have a self-monitored security system (which had under groovy, older Ecosystem). Has been running for 3+ months now…

(Eric Rodewald) #2

Nice, cool project :sunglasses: I’m tinkering with it at home right now. What are you doing with the data you’re logging to mongodb?

I hope you don’t mind, I submitted a PR to fix some issues and expand the instructions – mainly the fact that declaring your schedules permissions in the configuration will result in a failure to configure the automation since those were removed in late December 2018. New Automation app records created will not be able to request those scopes (r:schedules, w:schedules) because they are not required to create subscriptions anymore. :slight_smile:

Also, r:devices wasn’t working, but r:devices:* will work fine.

(Justinlhudson) #3

Thank you for the PR! This is my third node.js javascript project so on top of that, was learning how to make a WebHook SmartApp. I need to do a pass (or two or three) and cleanup from my leanings, but get less motivated when have it working. Thanks to you maybe only one more pass. :slight_smile:

I play in C# & Python most days at work, so try to find projects to keep my tech. stack relevant outside of work and nothing motivates better then actual end goal (rather then “Hello World”). I think ST moving in great direction out of the older environment, putting more control/operations on the developers end (and language independent).

I log the data mostly out of my Machine Learning history (data is king). But was thinking to make mongo script to get peak time and averages of energy usage as have the Home Energy Meter (using Gen1). Then if super motivated was thinking could graph motion sensors to see daily home activity, like dots each time enter room and peak times in room and idle time so on… Like I said “data is king” so really if no event driven tasks on my end do not need to require a hook into ST to do other activities (taking load off ST server, your welcome LOL). Maybe Redis would be cooler for event driven on my end, then can just make a hook/bridge into ST purely to get device events (keeps me in control more and less dependency on outside world). I could totally take load of ST server if could point at local hub get the same data being sent up to ST. I digress…

As you can tell I am talker (or writer, poor writer)…

(Eric Rodewald) #4

Another C# fella! :ok_hand: Glad to help! I would love to see some additional descriptions to the configuration fields – I had some difficulties grasping what everything did until I played around with it for a while.

I love the idea of graphing home activity. Maybe you could do a heatmap over your house blueprints. I’ve been thinking about that myself but hadn’t found the time yet. If those ideas ever come to fruition, be sure to post it up somewhere and ping me or something.

do not need to require a hook into ST to do other activities (taking load off ST server, your welcome LOL).

No harm with that line of thought but the APIs have rate limiting to protect against abuse - accidental or intentional, so you should be okay.