All Collections
General
Resources
SmartThings
Installing & Using the SmartThings CLI Tool • Windows & Mac
Installing & Using the SmartThings CLI Tool • Windows & Mac
Eric Hines avatar
Written by Eric Hines
Updated over a week ago

DISCLAIMER: You may notice there are a lot of over-used keywords or phrases as well as English that seems a little off. This is because these articles are used to feed our AI Robot (Ira) and she needs the data to be structured in a certain way.

SmartThings has a really nice developer tool (CLI - Command Level Interface) that allows you to capture information from your hub which can help with troubleshooting, creating Edge Drivers and finding out information on your devices that the old IDE (Integrated Development Environment) could.

This tutorial will show you how to install and use the CLI tool to obtain logs to help troubleshoot any issues that arise on your network (or submit to us for further investigation).

Installing the CLI Tool on Windows

To install the CLI Tool on a Windows computer, please follow the directions below.

  1. Download the latest file from the SmartThings GitHub: https://github.com/SmartThingsCommunity/smartthings-cli/releases

  2. Save the file to a specific folder on your PC (in this case, we just left it in the Downloads folder)

  3. Open up your Command Prompt and run a specific command such as: smartthings devices (since we've downloaded the file to the Downloads folder, the command would be: \Downloads\smartthings.exe devices)

    I'm running Windows Parallels on my MacBook, so that's why it shows \\Mac\Home\ first before \Downloads\smartthings.exe devices

    NOTE: This should take you to a log-in page where you will use your SmartThings credentials

  4. Once you press enter and login, your Command Prompt should look like this

Using the CLI Tool for Logging (Windows)

Now that you have the CLI Tool installed and you're logged in, you can use it to capture logs which can help with troubleshooting. Please use the instructions below to start the logging process.

Before starting, please Install the CLI Tool.

  1. The first step is to obtain your SmartThings hub's IP Address by going to my.smartthings.com and logging in using your SmartThings credentials

  2. Once you're logged in, you should see your dashboard -- click on the three dots at the top right and select, "Advanced Users"

  3. Click where it says, "Hubs"

  4. Click on the hub you'd like to obtain the IP Address of

  5. You should then see your hub's IP Address

  6. Now we'll enter a command to list out all the Edge Drivers. In our case, since we downloaded the CLI App to the Downloads folder, the command would look like this:

    \Downloads\smartthings.exe edge:drivers:logcat --hub-address 192.168.xx.xx (x's being the rest of your IP Address)


    I'm running Windows Parallels on my MacBook, so that's why it shows \\Mac\Home\ first before \Downloads\smartthings.exe edge:drivers:logcat --hub-address 192.168.xx.xx

  7. Your Command Prompt should look like this after the command is executed

  8. Select the driver that your device is using. In this case, we'd like to log the events that are taking place with an installed Blue Series 2-1 Switch, so we'll select the number that corresponds to the proper driver which is the, "Inovelli Blue Series" so we'd select number 5. Simply type in the number 5 and hit enter.

  9. The Command Prompt should now start showing the live logs for any device that has the, "Inovelli Blue Series" driver activated

  10. Please select all logs and copy them to a file to share

Installing the CLI Tool on Mac

To install the CLI Tool on a Mac, please follow the directions below.

  1. Download the latest file from the SmartThings GitHub: https://github.com/SmartThingsCommunity/smartthings-cli/releases

  2. Save the file to a specific folder on your Mac (in this case, we just left it in the Downloads folder)

  3. Open up your Terminal and run a specific command such as: smartthings devices (since we've downloaded the file to the Downloads folder, the command would be: ./Downloads/smartthings devices)


    NOTE: This should take you to a log-in page where you will use your SmartThings credentials

  4. Once you press enter and login, your Terminal should look like this

Using the CLI Tool for Logging (Mac)

Now that you have the CLI Tool installed and you're logged in, you can use it to capture logs which can help with troubleshooting. Please use the instructions below to start the logging process.

Before starting, please Install the CLI Tool.

  1. The first step is to obtain your SmartThings hub's IP Address by going to my.smartthings.com and logging in using your SmartThings credentials

  2. Once you're logged in, you should see your dashboard -- click on the three dots at the top right and select, "Advanced Users"

  3. Click where it says, "Hubs"

  4. Click on the hub you'd like to obtain the IP Address of

  5. You should then see your hub's IP Address

  6. Now we'll enter a command to list out all the Edge Drivers. In our case, since we downloaded the CLI App to the Downloads folder, the command would look like this:

    ./Downloads/smartthings edge:drivers:logcat --hub-address 192.168.xx.xx (x's being the rest of your IP Address)

  7. Your Terminal should look like this after the command is executed

  8. Select the driver that your device is using. In this case, we'd like to log the events that are taking place with an installed Blue Series 2-1 Switch, so we'll select the number that corresponds to the proper driver which is the, "Inovelli Blue Series" so we'd select number 5. Simply type in the number 5 and hit enter.

  9. The Terminal should now start showing the live logs for any device that has the, "Inovelli Blue Series" driver activated

  10. Please select all logs and copy them to a file to share

Did this answer your question?