Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Skripten / Logik
    4. Node-Red
    5. Json an MQTT schicken

    NEWS

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

    • ioBroker goes Matter ... Matter Adapter in Stable

    • Monatsrückblick - April 2025

    Json an MQTT schicken

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

      Hallo,

      ich kämpfe gerade wieder mit meiner Unwissenheit.

      Ich möchte über Node-Red einen Alexa Befehl an meinen MQTT Broker weiter geben um Lampen zu steuern. Was ich von meinem Alexa Device bekomme ist:

      msg : Object
      object
      on: true
      bri: 254
      percentage: 100
      hue: 0
      sat: 254
      xy: array[2]
      ct: 199
      rgb: array[3]
      colormode: "ct"
      meta: object
      payload: "on"
      deviceid: "81db97a6bf251b17"
      topic: ""
      _msgid: "ccef8b06bacdba92"
      

      An MQTT würde ich gerne die Werte von payload und von bri weitergeben in folgendem Format:

      {
      state: payload
      brightness: bri
      }
      

      Irgendwie schaffe ich es aber nicht. Geht es über einen Function node?

      Danke schonmal für eure Hilfe.

      Gruß,

      Christian

      mickym 1 Reply Last reply Reply Quote 0
      • mickym
        mickym Most Active @NFTVirus last edited by

        @nftvirus Nein Du nimmst einfach eine Change Node und nimmst JSONATA:

        783c770c-f1ce-43fd-a03d-a2862a19a39d-image.png

        {
        "state": payload,
        "brightness": bri
        }
        
        
        N 1 Reply Last reply Reply Quote 0
        • N
          NFTVirus @mickym last edited by

          @mickym Vielen Dank! So hat es funktioniert!

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

          Support us

          ioBroker
          Community Adapters
          Donate

          749
          Online

          31.7k
          Users

          79.7k
          Topics

          1.3m
          Posts

          2
          3
          144
          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