How to control a ST device from a custom tile?

Hello everyone! I have been searching for an example of this but no luck so far. The best I could find was the scenes custom tile.

I wanted to create a custom tile to control light level from a slider in the custom tile (not as popup). The actual HTML and JS are easy enough, but I can’t find an example / api to actually set the device and control it, only the official light switch tiles seem to do that.

Any pointers?


@Dinis_Carvalho, you can create a rule with HTTP Trigger, and send the HTTP request from the custom tile to execute the rule. Here is a screenshot example for your reference how you can access the parameter from the HTTP request and use the parameter to set the light level in the rule flow.

You can find more about the HTTP Trigger in the announcement post below.

Thanks a lot James, that’s indeed a nice way to get there, I did not know about HTML triggers.

In the meantime I explored the scenes custom tile sample a bit more and got it working essentially by adapting it to use devices instead of scenes and providing a deviceID as a tile setting:

Once I finish the code and the tile UI I’ll share with everyone :slight_smile: