I suppose I am a bit confused at the seemingly needless over-complication of SmartThings. I’m a longtime developer and consummate home automator.
I purchased a SmartHub, in conjunction with some GE Z-Wave dimmer switches to control the lighting in my home. My home automation setup is custom and includes a dedicated external server through which I run everything. Python drives it all - and it will run this as well.
This should be simple - but it seems overly complicated.
- I’ve created a SmartApp
- I’ve registered my Hub
- I’ve created a custom endpoint on my server to authorize my app
- In Python, I’m successfully getting a code, requesting a token, getting my endpoints
Great. I’m fully authenticated to my custom SmartThings app via the REST api. Whew.
How the hell do I simply return a list of authenticated switches, then set the value of the light intensity on said switches?
It seems I need to add permissions in my Groovy code, they create a function to return the switches, then add functions to interact with those switches - just so I can communicate with them through Python.
So now I need to write and maintain two separate codebases, one in Python, and one in… Groovy?
Why am I spending time learning Groovy again?
Whatever, I’m doing it.
- I created a function in Groovy, using the strange SmartThings web based text editor.
- I’ve ‘mapped’ the function to an endpoint
- I can call that function in Python using my authenticated code/token/endpoint
What do I need to do to return the number of switches I have, then set/get a value for each of those switches?
Bonus: Why is this so complicated?
I’m ready to return it all and try something else.