Below are the instructions for using CURL on windows.
I also suggest you slowly go through the installation instructions again and make sure you haven’t missed anything.
- Especially make sure you have the ip and mac of your pc correct in the Create the Device section. If your PC has both wired and wireless adapters make sure you have selected the right one.
- Make sure you have selected the devices that you want openhab to know about in the SmartApp as described in the section Configuration in the Smartthings App
Here are pictures of the SmartApp from my phone:
Here are the CURL instructions:
Smartthings Curl Setup Instructions Bob Raker September 14, 2020
These instruction cover the setup of tools to be able to send requests to the Smartthings hub and view the results. This isn’t as easy as it might seem because Smartthings immediately responds to every request with an http-204. The actual results are sent by Smartthings in a separate message. Therefore one program is needed to send requests and another tool is needed to listen for and display the results. These instructions use curl for sending requests and PortListener for recieving the response. These instructions are specific to Windows.
Step 1 - Download and install
Download and install PortListener from rjlsoftware click here
Download and install curl from here
Step 2 - Create a record of your machine network information
First record the configuration of your PC. Usings a command prompt run ipconfig -all
Record your values in the table below. The Physical Address is the mac in the table
Record the existing values in your Smartthings Device settings
Logon the the Smartthings IDE click here
Select My Devices
Select your openhab device which is probably called OpenHabDevice
Record the preferences below.
Network Parameters
Device |
------ ip ------ |
------ port ------ |
------ mac ------ |
Existing OpenHabDevice settings |
|
|
|
Your PC |
|
|
|
New OpenHabDevice settings |
|
|
|
Smartthings Hub |
|
|
|
Step 3 - Update the Smartthings OpenHabDevice to point to your PC In the Smartthings IDE change the Preferences as follows:
- ip -> Your pc ip
- mac -> Your pc mac (physical address)
- port -> 8089
Step 4 - Start the port listener
- Open a cmd window on your pc
- cd to your port listener program
- Execute: listener 8089
Step 5 - Send a discovery request to the Smartthings hub
- Open a second cmd window on your pc
- cd to your curl program
- in the following command replace the ip and port with the values for your Smartthings hub
- Execute: curl -H “Content-Type: application/json” -H “192.168.87.37:39500” --data “{“discovery”: “yes” }” http://192.168.87.37:39500/discovery In the PortListener window you should see the discovery results.
Here is output from my hub:
[ "{\"capability\": \"airConditionerMode\", \"attribute\": \"airConditionerMode\", \"name\": \"Simulated Air Conditioner\", \"id\": \"63b250ce-3b4c-41ed-b28c-db320f3f5bad\" }", "{\"capability\": \"dryerMode\", \"attribute\": \"dryerMode\", \"name\": \"Simulated Dryer\", \"id\": \"31b90e1b-1ed2-4d09-aa16-b95fd9d96139\" }", "{\"capability\": \"dryerOperatingState\", \"attribute\": \"machineState\", \"name\": \"Simulated Dryer\", \"id\": \"31b90e1b-1ed2-4d09-aa16-b95fd9d96139\" }", "{\"capability\": \"dryerOperatingState\", \"attribute\": \"dryerJobState\", \"name\": \"Simulated Dryer\", \"id\": \"31b90e1b-1ed2-4d09-aa16-b95fd9d96139\" }", "{\"capability\": \"lock\", \"attribute\": \"lock\", \"name\": \"Simulated Lock\", \"id\": \"5fec2472-38f2-474e-971c-434e3b4d1488\" }", "{\"capability\": \"switch\", \"attribute\": \"switch\", \"name\": \"Master Bedroom Lights\", \"id\": \"746da922-0351-4c5c-bad9-a0e27a7b2487\" }", "{\"capability\": \"switch\", \"attribute\": \"switch\", \"name\": \"Guest Bedroom Light\", \"id\": \"1ac2d431-fbb7-4315-b68a-2c90dac8473d\" }", "{\"capability\": \"switch\", \"attribute\": \"switch\", \"name\": \"Living Room Light\", \"id\": \"c684d874-3885-4b93-9a95-afe7455f6c2a\" }", "{\"capability\": \"switch\", \"attribute\": \"switch\", \"name\": \"Office Light\", \"id\": \"5fc65f46-c0ef-4439-b57d-563e46fddfcc\" }", "{\"capability\": \"switch\", \"attribute\": \"switch\", \"name\": \"Simulated Dryer\", \"id\": \"31b90e1b-1ed2-4d09-aa16-b95fd9d96139\" }", "{\"capability\": \"switchLevel\", \"attribute\": \"level\", \"name\": \"Sengled Bulb\", \"id\": \"e5878a31-3d0a-44e0-b61b-9c5c34075239\" }", "{\"capability\": \"temperatureMeasurement\", \"attribute\": \"temperature\", \"name\": \"Simulated Air Conditioner\", \"id\": \"63b250ce-3b4c-41ed-b28c-db320f3f5bad\" }", "{\"capability\": \"temperatureMeasurement\", \"attribute\": \"temperature\", \"name\": \"Garage Door\", \"id\": \"fe147198-9c03-4c88-bb1d-b46749bf2fad\" }", "{\"capability\": \"thermostat\", \"attribute\": \"temperature\", \"name\": \"Simulated Air Conditioner\", \"id\": \"63b250ce-3b4c-41ed-b28c-db320f3f5bad\" }", "{\"capability\": \"thermostat\", \"attribute\": \"heatingSetpoint\", \"name\": \"Simulated Air Conditioner\", \"id\": \"63b250ce-3b4c-41ed-b28c-db320f3f5bad\" }", "{\"capability\": \"thermostat\", \"attribute\": \"coolingSetpoint\", \"name\": \"Simulated Air Conditioner\", \"id\": \"63b250ce-3b4c-41ed-b28c-db320f3f5bad\" }", "{\"capability\": \"thermostat\", \"attribute\": \"thermostatSetpoint\", \"name\": \"Simulated Air Conditioner\", \"id\": \"63b250ce-3b4c-41ed-b28c-db320f3f5bad\" }", "{\"capability\": \"thermostat\", \"attribute\": \"thermostatMode\", \"name\": \"Simulated Air Conditioner\", \"id\": \"63b250ce-3b4c-41ed-b28c-db320f3f5bad\" }", "{\"capability\": \"thermostat\", \"attribute\": \"thermostatFanMode\", \"name\": \"Simulated Air Conditioner\", \"id\": \"63b250ce-3b4c-41ed-b28c-db320f3f5bad\" }", "{\"capability\": \"thermostat\", \"attribute\": \"thermostatOperatingState\", \"name\": \"Simulated Air Conditioner\", \"id\": \"63b250ce-3b4c-41ed-b28c-db320f3f5bad\" }", "{\"capability\": \"thermostatCoolingSetpoint\", \"attribute\": \"coolingSetpoint\", \"name\": \"Simulated Air Conditioner\", \"id\": \"63b250ce-3b4c-41ed-b28c-db320f3f5bad\" }", "{\"capability\": \"thermostatFanMode\", \"attribute\": \"thermostatFanMode\", \"name\": \"Simulated Air Conditioner\", \"id\": \"63b250ce-3b4c-41ed-b28c-db320f3f5bad\" }", "{\"capability\": \"thermostatHeatingSetpoint\", \"attribute\": \"heatingSetpoint\", \"name\": \"Simulated Air Conditioner\", \"id\": \"63b250ce-3b4c-41ed-b28c-db320f3f5bad\" }", "{\"capability\": \"thermostatMode\", \"attribute\": \"thermostatMode\", \"name\": \"Simulated Air Conditioner\", \"id\": \"63b250ce-3b4c-41ed-b28c-db320f3f5bad\" }", "{\"capability\": \"thermostatOperatingState\", \"attribute\": \"thermostatOperatingState\", \"name\": \"Simulated Air Conditioner\", \"id\": \"63b250ce-3b4c-41ed-b28c-db320f3f5bad\" }" ]
Let me know how it goes.
Bob