Beiträge von sparq

    Hi there,

    I have a script I'm executing via http request but need to have the script "stop itself" after completing its actions.

    I can do this very inelegantly right now using a Shelly.Call to the shelly's own IP. like this:

    Code
    Shelly.call("HTTP.GET", { url: "http://192.168.xxx.xxx/rpc/Script.Stop?id=1" },null, null);

    but this necessitates hardcoding the IP and the Script ID. Ideally I would love to just have the script run, complete its mission and have it stop itself without having to hardcode IP or Script ID.

    Perhaps I'm missing this somewhere in the documentation - but would be nice to have something like "Script.Stop" that I can place at the end of my desired actions to stop the script.

    Thanks for any pointers.

    What are the individual http commands they you use and what cycle are you trying to achieve for what duration?

    Hi there!

    I have been trying to figure out how to use Shelly scripting to mimic some Tasmota functionality (specifically the Blink command). Thanks for sharing (in your signature) a link to some useful HTTP requests. Rather than flashing my Shelly Plus 1 devices with Tasmota, I was hoping to achieve the following via direct http requests or by creating some scripts I can call via http request. However, documentation is a bit confusing for n00bs such as myself and was hoping to get some guidance from the pros.

    I need to blink (pulse the shelly relay switch) a certain number of times - ideally I could define this number within the request rather than having to create a new script for each option. Basically, in some cases I will need to pulse the relay 5 times, sometimes 10 times etc - so being able to define this "Blink Count" as in Tasmota would be ideal. Here's an example of a Tasmota request I'm using right now:

    Code
    GET:http://192.168.xxx.xxx:80/cm?cmnd=Backlog%20BlinkCount%202%3B%20BlinkTime%202%3B%20Power%203

    This command will tell the Shelly to pulse/blink the relay 2 times, in 0.2 second increments, and then return the power state back to its pre-blink state.

    For reference, here's the command list for Tasmota (https://tasmota.github.io/docs/Commands/#commands-list)

    Is something like this achievable with Shelly Scripting? If so - any guidance would be appreciated - I am not looking for the code (although would graciously accept it if provided :) ) - I'm happy to learn and figure it out with some pointers.

    Thanks in advance for any help!

    UPDATE: I was able to leverage some examples in the wild and ChatGPT to craft a script to do what I need. However, unlike the Tasmota request which passes the variable values in the HTTP request, the script has the values for BlinkCount and BlinkTime in there. Is there a way to pass variables values via the web request to a script?

    Something like:

    Code
    GET http://192.168.33.1/rpc/Script.Start?id=1&BlinkCount=10&BlinkTime=2

    Thanks!