Custom Endpoint

Hey, I am trying to integrate the Shelly H&T sensor, Is there a way I can create a custom endpoint that I can call externally.

I will only need to have local access I can't seem to find how to do it in the documentation.

Smart things Classic documentation often helps fill in the gaps of Hubitat's docs. For custom endpoints to call your app, use mappings, documented here: The SmartApp — SmartThings Classic Developer Documentation

I can’t remember, but I think apps can provide custom endpoints, but not drivers. Not sure about that though. (You can easily add endpoints for drivers using the Maker API.)

Also, I like to include code like this in the initialize method, so I can go to the status page for the app and simply copy the endpoint URL:

if(!state.accessToken) {
    createAccessToken()
}
state.updateUrl = "${getFullLocalApiServerUrl()}/update?access_token=$state.accessToken"

Have you looked at using the built-in Hubitat MakerAPI? It provides a RESTful interface which can be used to update a virtual device's attributes.

There are two other options available...

  1. As mentioned above, you could write your own App, that implements an OAuth Endpoint, which could in turn create child devices and keep them updated. This is a bit of a heavy solution, IMHO...

  2. Write a device Driver, and use the IP Address (in Hex) of the Shelly device as the Device Network ID. Whenever the Shelly device makes an http call to the hub using port 39501, the contents of that call will appear in the driver's parse() routine. You can then simply parse the data and update the attributes accordingly.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.