Read the statement by Michael Teeuw here.
SmartThings
-
A johnnyboy sighting is like seeing Bigfoot. :-)
-
😂😂😂… Hey up Amigo… How’s tricks?
I’m always lurking here … from time to time, to keep up with what you guys are up to 😉
Whenever our other Amigo posts a question like that, I can hear his brain cells clicking away, knowing something good is being worked on 😊
-
Cool, nice to see you. Yeah, CBD is always working on something. I can’t keep up with him.
-
@cowboysdude
When working in the IDE, remember that there are locations, usually a TestHub and Home, I have an additional smartthings in my shop, so you need to select the correct location before creating new device handlers and smart apps.I’d start with deviceHandlers. I typically find the code on github for the device I’m looking to implement a handler for, then on the API IDE I’ll create the new handler from code (see: https://www.thesmartesthouse.com/blogs/the-smartest-blog/how-to-install-a-custom-device-handler-in-smartthings). Once you’ve published the handler for yourself, you can either setup a new device or if you want to modify a device (such as changing a door sensor, that has wire contacts, to act as a smoke alarm) you update it’s Type field to be the new handler. In your mobile app. you should see it change from a door sensor to a smoke sensor.
There are handlers that work in conjunction with smart apps also. Typically I copy the code for the new smart app the same way, and publish them to work for myself.
So as far as writing my first MM module, I was looking at this node library (https://github.com/hijha/smartthings-node) to act as the client for getting device data from ST. It requires a key to be generated. That key you will generate from the token generation page here: https://account.smartthings.com/tokens
I was hoping to get this created this weekend and play with it, but life got in the way, so hopefully I’ll get something working this week.
-
@buzzkc I know how that feels!! I don’t even think I can look at ST until almost winter in reality. Currently I’m working on a job that should take 4 months…they gave me 2 LOL After that the list is longggggggggggggggggg still… so I’m really busy.
IF you need anyone to test or help let me know!
-
@johnnyboy trying… trying LOL Great to see you!!!
-
@cowboysdude said in SmartThings:
@johnnyboy trying… trying LOL Great to see you!!!
As @buzzkc has stated about Device Handlers, and Im sure you have (Must have?) already done this… these can be found in the IDE, which are C&P from github.
There is a constantly updated list of DH’s on the ST Forum, so worth checking that out to compare with the devices you have, and wish to manipulate.Me personaly, I use WebCoRE to do my manipulation… and If I need to add anything that is not the “Norm” then I would simply create a Virtual switch on the IDE, and then point towards that, with my chosen manipulation… and if you have used WebCoRE before, then you know it has limitless possibilities. Bad comparason, but I look at WebCoRE as IFTTT on Steroids :-)
Some things I do, requires using several items… like my door sensor for example - It opens (Trigger ) and it then informs ST… which then informs WebCoRE, whitch then informs EchoSpeaks to then go through Amazon, to speak my chosen text, on my chosen Amazon devices - “Warning, Side door has been opened… Alarm sequence will initiate in T-Minus 20 seconds”
I also added in another “Then” which will turn my chosen lights on @ 100%, until door is closed… and also to turn on my smart plug, which has a Siren attached, to activate after the 20 second time, also to start recording on CCTV in that location.The lag on this is about 2 seconds… so not a real concern given the hoops it has to jump through beforehand.
I have only ever needed to slightly alter a DH once, for a Hive Sensor… but that was to simply change a 6second delay to a 12 second delay… purely because the original usage would be going through 1 loop, and I was going through 4, so need to extend the timeout.
I also have my Hive Heating controllable through ST of sorts, using ActionTiles and placing Hive on the screen there.IF my MM was Touchscreen, and I had the time to work it out, I would have loved to be able to place several icons/Tiles (Virtual Switches) onto it, and control numerous ST devices from there… But I found it far far quicker, and easier, to simply use a Tablet… with the benefit that I can add several other tablets throughout the house, each with either control of that zone only, or the ability to swipe to another zone from the same screen… by creating a Link tile in every window to go to a chosen zone.
You could also create Media Tiles… showing a constant stream of several cameras… and make that Tile as small or as big as you like… I have Netflix/Amazon/Kodi/IPTV as tiles too, so one click, and it pops up for me.
And, as mentioned, it will aslo link to any app you have on the device you are using, by creating a link tile to it… which will open up for you directly in that screen/tile… and I find this usefull when playing music through my Sonos system, and can bring up the full library to choose from, and be able to control the speakers too.
I’m not sure by your OP that you are wanting to manipulate the data to then create something to use on the MM framework, or whether you simply want to manipulate the data just to alter things to your own suiting?
But if you have read anything above that you need any more info on, then ask away… -
I’m finally starting to make some progress on this. I’ve been doing development in a docker instance and found editing files while the container is running corrupts files. :-)
So I have it connecting and bringing back device information at this point. I still need to parse that info. I’m working through the steps get all the info in the correct order to model it (get device ids>>get device components>>get device capabilities>>statuses etc.)
I do have two hubs and found that it brings back devices for all hubs, so I’ll need to get the hub info too.
-
This is something that I want to seriously look at this winter. Time right now is very hard for me to do anything…but I am keeping an eye on this and I appreciate ALL the input!!!
I am trying first to get my thermostat to work via the mirror… module form. I can do it other ways but I want to learn how to use this IDE. But it gets to be too much… but you both have excellent ideas that I will be picking your brains soon!!! :)
Keep posting please!!
-
I’ve made a little more progress on this, but nothing to display the device info yet. I found the node-smarthings library uses promises to return results, which I’ve not worked with specifically, so been struggling with tying the device information to the device capability status results. I think I’ve finally worked passed it, but still have some testing to do.
I’ve been trying to pass the device object from the first call to the call back function for the capability status, but not figured out how to do that. All of the status results were tied to the last device processed from the device callback. I did finally move the looping of devices to where only one device was sent to the socket notification that calls the capability status and seems to be working that way.