LordDeSith:
Hi all!
I want to see the outside temperature of my heating system in SmartThings. The heating system is not supported out of the box by SmartThings, but offers an API. I´ve already accessed the API with Postman and also were able to read out the outside temperature.
Now I´m struggling a little bit with Lua and SmartThings Edge drivers. I´ve already set up my development environment and read threw the documentation. I believe my config.yaml and profile.yaml are already finished. My init.lua is in progress:
For me it is at the moment unclear, where I set the temperature in the device? And how can I access a REST API within Lua? Any help is appreciated
Thank you
LordDeSith
It might be easier to use an existing Edge driver that can do HTTP requests. See [ST Edge] Web Requestor: a driver to issue local POST and GET HTTP requests . Also note, since Edge drivers are running on your hub, they can only connect to private IP addresses. Connecting outside your local LAN requires a proxy device.
If you would like to continue on the path of creating your own Edge driver, you can use Todd’s repo for his driver as a reference for how to do HTTP requests in Lua.
# Web Requestor Edge Driver
Issue HTTP Requests (POST/GET/PUT) SmartThings mobile app or automations. Requests can be any valid http request string and can include a body and specified headers.
There are three ways this driver can be used:
* Pre-configure up to 50 different POST/GET/PUT requests, which can then be individually triggered through Automations/Rules or via a button in the mobile app.
* Issue custom URL POST/GET commands from within a Rule
* Issue custom URL POST/GET commands via the SmartThings RESTful API
### Limitations
The Edge platform limits communication to IP addresses on your local LAN only. However I have a bridge server application that can be run on any always-on computer (Windows/Linux/Mac/Raspberry Pi) on your LAN that can overcome this. See https://github.com/toddaustin07/edgebridge for more details.
## Instructions
Access my [shared channel](https://api.smartthings.com/invitation-web/accept?id=cc2197b9-2dce-4d88-b6a1-2d198a0dfdef) invitation, enroll your hub, and select the ‘Web Requestor Multi V1.2’ driver.
When the driver gets installed onto your hub, you can do an *Add device / Scan for nearby devices* and a new device called ‘Web Req Multi Master’ will be created in whatever room your hub device is located in.
This file has been truncated. show original
3 Likes