# \[ST Edge\] Simple The Pill by Shelly integration

**URL:** <https://community.smartthings.com/t/st-edge-simple-the-pill-by-shelly-integration/309613>\
**Category:** Writing Edge Drivers\
**Tags:** edge\_sensors, edge\_mics\
**Created:** [May 26, 2026, 1:56pm UTC](https://community.smartthings.com/t/st-edge-simple-the-pill-by-shelly-integration/309613 "2026-05-26T13:56:52Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![TapioX](https://avatars.discourse-cdn.com/v4/letter/t/90ced4/32.png) [@TapioX](https://community.smartthings.com/u/TapioX)\
**Post date:** [May 26, 2026, 1:56pm UTC](https://community.smartthings.com/t/st-edge-simple-the-pill-by-shelly-integration/309613/1 "2026-05-26T13:56:52Z")

</div>

I have been working for some time to build a completely local simple The Pill by Shelly integration.

The Pill by Shelly integration is execute completely locally (SmartThings Hub is needed) - not requiring additional software running on a different machine (like Raspberry Pi)

Driver is using Websockets communication.

**The Pill by Shelly introduction**

> **[The Pill by Shelly | Shelly Europe](https://www.shelly.com/products/the-pill-by-shelly)**
>
> Price: EUR 9.9

> **[The Pill by Shelly - | Shelly USA](https://us.shelly.com/products/the-pill-by-shelly)**
>
> Price: USD 12.99

> [@Edge Shelly drivers for Gen1 and Gen2 Devices](https://community.smartthings.com/t/edge-shelly-drivers-for-gen1-and-gen2-devices/237544/937#p-1447836-the-pill-by-shelly-1):
>
> Shelly Gen2/3 Driver Update Notice Name: Shelly Gen2/3 Device Driver V1.7 Version: 2024-04-05T17:29:29.455930569 Changes: Added support for: Shelly Pro Dimmer 2PM Shelly 1 Gen 3 with Temperature Add-on The driver is still on my [test channel](https://bestow-regional.api.smartthings.com/invite/Q1jP7BqnNNlL) and anyone subscribed will get the updated automatically. Thank-you to Clive and Bruno for testing.

The Pill by Shelly integration (current prototype) is supporting following Pill’s I/O modes:

- Temperature (DS18B20) - Supporting 1 Temperature probe (18B20) + optional 2 x Digital Inputs/Outputs
- Digital Input/Output - configurable for up to 3 x Inputs/Outputs

In addition to these, the device supports connecting virtual components (Boolean type)

- 2 outputs (SmartThings switch) to control The Pill by Shelly virtual components (Boolean type)
- 3 inputs (SmartThings switch) to read from The Pill by Shelly virtual components (Boolean type)

 ![SmartThings Edge Driver Shelly-Pill Device Detail View To ST Community](https://global.discourse-cdn.com/smartthings/original/3X/2/f/2f12e88e1a2018bc65a7ea77e3c111a4c1b0d5b4.png)

 ![SmartThings Edge Driver Shelly-Pill Device Settings To ST Community](https://global.discourse-cdn.com/smartthings/original/3X/1/a/1a4b1e0f4c9debc650b796a0d948fc4de9943dd3.jpeg)

The Pill by Shelly Configuration IO

 ![SmartThings Edge Driver Shelly-Pill Configuration IO To ST Community](https://global.discourse-cdn.com/smartthings/original/3X/a/f/af3908019a1766db74740d102b219fb7efd4f79a.jpeg)

The Pill by Shelly Virtual Component example

 ![SmartThings Edge Driver Shelly-Pill Virtual Components To ST Community](https://global.discourse-cdn.com/smartthings/original/3X/7/1/71c8dbabbe35718e39efd7e30518f026b6c23894.jpeg)

_My intention is to release the driver in August - September if there is interest in using it._  
**For now I will just make this presentation and I hope comments.**

Let’s see if there is interest in this kind of integration.

---

<div class="post-metadata">

**Author:** ![TapioX](https://avatars.discourse-cdn.com/v4/letter/t/90ced4/32.png) [@TapioX](https://community.smartthings.com/u/TapioX)\
**Post date:** [May 26, 2026, 4:22pm UTC](https://community.smartthings.com/t/st-edge-simple-the-pill-by-shelly-integration/309613/2 "2026-05-26T16:22:08Z")

</div>

@TAustin mentioned somewhere that Shelly Gen3 supports Websocket communication.

This Shelly WebSocket driver uses this driver as a model:

> **[SmartThingsEdgeDrivers/drivers/SmartThings/harman-luxury at beta ·...](https://github.com/SmartThingsCommunity/SmartThingsEdgeDrivers/tree/beta/drivers/SmartThings/harman-luxury)**
>
> beta/drivers/SmartThings/harman-luxury

The selection criteria was that this implementation seemed the simplest of all.

I have also used as a model for driver implementation @lmullineux driver:

> **[SampleDrivers/harmony-bridge-simple at main · lrmulli/SampleDrivers](https://github.com/lrmulli/SampleDrivers/tree/main/harmony-bridge-simple)**
>
> main/harmony-bridge-simple

_ **I’m looking for tips on finding good instructions for creating a Websocket driver in Lua.** _

---

<div class="post-metadata">

**Author:** ![TAustin](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/taustin/32/45058_2.png) [@TAustin](https://community.smartthings.com/u/TAustin)\
**Post date:** [May 29, 2026, 8:38pm UTC](https://community.smartthings.com/t/st-edge-simple-the-pill-by-shelly-integration/309613/3 "2026-05-29T20:38:54Z")

</div>

If you are interested, I can share with you the websocket library I used in my Shelly driver. I can’t even remember exactly where I picked it up - the source doesn’t have any attribution. But I was steered to it by a post here back a few years ago. But I remember having to make just a couple tweaks to the code to get it to work.

---

<div class="post-metadata">

**Author:** ![TapioX](https://avatars.discourse-cdn.com/v4/letter/t/90ced4/32.png) [@TapioX](https://community.smartthings.com/u/TapioX)\
**Post date:** [May 30, 2026, 2:36pm UTC](https://community.smartthings.com/t/st-edge-simple-the-pill-by-shelly-integration/309613/4 "2026-05-30T14:36:10Z")

</div>

> [@TAustin](#):
>
> If you are interested, I can share with you the websocket library I used in my Shelly driver.

Of course, I could check out your library. You can DM to me.

I now have the driver ready enough for communication to work in both directions. I’m unlikely to replace the WebSocket library completely.

> [@TapioX](#):
>
> [SmartThingsEdgeDrivers/drivers/SmartThings/harman-luxury at beta · SmartThingsCommunity/SmartThingsEdgeDrivers · GitHub](https://github.com/SmartThingsCommunity/SmartThingsEdgeDrivers/tree/beta/drivers/SmartThings/harman-luxury)

The driver based on these (hl\_websocket.lua & lustre) works well.  
The main missing parts are the functions in special situations (connection failure, reconnection, …). Maybe I removed these things when I modified the model driver to use communication with Shellys. Without good comments it is difficult to understand from Lua code what is basic websocket communication and what is manufacturer-specific.

My problem is that I don’t have enough basic knowledge about socket programming.

* * *

I would also be interested in the mDNS Lua code for searching for Shellys.

---

<div class="post-metadata">

**Author:** ![TAustin](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/taustin/32/45058_2.png) [@TAustin](https://community.smartthings.com/u/TAustin)\
**Post date:** [May 31, 2026, 11:08pm UTC](https://community.smartthings.com/t/st-edge-simple-the-pill-by-shelly-integration/309613/5 "2026-05-31T23:08:00Z")

</div>

It took a lot of fussing to get come up with a reliable communication link, and one that could reset and restart if errors occurred. I won’t bother you with the websocket library since you already have that. Regarding the discovery, there’s not much to it, once I converted over to the edge mdns library. I’ll DM you that module.

---

<div class="post-metadata">

**Author:** ![TapioX](https://avatars.discourse-cdn.com/v4/letter/t/90ced4/32.png) [@TapioX](https://community.smartthings.com/u/TapioX)\
**Post date:** [June 17, 2026, 11:32am UTC](https://community.smartthings.com/t/st-edge-simple-the-pill-by-shelly-integration/309613/6 "2026-06-17T11:32:28Z")

</div>

> [@TapioX](#):
>
> Let’s see if there is interest in this kind of integration.

There doesn’t seem to be any interest.

However, here is more information.

The current version of the driver also supports temperature and number child devices.

 ![image](https://global.discourse-cdn.com/smartthings/original/3X/6/a/6a267692778e3a4212364a8d9399282562dff657.jpeg)

The temperature child devices are possible additional measurements of Shelly Pill (18B20 sensors).

> **[Splitter 1 to 5-3.5 mm Jack?Shelly Pill) - Shelly Europe](https://www.shelly.com/products/splitter-1-to-5-3-5-mm-jack-shelly-pill)**
>
> Price: EUR 4.52

> **[Splitter 1 to 5-3.5 mm Jack（Shelly Pill) - | Shelly USA](https://us.shelly.com/products/splitter-1-to-5-3-5-mm-jack-shelly-pill)**
>
> Price: USD 4.24

> **[Shelly Temp. Sensor DS18B20 3.5mm jack - Shelly Europe](https://www.shelly.com/products/temperature-sensor-ds18b20-3-5-mm-jack-1-m-cable)**
>
> Price: EUR 4.05

> **[Shelly Temp. Sensor DS18B20 3.5mm jack - | Shelly USA](https://us.shelly.com/products/temperature-sensor-ds18b20-3-5-mm-jack-1-m-cable)**
>
> Price: USD 2.89

The number child devices are Shelly Pill’s virtual components (Number type).

---

<div class="post-metadata">

**Author:** ![TapioX](https://avatars.discourse-cdn.com/v4/letter/t/90ced4/32.png) [@TapioX](https://community.smartthings.com/u/TapioX)\
**Post date:** [June 21, 2026, 7:05pm UTC](https://community.smartthings.com/t/st-edge-simple-the-pill-by-shelly-integration/309613/7 "2026-06-21T19:05:02Z")

</div>

> [@TapioX](#):
>
> [https://us.shelly.com/products/the-pill-by-shelly](https://us.shelly.com/products/the-pill-by-shelly)

I added links to Shelly’s USA website.  
Shelly’s USA website has a good presentation of The Pill by Shelly IO interfaces and usage.

---

<div class="post-metadata">

**Author:** ![TapioX](https://avatars.discourse-cdn.com/v4/letter/t/90ced4/32.png) [@TapioX](https://community.smartthings.com/u/TapioX)\
**Post date:** [September 8, 2026, 1:25pm UTC](https://community.smartthings.com/t/st-edge-simple-the-pill-by-shelly-integration/309613/8 "2026-09-08T13:25:09Z")

</div>

I have been testing the driver for over two months now.

If there is interest, I can release driver (test channel’s invite link) to alpha tester(s).

---

<div class="post-metadata">

**Author:** ![Tunnah04](https://avatars.discourse-cdn.com/v4/letter/t/b19c9b/32.png) [@Tunnah04](https://community.smartthings.com/u/Tunnah04)\
**Post date:** [October 2, 2026, 6:58am UTC](https://community.smartthings.com/t/st-edge-simple-the-pill-by-shelly-integration/309613/9 "2026-10-02T06:58:20Z")

</div>

That’d be awesome! My pill arrived today n I’d like to add it to my smartthings
