Beiträge von ilio1994

    thanks, now I will study the callbacks to fully understand them.

    However, due to the longpress, I didn't understand if it is possible to say for example when pressing for more than 2 seconds starts the command, obviously setting it only when there are no more than one longpress set

    Really thank you!

    Now I've finally managed to do what I wanted and understand (slowly) how the scripts work. Thank you very much

    Now I would like to understand if it is possible to activate the script by holding down the button.. I'll explain:

    I hold the button, I release it after 2 or more seconds and the script starts, it would be useful that instead the script after 2 seconds starts even if I'm still pressing the button (even for 10 seconds) in the old shelly it went like this with the longpress actions ..

    And instead I also ask you if the call is also possible to make it so that once the command is sent wait x seconds and then start everything, then instead turn it on and then turn off after x seconds. Wait x seconds and then make the call.

    Thanks in advance, as always ☺️

    Perfect!! thank you very much, everything works now!

    Is there a possibility to run more than one switch.set together?

    like.. I turn on the light for 1 second and immediately after the same light turns on for 60 minutes.

    I would like to create this so that by looking at the light that flashes once you know that the script has succeeded.

    shelly local longpress (urlactions) turns on for 5 minutes

    longpress script turns on for 1 second then turns off and then on again for 60 minutes.

    I'm trying but I can't do it, it would be really cool

    Thanks so much, I'm starting to understand the script much better now.

    now, however, I would like to be able to activate an on command and a timer of

    I would like to do an on&timer of 5 minutes with a short press and then with a long short of for example 5 seconds an on&timer of 60 minutes.

    if the local URLs worked I would have been able to!

    but unfortunately this is not the case.

    really thanks for the support, now looking at an example I'm trying to understand how the scripts work. I tried to make a change to your script but the shelly doesn't react...

    I only modified the btmMap by removing everything and putting only one command to control the shelly which would then be in localhost.

    This is what I read in the console:

    shelly_notification:208 Evento da input:0: {"component":"input:0", "id":0, "event":"btn_down", "ts":1698075533.11} 17:38:53

    shelly_notification:208 Evento da input:0: {"component":"input:0", "id":0, "event":"long_push", "ts":1698075534.11} 17:38:54

    shelly_ejs_rpc.cpp:41 Shelly.call HTTP.GET {"url":"http://192.168.1.253/relay/0?turn=toggle"} 17:38:56

    shelly_notification:208 Evento da input:0: {"component":"input:0", "id":0, "event":"btn_up", "ts":1698075536.36} 17:38:56

    shos_rpc_inst.c:230 HTTP.GET tramite loopback 17:38:56

    shelly_http_client.:306 0x3ffe53d0: HTTP GET http://192.168.1.253/relay/0?turn=toggle 17:38:56

    shelly_notification:163 Cambio di stato dell'interruttore:0: {"id":0,"aenergy":{"by_minute":[0.000,0.000,0.000],"minute_ts":1698075539,"total":0.000}} 17:39:00

    shelly_http_client.:606 0x3ffe53d0: finito; byte 0, codice 0, redir 0/3, autenticazione 0, stato DEADLINE_EXCEEDED: timeout 17:39:12

    Errore: Call(), -104 -104: Timeout

    thank you for your time

    Code
    Thanks for the reply. I found this online but it doesn't work but I don't know too much about scripts either. do you think it could work? Maybe there's just some syntax error.