Multiple schedules from one script / Call limitations

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.

  • I'd like to create multiple schedules for a day for specific hours to turn electricity on and off. Logic is based on stock electricity prices with hard coded price roof to determine when to use electricity and when not. Amount of schedules for day is not predetermined as it will be determined by the prices. If all hours are too expensive like five cheapest hours are used. Script is run once per day.

    At this point I'd like to perform this logic in one script and set all schedules from there, but there is limitation for 5 calls only. Setting a schedule requires at least 2 calls, to set on and off times.

    Can you dodge this limitation somehow?

    Shelly Plus PM1

  • I was able to make a temporary solution using multiple scripts, but each script is also using schedule slots because the script needs to be triggered.

    Also, creating half a dozen scripts with almost similar settings is a bit of a maintenance issue.

  • You can implement a call queue, so just wait until 5 calls have finished before sending the next 5. In short, setting up a call queue let you bypass the call limit is quite straightforward. However, Scripts have limited memory resources and creating a large object with numerous calls can consume a significant amount of memory forcing the script to stopp automaticly, but 10-30 calls should not be a problem.

    3 Mal editiert, zuletzt von _[Deleted]_ (8. Oktober 2023 um 02:42)

  • You can implement a call queue, so just wait until 5 calls have finished before sending the next 5. In short, setting up a call queue let you bypass the call limit is quite straightforward. However, Scripts have limited memory resources and creating a large object with numerous calls can consume a significant amount of memory forcing the script to stopp automaticly, but 10-30 calls should not be a problem.

    Needed to test it a bit to fully understand that you need to give different time intervals for each timer, as script won't stack them on top of others. Instead it executes the setting of timer at first (if set one after other in the script) and then executes the timer script based after timer value has exceeded (like a delay).


    Thanks for advice, seems to work!