Visit the Node.js server logs and you will see a confirmation request with a link to visit to verify your app. On the next screen, in the Automation Connector, there will be a link to verify your app registration. On this screen, we need to provide device read and execution permissions. This is what the SmartThings application will display. On the next screen, provide the application name and description. Remember this is for testing only, after closing ngrok the URL will not be accessible again. When registering the SmartApp select “WebHook Endpoint” for this application.įor the Target URL, we will provide the ngrok URL. Registering the app creates a connection to the Node.js application. For this tutorial, select “Automation for the SmartThings App.”Īfter naming the project, we need to register the app. Once logged in to the Developer Workspace, there is a button to create a new project. Creating a SmartApp in the Developer Workspace Next, we can create a SmartApp in the Developer Workspace. Ngrok makes a secure public tunnel to our application. To run the application, you first have to start the Node.js application npm run start.Īfter the Node.js application is running, you need to start ngrok in another terminal tab ngrok http 3000. In the example repository, run npm install to install the project dependencies. The example repository also outlines the steps for setting up the project. If you want to follow along, I have an example repository used in this article. Ngrok will create a secure tunnel to the local node server. SmartThings mobile application, Android or iOS.You can use your Samsung account login for the Developer Workspace. SmartThings Developer Workspace account.Understanding of Node.js or JavaScript.Familiarity with APIs (Application Programming Interfaces).In part two, we will dig into the code to making your own custom SmartApp. In this two-part series, we will first review setting up an example SmartApp. With a SmartApp you can use the SmartThings API to create custom automation. One of the more interesting things that SmartThings has is its SmartApps. This includes devices from many different brands. The SmartThings app allows you to control many different smart devices in one place. So - The toner level is your battery level, Word is a SmartApp and the printer driver is a Device Type handler.SmartThings is a great tool for home automation. If you wanted to manage details about how much toner is in your printer, that code would be in the printer driver, not in Word. When you want to print from Word, the Word application is getting information about the printer and sending information to the printer via the printer driver. When you go into Devices and Printers to manage your printer, it’s getting and setting information via the printer driver. Word doesn’t understand your printer, the device driver does. That interface is implemented in a Device Type told you how to create a customised Device Type handler based upon the existing Device Type handler code.Īs an analogy - in Windows you have applications like Word and you have device drivers such as one that lets Windows (and applications) talk to your printer. When you’re looking at a device in the SmartThings application, you’re looking at the interface to a device, not a SmartApp. Told you that you need to create a customised Device Type handler (rather than a SmartApp) to add a tile to show the battery status.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |