Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Skripten / Logik
    4. Blockly
    5. Wie kann ich eine ntfy push-Meldung in Blockly abbilden?

    NEWS

    • ioBroker@Smart Living Forum Solingen, 14.06. - Agenda added

    • ioBroker goes Matter ... Matter Adapter in Stable

    • Monatsrückblick - April 2025

    Wie kann ich eine ntfy push-Meldung in Blockly abbilden?

    This topic has been deleted. Only users with topic management privileges can see it.
    • O
      Orghol last edited by

      Hat jemand eine Idee, wie dieses javascript in Blockly darzustellen ist?

      fetch('https://ntfy.example.com/mysecrets', {
          method: 'POST', // PUT works too
          body: 'Look ma, with auth',
          headers: {
              'Authorization': 'Basic dGVzdHVzZXI6ZmFrZXBhc3N3b3Jk'
          }
      })code_text
      
      haus-automatisierung 1 Reply Last reply Reply Quote 0
      • haus-automatisierung
        haus-automatisierung Developer Most Active @Orghol last edited by

        @orghol Erstmal solltest Du keine Zugangsdaten hier teilen. Ansonsten kannst das mit dem httpPost Baustein machen

        O 1 Reply Last reply Reply Quote 0
        • O
          Orghol @haus-automatisierung last edited by

          @haus-automatisierung Danke für die Info; die Daten sind fake.
          httpPost habe ich schon erfolglos versucht. Die Frage ist, wie geht es genau?

          haus-automatisierung 1 Reply Last reply Reply Quote 0
          • haus-automatisierung
            haus-automatisierung Developer Most Active @Orghol last edited by

            @orghol Zeig mal deinen Versuch.

            O 1 Reply Last reply Reply Quote 0
            • O
              Orghol @haus-automatisierung last edited by

              @haus-automatisierung Das sieht so aus:
              092a9d68-fd9e-40d9-a1be-830a3e3c815b-grafik.png

              http://site/topic, {body: 'push-message' , headers: {'Authorization': 'Bearer xyz|Content-Type:text/plain'}}
              

              Mit Tasmota auf einem ESP8266 klappt das mit WebQuery (Syntax natürlich etwas anders).

              haus-automatisierung 1 Reply Last reply Reply Quote 0
              • haus-automatisierung
                haus-automatisierung Developer Most Active @Orghol last edited by

                @orghol Basic Auth kannst Du mit in die URL schreiben:

                Screenshot 2025-02-05 at 13.01.54.png

                O 1 Reply Last reply Reply Quote 0
                • O
                  Orghol @haus-automatisierung last edited by

                  @haus-automatisierung Folgende message kommt nach Ausführung:

                  script.js.testscript: {"code":40401,"http":404,"error":"page not found"}code_text
                  

                  Sieht so aus, als könne Blockly mit der URL nicht umgehen.
                  Ich checke nochmal mit Tasmota

                  Codierknecht M 2 Replies Last reply Reply Quote 0
                  • Codierknecht
                    Codierknecht Developer Most Active @Orghol last edited by

                    @orghol sagte in Wie kann ich eine ntfy push-Meldung in Blockly abbilden?:

                    Sieht so aus, als könne Blockly mit der URL nicht umgehen.

                    Zeigen!

                    1 Reply Last reply Reply Quote 0
                    • M
                      MMac82 @Orghol last edited by

                      @orghol dein letzter Post zu dem Tehma ist nun zwar schon eine Weile her, aber ich habs wie folgt gelöst:

                      1. Anlegen einer Variable "ntfy" auf dem MQTT-Broker (kann alternativ auch eine beliebige Variable in userdata sein)
                      2. "Ntfyer-Listen-Script" in Blockly anlegen:

                      Bildschirmfoto vom 2025-06-03 21-54-03.png

                      Das Script greift auf das Programm "curl" auf der OS-Ebene zu, und der Aufbau ist damit relativ einfach mit "erstelle Text aus":

                      Textbaustein 1-> curl -H "Authorization: Bearer tk_##################" -H "Priority: urgent"[LEERZEICHEN]
                      Textbaustein 2-> -d "[LEERZEICHEN]
                      Textbaustein 3-> [(MQTT)-Variable]
                      Textbaustein 4-> [LEERZEICHEN]"
                      Textbaustein 5-> https://deinserver.de/DeinNtfyTopic

                      Der riesen Vorteil hierbei ist, dass man nun praktisch alle Messages einfach in die (MQTT-)Variable schreiben kann, und das Script verpackt das dann dank dem Trigger umgehend in eine ntfy-Nachricht. In den anderen Scripten braucht man den HTTP-Post dann nicht immer wieder zusammenbauen.

                      VG
                      MMac82

                      haus-automatisierung 1 Reply Last reply Reply Quote 0
                      • haus-automatisierung
                        haus-automatisierung Developer Most Active @MMac82 last edited by

                        @mmac82 Es gibt auch einen Adapter: https://github.com/sestriel/ioBroker.ntfy

                        1 Reply Last reply Reply Quote 0
                        • First post
                          Last post

                        Support us

                        ioBroker
                        Community Adapters
                        Donate

                        545
                        Online

                        31.7k
                        Users

                        79.7k
                        Topics

                        1.3m
                        Posts

                        4
                        10
                        237
                        Loading More Posts
                        • Oldest to Newest
                        • Newest to Oldest
                        • Most Votes
                        Reply
                        • Reply as topic
                        Log in to reply
                        Community
                        Impressum | Datenschutz-Bestimmungen | Nutzungsbedingungen
                        The ioBroker Community 2014-2023
                        logo