Get cover state and position at the moment of change through custom mqtt topic (SOLVED)

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.

  • Hello,

    I need help regarding the title. I am not a mjs expert and I want a script that publishes a custom mqtt topic when

    Shelly Plus 2PM in cover mode, changes state or changes position.

    The only thing that I managed to write, combining bits from here and there is the below scipt


    But of course this is not what i want. I understand I should use a statusHandler or eventHandler but I really don;t understand how to do it...

    So, if anybody could help me I would appreciate it.

    Thank you in advance.

  • Hallo,

    thats is easy to do, but first I need some event debug data from you.

    Use this script, active debug output of the console under the script and controlle your cover, while your script window is open, to get some event data.

    Einmal editiert, zuletzt von _[Deleted]_ (24. September 2023 um 18:03)

  • Thank you...First thing tomorrow noon when I get back from work.

    (Now that I can, everyone in family is sleeping :sleeping: ,

    so...nope, can't start moving the rollers! ^^ )

  • OK, here are the debug results, first stopped and then opened :


    Thank you again.

  • Gerat,

    now please run the following script and fully move your covers up and down at least once. Then, share the console output.

    There were no closing events, so I had to guess what they are called, and thats why we have to double check now if my gussing was right.

    If there is still no closing message inside the console output, change the debug config option to true and run it again, but I'm 70% confident that I guessed it right. ^^


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