Shelly Plus 2PM script that turns on channel 2 when channel 1 power draw is above limit, and turns off if below?

Hinweis zur Nutzung von Skripten (für Nutzer)

Die Verwendung von Skripten erfolgt ausdrücklich auf eigene Gefahr. Weder Shelly noch die jeweiligen Autoren oder Entwickler der Skripte übernehmen irgendeine Form der Haftung für mögliche Schäden, Fehlfunktionen, Datenverluste oder anderweitige Beeinträchtigungen, die durch die Nutzung dieser Skripte entstehen könnten. Bitte stellen Sie vor dem Einsatz sicher, dass Sie den Quellcode verstehen und sich der möglichen Auswirkungen bewusst sind. Die Skripte werden ohne Gewähr bereitgestellt und unterliegen keiner regelmäßigen Wartung oder offiziellen Unterstützung.


Hinweis für Entwickler

Wenn Sie eigene Skripte bereitstellen, achten Sie bitte darauf, eine klare Beschreibung, eventuelle Einschränkungen und Sicherheitsaspekte zu dokumentieren. Beachten Sie zudem, dass Nutzer Ihre Skripte grundsätzlich auf eigenes Risiko verwenden. Eine Haftung für Schäden ist ausgeschlossen, sofern diese nicht vorsätzlich oder grob fahrlässig verursacht wurden oder gesetzlich anderweitig geregelt ist.

VPN/Proxy erkannt

Es scheint, dass Sie einen VPN- oder Proxy-Dienst verwenden. Bitte beachten Sie, dass die Nutzung eines solchen Dienstes die Funktionalität dieser Webseite einschränken kann.

  • New to scripting with the Shelly's, and I am trying to create a solution to turn on fans in a cabinet housing my receiver when the receiver is turned on.

    How do I create a script which monitors channel 1 power draw (which should always be turned on, is it possible to set one channel to default to on even after power outage)?
    When the power draw of channel 1 is above a limit it should turn on channel 2, and when the power draw is below a limit it should turn off channel 2?

    How do I script this?


    Thank you!

  • You need the following:

    1. a Shelly measuring the power consumption - or two Shelly, one measuring the power consumption, the other switching your fan
      The script should be run on the measuring Shelly, but it can also be run on the switching Shelly.
      When using only one Shelly, channel 1 must be permanently switched on.
    2. a configuration sequence containing the temperature threshold like
      let MinPower = xx;
    3. an event handler function that selects the appropriate events
    4. an instruction that adds the event handler function to the firmware

    Have a look at Shelly Script Language Features and the using of event handler!

    An Cloud-/Szenen-Benutzer (insbesondere für Regelungen): Was erwartest du, wenn Internet oder Cloud sabotiert werden? Nicht nur dafür meine kleine Skripteinführung  8)

    Die einzig existierende Konstante ist der Wandel. Oft liegt die größte Schwierigkeit darin, das Anliegen des Klienten zu verstehen.

  • Found this code, but I am not sure how to implement this on a Shelly Plus 2PM to switch on the other channel?:

  • You may use this script. Then you should at least understand the configuration of the script and adapt it yourself.

    But what can you do if you want to make a change?

    It will be relatively difficult to understand the entire script. I recommend this script only if you are able to understand it.

    A much smaller and simpler script is sufficient for your intention. And it's best if you put together the script yourself. You decide for yourself. Perhaps my script introduction (in german) may help you.

    If you want a simple script, I might be able to help you with that. I don't want to support the above script because it should only be used if you understand it.

    An Cloud-/Szenen-Benutzer (insbesondere für Regelungen): Was erwartest du, wenn Internet oder Cloud sabotiert werden? Nicht nur dafür meine kleine Skripteinführung  8)

    Die einzig existierende Konstante ist der Wandel. Oft liegt die größte Schwierigkeit darin, das Anliegen des Klienten zu verstehen.

  • Sadly I don't understand german, I'm Swedish. I would like as simple of a script as possible. I don't know why that script is so advanced, as the thread starter in that thread asked for the same function?

    I would gladly take your help if you want to, thank you!

  • Dieses Thema enthält 6 weitere Beiträge, die nur für registrierte Benutzer sichtbar sind.