Power draw controlled switch

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.

  • Hi

    I have a Shelly mini PM "PMFan" connected to the kitchen fan, and I need it to turn on a relay "spjeld" if the powerdraw is >2W, and turn it of again if its below 2W.

    I have tried doing it via actions, but firstly the conditions available are "active power change", which wouldnt do it since the fan can draw 1-200W depending on setting, so a 1W increase or decrease wouldn't turn it of at the right time.

    So basicly it would be a simple If statement for functionality if I did this on a arduino etc. (If PmFan power > 2 , spjeld = on, else Spjeld = off.)

    But I am struggling to understand how to code this in shelly.

    Is there a simple way to do this? Are there any tutorials thats adequate to get this done?

    Thanks for any help

    Flytrapp.

  • Hello Flytrapp,

    yah thats possible, here is a Script for this:

    Preview:

    Der Inhalt kann nicht angezeigt werden, da Sie keine Berechtigung haben, diesen Inhalt zu sehen.

    Instructions (only in German sry)

    _[Deleted]_
    2. Dezember 2023 um 00:16

    More Infos about Shelly.Call():

    https://shelly-api-docs.shelly.cloud/gen2/0.14/Scri…ures#shellycall

    2 Mal editiert, zuletzt von _[Deleted]_ (2. Dezember 2023 um 00:35)

  • Thank you,

    If i understand this correctly all I would need to do is change variables for powerlimit and IP adress of the switch (Shelly 1 mini) ? and then run this as a script in the PM mini?

    entering http://192.168.68.64/relay/0/?turn=off / on i a browser works, and PM shows a powerdraw of 20W, but no action triggered from the script.

    Diagnostics from the PMmini:

    shelly_notification:163 Status change of pm1:0: {"id":0,"apower":15.4} 11:46:49

    shelly_notification:163 Status change of pm1:0: {"id":0,"current":0.155} 11:46:49

    shelly_notification:163 Status change of pm1:0: {"id":0,"apower":6.1} 11:46:50

    shelly_notification:163 Status change of pm1:0: {"id":0,"current":0.108} 11:46:50

    shelly_notification:163 Status change of pm1:0: {"id":0,"apower":0.0} 11:46:51

    shelly_notification:163 Status change of pm1:0: {"id":0,"current":0.000} 11:46:51

    shelly_notification:163 Status change of pm1:0: {"id":0,"apower":2.9} 11:46:56

    shelly_notification:163 Status change of pm1:0: {"id":0,"current":0.030} 11:46:56

    Einmal editiert, zuletzt von Flytrapp (2. Dezember 2023 um 11:57)

  • If it is a local IP (command) you need to use http://127.0.0.0/.... or http://localhost/.... as the ip or just use a Switch.set local method like ['Switch.set',{id:0, on:true},null,null,debug].

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