Weiter zum Inhalt
  • Home
  • Aktuell
  • Tags
  • 0 Ungelesen 0
  • Kategorien
  • Unreplied
  • Beliebt
  • GitHub
  • Docu
  • Hilfe
Skins
  • Hell
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dunkel
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Standard: (Kein Skin)
  • Kein Skin
Einklappen
ioBroker Logo

Community Forum

donate donate
  1. ioBroker Community Home
  2. Deutsch
  3. Skripten / Logik
  4. Node-Red
  5. MQTT js zerlegen mit switsch

NEWS

  • Neuer ioBroker-Blog online: Monatsrückblick März/April 2026
    BluefoxB
    Bluefox
    8
    1
    1.6k

  • Verwendung von KI bitte immer deutlich kennzeichnen
    HomoranH
    Homoran
    10
    1
    664

  • Monatsrückblick Januar/Februar 2026 ist online!
    BluefoxB
    Bluefox
    18
    1
    1.2k

MQTT js zerlegen mit switsch

Geplant Angeheftet Gesperrt Verschoben Node-Red
5 Beiträge 3 Kommentatoren 382 Aufrufe 3 Beobachtet
  • Älteste zuerst
  • Neuste zuerst
  • Meiste Stimmen
Antworten
  • In einem neuen Thema antworten
Anmelden zum Antworten
Dieses Thema wurde gelöscht. Nur Nutzer mit entsprechenden Rechten können es sehen.
  • Jörg_J Offline
    Jörg_J Offline
    Jörg_
    schrieb am zuletzt editiert von
    #1

    Guten abend. ;)

    ich habe hier mehrere Xioami Temp. sensoren die Messwerte bekomme ich per TASMOTA MQTT als Json

    {"Time":"2022-12-04T13:44:13","ATCf44b8f":{"mac":"a4c138f44b8f","Temperature":19.9,"Humidity":51,"DewPoint":9.5,"Btn":1,"Battery":68,"RSSI":-42},"ATC589a51":{"mac":"a4c138589a51","Temperature":19.6,"Humidity":51.8,"DewPoint":9.4,"Btn":1,"Battery":70,"RSSI":-60},"TempUnit":"C"}
    

    jetzt wollte ich die in influxdb und grafana auswerten ,

    angefangen habe ich mit blocky script bin dann aber bei node red hängen geblieben

    [
        {
            "id": "7510054243d77b6d",
            "type": "switch",
            "z": "6f4022ddbb229204",
            "name": "",
            "property": "payload",
            "propertyType": "msg",
            "rules": [
                {
                    "t": "eq",
                    "v": "payload.ATCf44b8f.mac.\"a4c138f44b8f\"",
                    "vt": "str"
                },
                {
                    "t": "eq",
                    "v": "a4c138589a51",
                    "vt": "str"
                },
                {
                    "t": "eq",
                    "v": "A4:C1:38:E3:C7:94",
                    "vt": "str"
                },
                {
                    "t": "eq",
                    "v": "A4:C1:38:CB:5C:EA ",
                    "vt": "str"
                },
                {
                    "t": "eq",
                    "v": "A4:C1:38:A6:00:5B",
                    "vt": "str"
                }
            ],
            "checkall": "true",
            "repair": false,
            "outputs": 5,
            "x": 610,
            "y": 500,
            "wires": [
                [
                    "ed08fe87332abba7",
                    "6e7fcdeaa794a00a"
                ],
                [],
                [],
                [],
                []
            ]
        },
        {
            "id": "ed08fe87332abba7",
            "type": "function",
            "z": "6f4022ddbb229204",
            "name": "temp",
            "func": "msg.topic = \"Haus/Wohnzimmer/Temp.\"\nmsg.payload = msg.payload[\".ATCf44b8f.Temperature\"]\nreturn msg;\n\n\n",
            "outputs": 1,
            "noerr": 0,
            "initialize": "",
            "finalize": "",
            "libs": [],
            "x": 830,
            "y": 460,
            "wires": [
                [
                    "13e50b962ea4b4ec",
                    "ced978bbcfb66860",
                    "f2ebf39d6ec29ac0"
                ]
            ]
        },
        {
            "id": "13e50b962ea4b4ec",
            "type": "debug",
            "z": "6f4022ddbb229204",
            "name": "debug 18",
            "active": true,
            "tosidebar": true,
            "console": false,
            "tostatus": false,
            "complete": "false",
            "statusVal": "",
            "statusType": "auto",
            "x": 1060,
            "y": 460,
            "wires": []
        },
        {
            "id": "47e53c63b917864e",
            "type": "inject",
            "z": "6f4022ddbb229204",
            "name": "",
            "props": [
                {
                    "p": "payload"
                }
            ],
            "repeat": "",
            "crontab": "",
            "once": false,
            "onceDelay": 0.1,
            "topic": "",
            "payload": "{\"Time\":\"2022-12-04T13:44:13\",\"ATCf44b8f\":{\"mac\":\"a4c138f44b8f\",\"Temperature\":19.9,\"Humidity\":51,\"DewPoint\":9.5,\"Btn\":1,\"Battery\":68,\"RSSI\":-42},\"ATC589a51\":{\"mac\":\"a4c138589a51\",\"Temperature\":19.6,\"Humidity\":51.8,\"DewPoint\":9.4,\"Btn\":1,\"Battery\":70,\"RSSI\":-60},\"TempUnit\":\"C\"}",
            "payloadType": "str",
            "x": 170,
            "y": 520,
            "wires": [
                [
                    "a5a4c266b13a0cca"
                ]
            ]
        },
        {
            "id": "a43792495de3a27b",
            "type": "debug",
            "z": "6f4022ddbb229204",
            "name": "debug 19",
            "active": true,
            "tosidebar": true,
            "console": false,
            "tostatus": false,
            "complete": "false",
            "statusVal": "",
            "statusType": "auto",
            "x": 380,
            "y": 400,
            "wires": []
        },
        {
            "id": "a5a4c266b13a0cca",
            "type": "json",
            "z": "6f4022ddbb229204",
            "name": "",
            "property": "payload",
            "action": "",
            "pretty": true,
            "x": 390,
            "y": 520,
            "wires": [
                [
                    "7510054243d77b6d",
                    "a43792495de3a27b"
                ]
            ]
        },
        {
            "id": "6e7fcdeaa794a00a",
            "type": "debug",
            "z": "6f4022ddbb229204",
            "name": "debug 20",
            "active": true,
            "tosidebar": true,
            "console": false,
            "tostatus": false,
            "complete": "false",
            "statusVal": "",
            "statusType": "auto",
            "x": 800,
            "y": 380,
            "wires": []
        },
        {
            "id": "ced978bbcfb66860",
            "type": "influxdb out",
            "z": "6f4022ddbb229204",
            "influxdb": "eac63cf27267f4a5",
            "name": "",
            "measurement": "test_xioami",
            "precision": "",
            "retentionPolicy": "",
            "database": "database",
            "precisionV18FluxV20": "ms",
            "retentionPolicyV18Flux": "",
            "org": "Weiss",
            "bucket": "iobroker",
            "x": 1240,
            "y": 520,
            "wires": []
        },
        {
            "id": "f2ebf39d6ec29ac0",
            "type": "mqtt out",
            "z": "6f4022ddbb229204",
            "name": "",
            "topic": "Haus/",
            "qos": "2",
            "retain": "",
            "respTopic": "",
            "contentType": "",
            "userProps": "",
            "correl": "",
            "expiry": "",
            "broker": "33eaf0503bac882f",
            "x": 1050,
            "y": 560,
            "wires": []
        },
        {
            "id": "eac63cf27267f4a5",
            "type": "influxdb",
            "hostname": "127.0.0.1",
            "port": "8086",
            "protocol": "http",
            "database": "database",
            "name": "",
            "usetls": false,
            "tls": "",
            "influxdbVersion": "2.0",
            "url": "https://eu-central-1-1.aws.cloud2.influxdata.com/",
            "rejectUnauthorized": false
        },
        {
            "id": "33eaf0503bac882f",
            "type": "mqtt-broker",
            "name": "mqtt-server",
            "broker": "192.168.178.20",
            "port": "1883",
            "clientid": "node_red",
            "autoConnect": true,
            "usetls": false,
            "protocolVersion": "4",
            "keepalive": "60",
            "cleansession": true,
            "birthTopic": "nodered ",
            "birthQos": "0",
            "birthPayload": "nodered online",
            "birthMsg": {},
            "closeTopic": "",
            "closeQos": "0",
            "closePayload": "",
            "closeMsg": {},
            "willTopic": "nodered",
            "willQos": "0",
            "willPayload": "nodered offlline",
            "willMsg": {},
            "userProps": "",
            "sessionExpiry": ""
        }
    ]
    

    auch da gehst nicht weiter ich hänge bei der switsch node fest die da Js nach mac adressen filtern sollte da die sensoren in 3 gleichen String senden alle nach einnader

    Für Ideen wäre ich dankbar ;)

    ChaotC mickymM 2 Antworten Letzte Antwort
    0
    • Jörg_J Jörg_

      Guten abend. ;)

      ich habe hier mehrere Xioami Temp. sensoren die Messwerte bekomme ich per TASMOTA MQTT als Json

      {"Time":"2022-12-04T13:44:13","ATCf44b8f":{"mac":"a4c138f44b8f","Temperature":19.9,"Humidity":51,"DewPoint":9.5,"Btn":1,"Battery":68,"RSSI":-42},"ATC589a51":{"mac":"a4c138589a51","Temperature":19.6,"Humidity":51.8,"DewPoint":9.4,"Btn":1,"Battery":70,"RSSI":-60},"TempUnit":"C"}
      

      jetzt wollte ich die in influxdb und grafana auswerten ,

      angefangen habe ich mit blocky script bin dann aber bei node red hängen geblieben

      [
          {
              "id": "7510054243d77b6d",
              "type": "switch",
              "z": "6f4022ddbb229204",
              "name": "",
              "property": "payload",
              "propertyType": "msg",
              "rules": [
                  {
                      "t": "eq",
                      "v": "payload.ATCf44b8f.mac.\"a4c138f44b8f\"",
                      "vt": "str"
                  },
                  {
                      "t": "eq",
                      "v": "a4c138589a51",
                      "vt": "str"
                  },
                  {
                      "t": "eq",
                      "v": "A4:C1:38:E3:C7:94",
                      "vt": "str"
                  },
                  {
                      "t": "eq",
                      "v": "A4:C1:38:CB:5C:EA ",
                      "vt": "str"
                  },
                  {
                      "t": "eq",
                      "v": "A4:C1:38:A6:00:5B",
                      "vt": "str"
                  }
              ],
              "checkall": "true",
              "repair": false,
              "outputs": 5,
              "x": 610,
              "y": 500,
              "wires": [
                  [
                      "ed08fe87332abba7",
                      "6e7fcdeaa794a00a"
                  ],
                  [],
                  [],
                  [],
                  []
              ]
          },
          {
              "id": "ed08fe87332abba7",
              "type": "function",
              "z": "6f4022ddbb229204",
              "name": "temp",
              "func": "msg.topic = \"Haus/Wohnzimmer/Temp.\"\nmsg.payload = msg.payload[\".ATCf44b8f.Temperature\"]\nreturn msg;\n\n\n",
              "outputs": 1,
              "noerr": 0,
              "initialize": "",
              "finalize": "",
              "libs": [],
              "x": 830,
              "y": 460,
              "wires": [
                  [
                      "13e50b962ea4b4ec",
                      "ced978bbcfb66860",
                      "f2ebf39d6ec29ac0"
                  ]
              ]
          },
          {
              "id": "13e50b962ea4b4ec",
              "type": "debug",
              "z": "6f4022ddbb229204",
              "name": "debug 18",
              "active": true,
              "tosidebar": true,
              "console": false,
              "tostatus": false,
              "complete": "false",
              "statusVal": "",
              "statusType": "auto",
              "x": 1060,
              "y": 460,
              "wires": []
          },
          {
              "id": "47e53c63b917864e",
              "type": "inject",
              "z": "6f4022ddbb229204",
              "name": "",
              "props": [
                  {
                      "p": "payload"
                  }
              ],
              "repeat": "",
              "crontab": "",
              "once": false,
              "onceDelay": 0.1,
              "topic": "",
              "payload": "{\"Time\":\"2022-12-04T13:44:13\",\"ATCf44b8f\":{\"mac\":\"a4c138f44b8f\",\"Temperature\":19.9,\"Humidity\":51,\"DewPoint\":9.5,\"Btn\":1,\"Battery\":68,\"RSSI\":-42},\"ATC589a51\":{\"mac\":\"a4c138589a51\",\"Temperature\":19.6,\"Humidity\":51.8,\"DewPoint\":9.4,\"Btn\":1,\"Battery\":70,\"RSSI\":-60},\"TempUnit\":\"C\"}",
              "payloadType": "str",
              "x": 170,
              "y": 520,
              "wires": [
                  [
                      "a5a4c266b13a0cca"
                  ]
              ]
          },
          {
              "id": "a43792495de3a27b",
              "type": "debug",
              "z": "6f4022ddbb229204",
              "name": "debug 19",
              "active": true,
              "tosidebar": true,
              "console": false,
              "tostatus": false,
              "complete": "false",
              "statusVal": "",
              "statusType": "auto",
              "x": 380,
              "y": 400,
              "wires": []
          },
          {
              "id": "a5a4c266b13a0cca",
              "type": "json",
              "z": "6f4022ddbb229204",
              "name": "",
              "property": "payload",
              "action": "",
              "pretty": true,
              "x": 390,
              "y": 520,
              "wires": [
                  [
                      "7510054243d77b6d",
                      "a43792495de3a27b"
                  ]
              ]
          },
          {
              "id": "6e7fcdeaa794a00a",
              "type": "debug",
              "z": "6f4022ddbb229204",
              "name": "debug 20",
              "active": true,
              "tosidebar": true,
              "console": false,
              "tostatus": false,
              "complete": "false",
              "statusVal": "",
              "statusType": "auto",
              "x": 800,
              "y": 380,
              "wires": []
          },
          {
              "id": "ced978bbcfb66860",
              "type": "influxdb out",
              "z": "6f4022ddbb229204",
              "influxdb": "eac63cf27267f4a5",
              "name": "",
              "measurement": "test_xioami",
              "precision": "",
              "retentionPolicy": "",
              "database": "database",
              "precisionV18FluxV20": "ms",
              "retentionPolicyV18Flux": "",
              "org": "Weiss",
              "bucket": "iobroker",
              "x": 1240,
              "y": 520,
              "wires": []
          },
          {
              "id": "f2ebf39d6ec29ac0",
              "type": "mqtt out",
              "z": "6f4022ddbb229204",
              "name": "",
              "topic": "Haus/",
              "qos": "2",
              "retain": "",
              "respTopic": "",
              "contentType": "",
              "userProps": "",
              "correl": "",
              "expiry": "",
              "broker": "33eaf0503bac882f",
              "x": 1050,
              "y": 560,
              "wires": []
          },
          {
              "id": "eac63cf27267f4a5",
              "type": "influxdb",
              "hostname": "127.0.0.1",
              "port": "8086",
              "protocol": "http",
              "database": "database",
              "name": "",
              "usetls": false,
              "tls": "",
              "influxdbVersion": "2.0",
              "url": "https://eu-central-1-1.aws.cloud2.influxdata.com/",
              "rejectUnauthorized": false
          },
          {
              "id": "33eaf0503bac882f",
              "type": "mqtt-broker",
              "name": "mqtt-server",
              "broker": "192.168.178.20",
              "port": "1883",
              "clientid": "node_red",
              "autoConnect": true,
              "usetls": false,
              "protocolVersion": "4",
              "keepalive": "60",
              "cleansession": true,
              "birthTopic": "nodered ",
              "birthQos": "0",
              "birthPayload": "nodered online",
              "birthMsg": {},
              "closeTopic": "",
              "closeQos": "0",
              "closePayload": "",
              "closeMsg": {},
              "willTopic": "nodered",
              "willQos": "0",
              "willPayload": "nodered offlline",
              "willMsg": {},
              "userProps": "",
              "sessionExpiry": ""
          }
      ]
      

      auch da gehst nicht weiter ich hänge bei der switsch node fest die da Js nach mac adressen filtern sollte da die sensoren in 3 gleichen String senden alle nach einnader

      Für Ideen wäre ich dankbar ;)

      ChaotC Offline
      ChaotC Offline
      Chaot
      schrieb am zuletzt editiert von Chaot
      #2

      @jörg-w Ich verwende den Sonoff Adapter. Da ist das alles schon zerlegt.sensor.jpg

      ioBroker auf NUC unter Proxmox; VIS: 12" Touchscreen und 17" Touch; Lichtsteuerung, Thermometer und Sensoren: Tasmota (39); Ambiente Beleuchtung: WLED (9); Heizung: DECT Thermostate (9) an Fritz 6690; EMS-ESP; 1 Echo V2; 3 Echo DOT; 1 Echo Connect; 2 Echo Show 5; Unifi Ap-Ac Lite.

      1 Antwort Letzte Antwort
      0
      • Jörg_J Jörg_

        Guten abend. ;)

        ich habe hier mehrere Xioami Temp. sensoren die Messwerte bekomme ich per TASMOTA MQTT als Json

        {"Time":"2022-12-04T13:44:13","ATCf44b8f":{"mac":"a4c138f44b8f","Temperature":19.9,"Humidity":51,"DewPoint":9.5,"Btn":1,"Battery":68,"RSSI":-42},"ATC589a51":{"mac":"a4c138589a51","Temperature":19.6,"Humidity":51.8,"DewPoint":9.4,"Btn":1,"Battery":70,"RSSI":-60},"TempUnit":"C"}
        

        jetzt wollte ich die in influxdb und grafana auswerten ,

        angefangen habe ich mit blocky script bin dann aber bei node red hängen geblieben

        [
            {
                "id": "7510054243d77b6d",
                "type": "switch",
                "z": "6f4022ddbb229204",
                "name": "",
                "property": "payload",
                "propertyType": "msg",
                "rules": [
                    {
                        "t": "eq",
                        "v": "payload.ATCf44b8f.mac.\"a4c138f44b8f\"",
                        "vt": "str"
                    },
                    {
                        "t": "eq",
                        "v": "a4c138589a51",
                        "vt": "str"
                    },
                    {
                        "t": "eq",
                        "v": "A4:C1:38:E3:C7:94",
                        "vt": "str"
                    },
                    {
                        "t": "eq",
                        "v": "A4:C1:38:CB:5C:EA ",
                        "vt": "str"
                    },
                    {
                        "t": "eq",
                        "v": "A4:C1:38:A6:00:5B",
                        "vt": "str"
                    }
                ],
                "checkall": "true",
                "repair": false,
                "outputs": 5,
                "x": 610,
                "y": 500,
                "wires": [
                    [
                        "ed08fe87332abba7",
                        "6e7fcdeaa794a00a"
                    ],
                    [],
                    [],
                    [],
                    []
                ]
            },
            {
                "id": "ed08fe87332abba7",
                "type": "function",
                "z": "6f4022ddbb229204",
                "name": "temp",
                "func": "msg.topic = \"Haus/Wohnzimmer/Temp.\"\nmsg.payload = msg.payload[\".ATCf44b8f.Temperature\"]\nreturn msg;\n\n\n",
                "outputs": 1,
                "noerr": 0,
                "initialize": "",
                "finalize": "",
                "libs": [],
                "x": 830,
                "y": 460,
                "wires": [
                    [
                        "13e50b962ea4b4ec",
                        "ced978bbcfb66860",
                        "f2ebf39d6ec29ac0"
                    ]
                ]
            },
            {
                "id": "13e50b962ea4b4ec",
                "type": "debug",
                "z": "6f4022ddbb229204",
                "name": "debug 18",
                "active": true,
                "tosidebar": true,
                "console": false,
                "tostatus": false,
                "complete": "false",
                "statusVal": "",
                "statusType": "auto",
                "x": 1060,
                "y": 460,
                "wires": []
            },
            {
                "id": "47e53c63b917864e",
                "type": "inject",
                "z": "6f4022ddbb229204",
                "name": "",
                "props": [
                    {
                        "p": "payload"
                    }
                ],
                "repeat": "",
                "crontab": "",
                "once": false,
                "onceDelay": 0.1,
                "topic": "",
                "payload": "{\"Time\":\"2022-12-04T13:44:13\",\"ATCf44b8f\":{\"mac\":\"a4c138f44b8f\",\"Temperature\":19.9,\"Humidity\":51,\"DewPoint\":9.5,\"Btn\":1,\"Battery\":68,\"RSSI\":-42},\"ATC589a51\":{\"mac\":\"a4c138589a51\",\"Temperature\":19.6,\"Humidity\":51.8,\"DewPoint\":9.4,\"Btn\":1,\"Battery\":70,\"RSSI\":-60},\"TempUnit\":\"C\"}",
                "payloadType": "str",
                "x": 170,
                "y": 520,
                "wires": [
                    [
                        "a5a4c266b13a0cca"
                    ]
                ]
            },
            {
                "id": "a43792495de3a27b",
                "type": "debug",
                "z": "6f4022ddbb229204",
                "name": "debug 19",
                "active": true,
                "tosidebar": true,
                "console": false,
                "tostatus": false,
                "complete": "false",
                "statusVal": "",
                "statusType": "auto",
                "x": 380,
                "y": 400,
                "wires": []
            },
            {
                "id": "a5a4c266b13a0cca",
                "type": "json",
                "z": "6f4022ddbb229204",
                "name": "",
                "property": "payload",
                "action": "",
                "pretty": true,
                "x": 390,
                "y": 520,
                "wires": [
                    [
                        "7510054243d77b6d",
                        "a43792495de3a27b"
                    ]
                ]
            },
            {
                "id": "6e7fcdeaa794a00a",
                "type": "debug",
                "z": "6f4022ddbb229204",
                "name": "debug 20",
                "active": true,
                "tosidebar": true,
                "console": false,
                "tostatus": false,
                "complete": "false",
                "statusVal": "",
                "statusType": "auto",
                "x": 800,
                "y": 380,
                "wires": []
            },
            {
                "id": "ced978bbcfb66860",
                "type": "influxdb out",
                "z": "6f4022ddbb229204",
                "influxdb": "eac63cf27267f4a5",
                "name": "",
                "measurement": "test_xioami",
                "precision": "",
                "retentionPolicy": "",
                "database": "database",
                "precisionV18FluxV20": "ms",
                "retentionPolicyV18Flux": "",
                "org": "Weiss",
                "bucket": "iobroker",
                "x": 1240,
                "y": 520,
                "wires": []
            },
            {
                "id": "f2ebf39d6ec29ac0",
                "type": "mqtt out",
                "z": "6f4022ddbb229204",
                "name": "",
                "topic": "Haus/",
                "qos": "2",
                "retain": "",
                "respTopic": "",
                "contentType": "",
                "userProps": "",
                "correl": "",
                "expiry": "",
                "broker": "33eaf0503bac882f",
                "x": 1050,
                "y": 560,
                "wires": []
            },
            {
                "id": "eac63cf27267f4a5",
                "type": "influxdb",
                "hostname": "127.0.0.1",
                "port": "8086",
                "protocol": "http",
                "database": "database",
                "name": "",
                "usetls": false,
                "tls": "",
                "influxdbVersion": "2.0",
                "url": "https://eu-central-1-1.aws.cloud2.influxdata.com/",
                "rejectUnauthorized": false
            },
            {
                "id": "33eaf0503bac882f",
                "type": "mqtt-broker",
                "name": "mqtt-server",
                "broker": "192.168.178.20",
                "port": "1883",
                "clientid": "node_red",
                "autoConnect": true,
                "usetls": false,
                "protocolVersion": "4",
                "keepalive": "60",
                "cleansession": true,
                "birthTopic": "nodered ",
                "birthQos": "0",
                "birthPayload": "nodered online",
                "birthMsg": {},
                "closeTopic": "",
                "closeQos": "0",
                "closePayload": "",
                "closeMsg": {},
                "willTopic": "nodered",
                "willQos": "0",
                "willPayload": "nodered offlline",
                "willMsg": {},
                "userProps": "",
                "sessionExpiry": ""
            }
        ]
        

        auch da gehst nicht weiter ich hänge bei der switsch node fest die da Js nach mac adressen filtern sollte da die sensoren in 3 gleichen String senden alle nach einnader

        Für Ideen wäre ich dankbar ;)

        mickymM Offline
        mickymM Offline
        mickym
        Most Active
        schrieb am zuletzt editiert von
        #3

        @jörg-w Ist zwar ein komischer EingabeString. Aber Du musst den String in einzelne Objekte zerlegen:

        b730a03e-8fb7-4c4f-b6ff-6979fd8912f6-image.png

        [
           {
               "id": "13e50b962ea4b4ec",
               "type": "debug",
               "z": "180b7e98628a2a9b",
               "name": "Temperatur",
               "active": true,
               "tosidebar": true,
               "console": false,
               "tostatus": false,
               "complete": "payload",
               "targetType": "msg",
               "statusVal": "",
               "statusType": "auto",
               "x": 1290,
               "y": 340,
               "wires": []
           },
           {
               "id": "47e53c63b917864e",
               "type": "inject",
               "z": "180b7e98628a2a9b",
               "name": "",
               "props": [
                   {
                       "p": "payload"
                   }
               ],
               "repeat": "",
               "crontab": "",
               "once": false,
               "onceDelay": 0.1,
               "topic": "",
               "payload": "{\"Time\":\"2022-12-04T13:44:13\",\"ATCf44b8f\":{\"mac\":\"a4c138f44b8f\",\"Temperature\":19.9,\"Humidity\":51,\"DewPoint\":9.5,\"Btn\":1,\"Battery\":68,\"RSSI\":-42},\"ATC589a51\":{\"mac\":\"a4c138589a51\",\"Temperature\":19.6,\"Humidity\":51.8,\"DewPoint\":9.4,\"Btn\":1,\"Battery\":70,\"RSSI\":-60},\"TempUnit\":\"C\"}",
               "payloadType": "str",
               "x": 170,
               "y": 380,
               "wires": [
                   [
                       "a5a4c266b13a0cca"
                   ]
               ]
           },
           {
               "id": "a43792495de3a27b",
               "type": "debug",
               "z": "180b7e98628a2a9b",
               "name": "Eingabe",
               "active": false,
               "tosidebar": true,
               "console": false,
               "tostatus": false,
               "complete": "payload",
               "targetType": "msg",
               "statusVal": "",
               "statusType": "auto",
               "x": 380,
               "y": 260,
               "wires": []
           },
           {
               "id": "a5a4c266b13a0cca",
               "type": "json",
               "z": "180b7e98628a2a9b",
               "name": "",
               "property": "payload",
               "action": "",
               "pretty": true,
               "x": 310,
               "y": 380,
               "wires": [
                   [
                       "a43792495de3a27b",
                       "afd48379794b7589"
                   ]
               ]
           },
           {
               "id": "afd48379794b7589",
               "type": "split",
               "z": "180b7e98628a2a9b",
               "name": "",
               "splt": "\\n",
               "spltType": "str",
               "arraySplt": 1,
               "arraySpltType": "len",
               "stream": false,
               "addname": "topic",
               "x": 450,
               "y": 380,
               "wires": [
                   [
                       "e4298053724078c1"
                   ]
               ]
           },
           {
               "id": "22cdf6ba3b189c5a",
               "type": "switch",
               "z": "180b7e98628a2a9b",
               "name": "MAC Selektor",
               "property": "payload.mac",
               "propertyType": "msg",
               "rules": [
                   {
                       "t": "eq",
                       "v": "a4c138f44b8f",
                       "vt": "str"
                   },
                   {
                       "t": "eq",
                       "v": "a4c138589a51",
                       "vt": "str"
                   }
               ],
               "checkall": "true",
               "repair": false,
               "outputs": 2,
               "x": 900,
               "y": 380,
               "wires": [
                   [
                       "d71445fc881d262d"
                   ],
                   [
                       "483b49ba0a0bc7bd"
                   ]
               ]
           },
           {
               "id": "d71445fc881d262d",
               "type": "change",
               "z": "180b7e98628a2a9b",
               "name": "Temperatur",
               "rules": [
                   {
                       "t": "set",
                       "p": "payload",
                       "pt": "msg",
                       "to": "payload.Temperature",
                       "tot": "msg"
                   }
               ],
               "action": "",
               "property": "",
               "from": "",
               "to": "",
               "reg": false,
               "x": 1090,
               "y": 340,
               "wires": [
                   [
                       "13e50b962ea4b4ec"
                   ]
               ]
           },
           {
               "id": "483b49ba0a0bc7bd",
               "type": "change",
               "z": "180b7e98628a2a9b",
               "name": "Temperatur",
               "rules": [
                   {
                       "t": "set",
                       "p": "payload",
                       "pt": "msg",
                       "to": "payload.Temperature",
                       "tot": "msg"
                   }
               ],
               "action": "",
               "property": "",
               "from": "",
               "to": "",
               "reg": false,
               "x": 1090,
               "y": 420,
               "wires": [
                   [
                       "30fabc8007870f62"
                   ]
               ]
           },
           {
               "id": "30fabc8007870f62",
               "type": "debug",
               "z": "180b7e98628a2a9b",
               "name": "Temperatur",
               "active": true,
               "tosidebar": true,
               "console": false,
               "tostatus": false,
               "complete": "payload",
               "targetType": "msg",
               "statusVal": "",
               "statusType": "auto",
               "x": 1290,
               "y": 420,
               "wires": []
           },
           {
               "id": "e4298053724078c1",
               "type": "switch",
               "z": "180b7e98628a2a9b",
               "name": "Objekt enthält MAC Adresse",
               "property": "payload.mac",
               "propertyType": "msg",
               "rules": [
                   {
                       "t": "nnull"
                   }
               ],
               "checkall": "true",
               "repair": false,
               "outputs": 1,
               "x": 660,
               "y": 380,
               "wires": [
                   [
                       "22cdf6ba3b189c5a"
                   ]
               ]
           }
        ]
        

        Wenn Du einzelne Datenpunkte aus Deinen JSONs haben willst, dann schau Dir mal meinen Flow an:

        https://forum.iobroker.net/topic/43856/json-oder-javascript-objekt-in-iobroker-datenpunkte-zerlegen

        Andere Adapter braucht es dafür nicht. Im Gegenteil, wenn Du auch noch andere MQTT-Kommunikation nutzen willst, stört der nur.

        Jeder Flow bzw. jedes Script, das ich hier poste implementiert jeder auf eigene Gefahr. Flows und Scripts können Fehler aufweisen und weder der Seitenbetreiber noch ich persönlich können hierfür haftbar gemacht werden. Das gleiche gilt für Empfehlungen aller Art.

        mickymM 1 Antwort Letzte Antwort
        0
        • mickymM mickym

          @jörg-w Ist zwar ein komischer EingabeString. Aber Du musst den String in einzelne Objekte zerlegen:

          b730a03e-8fb7-4c4f-b6ff-6979fd8912f6-image.png

          [
             {
                 "id": "13e50b962ea4b4ec",
                 "type": "debug",
                 "z": "180b7e98628a2a9b",
                 "name": "Temperatur",
                 "active": true,
                 "tosidebar": true,
                 "console": false,
                 "tostatus": false,
                 "complete": "payload",
                 "targetType": "msg",
                 "statusVal": "",
                 "statusType": "auto",
                 "x": 1290,
                 "y": 340,
                 "wires": []
             },
             {
                 "id": "47e53c63b917864e",
                 "type": "inject",
                 "z": "180b7e98628a2a9b",
                 "name": "",
                 "props": [
                     {
                         "p": "payload"
                     }
                 ],
                 "repeat": "",
                 "crontab": "",
                 "once": false,
                 "onceDelay": 0.1,
                 "topic": "",
                 "payload": "{\"Time\":\"2022-12-04T13:44:13\",\"ATCf44b8f\":{\"mac\":\"a4c138f44b8f\",\"Temperature\":19.9,\"Humidity\":51,\"DewPoint\":9.5,\"Btn\":1,\"Battery\":68,\"RSSI\":-42},\"ATC589a51\":{\"mac\":\"a4c138589a51\",\"Temperature\":19.6,\"Humidity\":51.8,\"DewPoint\":9.4,\"Btn\":1,\"Battery\":70,\"RSSI\":-60},\"TempUnit\":\"C\"}",
                 "payloadType": "str",
                 "x": 170,
                 "y": 380,
                 "wires": [
                     [
                         "a5a4c266b13a0cca"
                     ]
                 ]
             },
             {
                 "id": "a43792495de3a27b",
                 "type": "debug",
                 "z": "180b7e98628a2a9b",
                 "name": "Eingabe",
                 "active": false,
                 "tosidebar": true,
                 "console": false,
                 "tostatus": false,
                 "complete": "payload",
                 "targetType": "msg",
                 "statusVal": "",
                 "statusType": "auto",
                 "x": 380,
                 "y": 260,
                 "wires": []
             },
             {
                 "id": "a5a4c266b13a0cca",
                 "type": "json",
                 "z": "180b7e98628a2a9b",
                 "name": "",
                 "property": "payload",
                 "action": "",
                 "pretty": true,
                 "x": 310,
                 "y": 380,
                 "wires": [
                     [
                         "a43792495de3a27b",
                         "afd48379794b7589"
                     ]
                 ]
             },
             {
                 "id": "afd48379794b7589",
                 "type": "split",
                 "z": "180b7e98628a2a9b",
                 "name": "",
                 "splt": "\\n",
                 "spltType": "str",
                 "arraySplt": 1,
                 "arraySpltType": "len",
                 "stream": false,
                 "addname": "topic",
                 "x": 450,
                 "y": 380,
                 "wires": [
                     [
                         "e4298053724078c1"
                     ]
                 ]
             },
             {
                 "id": "22cdf6ba3b189c5a",
                 "type": "switch",
                 "z": "180b7e98628a2a9b",
                 "name": "MAC Selektor",
                 "property": "payload.mac",
                 "propertyType": "msg",
                 "rules": [
                     {
                         "t": "eq",
                         "v": "a4c138f44b8f",
                         "vt": "str"
                     },
                     {
                         "t": "eq",
                         "v": "a4c138589a51",
                         "vt": "str"
                     }
                 ],
                 "checkall": "true",
                 "repair": false,
                 "outputs": 2,
                 "x": 900,
                 "y": 380,
                 "wires": [
                     [
                         "d71445fc881d262d"
                     ],
                     [
                         "483b49ba0a0bc7bd"
                     ]
                 ]
             },
             {
                 "id": "d71445fc881d262d",
                 "type": "change",
                 "z": "180b7e98628a2a9b",
                 "name": "Temperatur",
                 "rules": [
                     {
                         "t": "set",
                         "p": "payload",
                         "pt": "msg",
                         "to": "payload.Temperature",
                         "tot": "msg"
                     }
                 ],
                 "action": "",
                 "property": "",
                 "from": "",
                 "to": "",
                 "reg": false,
                 "x": 1090,
                 "y": 340,
                 "wires": [
                     [
                         "13e50b962ea4b4ec"
                     ]
                 ]
             },
             {
                 "id": "483b49ba0a0bc7bd",
                 "type": "change",
                 "z": "180b7e98628a2a9b",
                 "name": "Temperatur",
                 "rules": [
                     {
                         "t": "set",
                         "p": "payload",
                         "pt": "msg",
                         "to": "payload.Temperature",
                         "tot": "msg"
                     }
                 ],
                 "action": "",
                 "property": "",
                 "from": "",
                 "to": "",
                 "reg": false,
                 "x": 1090,
                 "y": 420,
                 "wires": [
                     [
                         "30fabc8007870f62"
                     ]
                 ]
             },
             {
                 "id": "30fabc8007870f62",
                 "type": "debug",
                 "z": "180b7e98628a2a9b",
                 "name": "Temperatur",
                 "active": true,
                 "tosidebar": true,
                 "console": false,
                 "tostatus": false,
                 "complete": "payload",
                 "targetType": "msg",
                 "statusVal": "",
                 "statusType": "auto",
                 "x": 1290,
                 "y": 420,
                 "wires": []
             },
             {
                 "id": "e4298053724078c1",
                 "type": "switch",
                 "z": "180b7e98628a2a9b",
                 "name": "Objekt enthält MAC Adresse",
                 "property": "payload.mac",
                 "propertyType": "msg",
                 "rules": [
                     {
                         "t": "nnull"
                     }
                 ],
                 "checkall": "true",
                 "repair": false,
                 "outputs": 1,
                 "x": 660,
                 "y": 380,
                 "wires": [
                     [
                         "22cdf6ba3b189c5a"
                     ]
                 ]
             }
          ]
          

          Wenn Du einzelne Datenpunkte aus Deinen JSONs haben willst, dann schau Dir mal meinen Flow an:

          https://forum.iobroker.net/topic/43856/json-oder-javascript-objekt-in-iobroker-datenpunkte-zerlegen

          Andere Adapter braucht es dafür nicht. Im Gegenteil, wenn Du auch noch andere MQTT-Kommunikation nutzen willst, stört der nur.

          mickymM Offline
          mickymM Offline
          mickym
          Most Active
          schrieb am zuletzt editiert von mickym
          #4

          Hier noch eine einfachere Lösung mit JSONATA - (da muss ich aber auch immer erst probieren).
          Damit spart man sich den switch und selectiert nur die Objekte, die eine mac Adresse haben:

          5b9aa87f-f317-4b9e-a88e-113a310ff721-image.png

          [
              {
                  "id": "c19076460e052cbe",
                  "type": "inject",
                  "z": "289f539dcc33814e",
                  "name": "",
                  "props": [
                      {
                          "p": "payload"
                      }
                  ],
                  "repeat": "",
                  "crontab": "",
                  "once": false,
                  "onceDelay": 0.1,
                  "topic": "",
                  "payload": "{\"Time\":\"2022-12-04T13:44:13\",\"ATCf44b8f\":{\"mac\":\"a4c138f44b8f\",\"Temperature\":19.9,\"Humidity\":51,\"DewPoint\":9.5,\"Btn\":1,\"Battery\":68,\"RSSI\":-42},\"ATC589a51\":{\"mac\":\"a4c138589a51\",\"Temperature\":19.6,\"Humidity\":51.8,\"DewPoint\":9.4,\"Btn\":1,\"Battery\":70,\"RSSI\":-60},\"TempUnit\":\"C\"}",
                  "payloadType": "json",
                  "x": 190,
                  "y": 180,
                  "wires": [
                      [
                          "9ee4e3eabd877e79",
                          "a739f00f949d5b6a"
                      ]
                  ]
              },
              {
                  "id": "9ee4e3eabd877e79",
                  "type": "change",
                  "z": "289f539dcc33814e",
                  "name": "",
                  "rules": [
                      {
                          "t": "set",
                          "p": "payload",
                          "pt": "msg",
                          "to": "payload.*[mac]",
                          "tot": "jsonata"
                      }
                  ],
                  "action": "",
                  "property": "",
                  "from": "",
                  "to": "",
                  "reg": false,
                  "x": 390,
                  "y": 180,
                  "wires": [
                      [
                          "9d293f1fc9c7c077",
                          "1117c4f5f591bdd7"
                      ]
                  ]
              },
              {
                  "id": "9d293f1fc9c7c077",
                  "type": "split",
                  "z": "289f539dcc33814e",
                  "name": "",
                  "splt": "\\n",
                  "spltType": "str",
                  "arraySplt": 1,
                  "arraySpltType": "len",
                  "stream": false,
                  "addname": "",
                  "x": 570,
                  "y": 180,
                  "wires": [
                      [
                          "4fa63fbcc9b634fe"
                      ]
                  ]
              },
              {
                  "id": "fbeaa56747a92be4",
                  "type": "debug",
                  "z": "289f539dcc33814e",
                  "name": "Temperatur",
                  "active": true,
                  "tosidebar": true,
                  "console": false,
                  "tostatus": false,
                  "complete": "payload",
                  "targetType": "msg",
                  "statusVal": "",
                  "statusType": "auto",
                  "x": 1130,
                  "y": 140,
                  "wires": []
              },
              {
                  "id": "4fa63fbcc9b634fe",
                  "type": "switch",
                  "z": "289f539dcc33814e",
                  "name": "MAC Selektor",
                  "property": "payload.mac",
                  "propertyType": "msg",
                  "rules": [
                      {
                          "t": "eq",
                          "v": "a4c138f44b8f",
                          "vt": "str"
                      },
                      {
                          "t": "eq",
                          "v": "a4c138589a51",
                          "vt": "str"
                      }
                  ],
                  "checkall": "true",
                  "repair": false,
                  "outputs": 2,
                  "x": 740,
                  "y": 180,
                  "wires": [
                      [
                          "eca4ca22ec99973c"
                      ],
                      [
                          "232981fe0da01a87"
                      ]
                  ]
              },
              {
                  "id": "eca4ca22ec99973c",
                  "type": "change",
                  "z": "289f539dcc33814e",
                  "name": "Temperatur",
                  "rules": [
                      {
                          "t": "set",
                          "p": "payload",
                          "pt": "msg",
                          "to": "payload.Temperature",
                          "tot": "msg"
                      }
                  ],
                  "action": "",
                  "property": "",
                  "from": "",
                  "to": "",
                  "reg": false,
                  "x": 930,
                  "y": 140,
                  "wires": [
                      [
                          "fbeaa56747a92be4"
                      ]
                  ]
              },
              {
                  "id": "232981fe0da01a87",
                  "type": "change",
                  "z": "289f539dcc33814e",
                  "name": "Temperatur",
                  "rules": [
                      {
                          "t": "set",
                          "p": "payload",
                          "pt": "msg",
                          "to": "payload.Temperature",
                          "tot": "msg"
                      }
                  ],
                  "action": "",
                  "property": "",
                  "from": "",
                  "to": "",
                  "reg": false,
                  "x": 930,
                  "y": 220,
                  "wires": [
                      [
                          "05ebbc61b6322189"
                      ]
                  ]
              },
              {
                  "id": "05ebbc61b6322189",
                  "type": "debug",
                  "z": "289f539dcc33814e",
                  "name": "Temperatur",
                  "active": true,
                  "tosidebar": true,
                  "console": false,
                  "tostatus": false,
                  "complete": "payload",
                  "targetType": "msg",
                  "statusVal": "",
                  "statusType": "auto",
                  "x": 1130,
                  "y": 220,
                  "wires": []
              },
              {
                  "id": "1117c4f5f591bdd7",
                  "type": "debug",
                  "z": "289f539dcc33814e",
                  "name": "Ergebnisarray",
                  "active": true,
                  "tosidebar": true,
                  "console": false,
                  "tostatus": false,
                  "complete": "payload",
                  "targetType": "msg",
                  "statusVal": "",
                  "statusType": "auto",
                  "x": 620,
                  "y": 240,
                  "wires": []
              },
              {
                  "id": "a739f00f949d5b6a",
                  "type": "debug",
                  "z": "289f539dcc33814e",
                  "name": "Input",
                  "active": true,
                  "tosidebar": true,
                  "console": false,
                  "tostatus": false,
                  "complete": "payload",
                  "targetType": "msg",
                  "statusVal": "",
                  "statusType": "auto",
                  "x": 370,
                  "y": 120,
                  "wires": []
              }
          ]
          

          Dein Objekt

          {"Time":"2022-12-04T13:44:13","ATCf44b8f":{"mac":"a4c138f44b8f","Temperature":19.9,"Humidity":51,"DewPoint":9.5,"Btn":1,"Battery":68,"RSSI":-42},"ATC589a51":{"mac":"a4c138589a51","Temperature":19.6,"Humidity":51.8,"DewPoint":9.4,"Btn":1,"Battery":70,"RSSI":-60},"TempUnit":"C"}
          

          wird mit folgendem JSONATA ein Array mit Objekten (die einen Textschlüssel mit Eigenschaft "mac" - geht nur bei Typ Text - bei Zahlen benötigt man numerische Vergleiche) reduziert.

          payload.*[mac]
          

          will man im Übrigen auf Eigenschaften mit Zahlen als Wert selektieren, benötigt man die $exists() Funktion

          *[$exists(Temperature)]
          

          selektiert alle Objekte, die eine Eigenschaft Temperature enthalten.

          das Ergebnisarray kann dann einfach mit einer split Node in einzelne Nachrichten aufgeteilt werden:

          [{"mac":"a4c138f44b8f","Temperature":19.9,"Humidity":51,"DewPoint":9.5,"Btn":1,"Battery":68,"RSSI":-42},{"mac":"a4c138589a51","Temperature":19.6,"Humidity":51.8,"DewPoint":9.4,"Btn":1,"Battery":70,"RSSI":-60}]
          

          Jeder Flow bzw. jedes Script, das ich hier poste implementiert jeder auf eigene Gefahr. Flows und Scripts können Fehler aufweisen und weder der Seitenbetreiber noch ich persönlich können hierfür haftbar gemacht werden. Das gleiche gilt für Empfehlungen aller Art.

          Jörg_J 1 Antwort Letzte Antwort
          1
          • mickymM mickym

            Hier noch eine einfachere Lösung mit JSONATA - (da muss ich aber auch immer erst probieren).
            Damit spart man sich den switch und selectiert nur die Objekte, die eine mac Adresse haben:

            5b9aa87f-f317-4b9e-a88e-113a310ff721-image.png

            [
                {
                    "id": "c19076460e052cbe",
                    "type": "inject",
                    "z": "289f539dcc33814e",
                    "name": "",
                    "props": [
                        {
                            "p": "payload"
                        }
                    ],
                    "repeat": "",
                    "crontab": "",
                    "once": false,
                    "onceDelay": 0.1,
                    "topic": "",
                    "payload": "{\"Time\":\"2022-12-04T13:44:13\",\"ATCf44b8f\":{\"mac\":\"a4c138f44b8f\",\"Temperature\":19.9,\"Humidity\":51,\"DewPoint\":9.5,\"Btn\":1,\"Battery\":68,\"RSSI\":-42},\"ATC589a51\":{\"mac\":\"a4c138589a51\",\"Temperature\":19.6,\"Humidity\":51.8,\"DewPoint\":9.4,\"Btn\":1,\"Battery\":70,\"RSSI\":-60},\"TempUnit\":\"C\"}",
                    "payloadType": "json",
                    "x": 190,
                    "y": 180,
                    "wires": [
                        [
                            "9ee4e3eabd877e79",
                            "a739f00f949d5b6a"
                        ]
                    ]
                },
                {
                    "id": "9ee4e3eabd877e79",
                    "type": "change",
                    "z": "289f539dcc33814e",
                    "name": "",
                    "rules": [
                        {
                            "t": "set",
                            "p": "payload",
                            "pt": "msg",
                            "to": "payload.*[mac]",
                            "tot": "jsonata"
                        }
                    ],
                    "action": "",
                    "property": "",
                    "from": "",
                    "to": "",
                    "reg": false,
                    "x": 390,
                    "y": 180,
                    "wires": [
                        [
                            "9d293f1fc9c7c077",
                            "1117c4f5f591bdd7"
                        ]
                    ]
                },
                {
                    "id": "9d293f1fc9c7c077",
                    "type": "split",
                    "z": "289f539dcc33814e",
                    "name": "",
                    "splt": "\\n",
                    "spltType": "str",
                    "arraySplt": 1,
                    "arraySpltType": "len",
                    "stream": false,
                    "addname": "",
                    "x": 570,
                    "y": 180,
                    "wires": [
                        [
                            "4fa63fbcc9b634fe"
                        ]
                    ]
                },
                {
                    "id": "fbeaa56747a92be4",
                    "type": "debug",
                    "z": "289f539dcc33814e",
                    "name": "Temperatur",
                    "active": true,
                    "tosidebar": true,
                    "console": false,
                    "tostatus": false,
                    "complete": "payload",
                    "targetType": "msg",
                    "statusVal": "",
                    "statusType": "auto",
                    "x": 1130,
                    "y": 140,
                    "wires": []
                },
                {
                    "id": "4fa63fbcc9b634fe",
                    "type": "switch",
                    "z": "289f539dcc33814e",
                    "name": "MAC Selektor",
                    "property": "payload.mac",
                    "propertyType": "msg",
                    "rules": [
                        {
                            "t": "eq",
                            "v": "a4c138f44b8f",
                            "vt": "str"
                        },
                        {
                            "t": "eq",
                            "v": "a4c138589a51",
                            "vt": "str"
                        }
                    ],
                    "checkall": "true",
                    "repair": false,
                    "outputs": 2,
                    "x": 740,
                    "y": 180,
                    "wires": [
                        [
                            "eca4ca22ec99973c"
                        ],
                        [
                            "232981fe0da01a87"
                        ]
                    ]
                },
                {
                    "id": "eca4ca22ec99973c",
                    "type": "change",
                    "z": "289f539dcc33814e",
                    "name": "Temperatur",
                    "rules": [
                        {
                            "t": "set",
                            "p": "payload",
                            "pt": "msg",
                            "to": "payload.Temperature",
                            "tot": "msg"
                        }
                    ],
                    "action": "",
                    "property": "",
                    "from": "",
                    "to": "",
                    "reg": false,
                    "x": 930,
                    "y": 140,
                    "wires": [
                        [
                            "fbeaa56747a92be4"
                        ]
                    ]
                },
                {
                    "id": "232981fe0da01a87",
                    "type": "change",
                    "z": "289f539dcc33814e",
                    "name": "Temperatur",
                    "rules": [
                        {
                            "t": "set",
                            "p": "payload",
                            "pt": "msg",
                            "to": "payload.Temperature",
                            "tot": "msg"
                        }
                    ],
                    "action": "",
                    "property": "",
                    "from": "",
                    "to": "",
                    "reg": false,
                    "x": 930,
                    "y": 220,
                    "wires": [
                        [
                            "05ebbc61b6322189"
                        ]
                    ]
                },
                {
                    "id": "05ebbc61b6322189",
                    "type": "debug",
                    "z": "289f539dcc33814e",
                    "name": "Temperatur",
                    "active": true,
                    "tosidebar": true,
                    "console": false,
                    "tostatus": false,
                    "complete": "payload",
                    "targetType": "msg",
                    "statusVal": "",
                    "statusType": "auto",
                    "x": 1130,
                    "y": 220,
                    "wires": []
                },
                {
                    "id": "1117c4f5f591bdd7",
                    "type": "debug",
                    "z": "289f539dcc33814e",
                    "name": "Ergebnisarray",
                    "active": true,
                    "tosidebar": true,
                    "console": false,
                    "tostatus": false,
                    "complete": "payload",
                    "targetType": "msg",
                    "statusVal": "",
                    "statusType": "auto",
                    "x": 620,
                    "y": 240,
                    "wires": []
                },
                {
                    "id": "a739f00f949d5b6a",
                    "type": "debug",
                    "z": "289f539dcc33814e",
                    "name": "Input",
                    "active": true,
                    "tosidebar": true,
                    "console": false,
                    "tostatus": false,
                    "complete": "payload",
                    "targetType": "msg",
                    "statusVal": "",
                    "statusType": "auto",
                    "x": 370,
                    "y": 120,
                    "wires": []
                }
            ]
            

            Dein Objekt

            {"Time":"2022-12-04T13:44:13","ATCf44b8f":{"mac":"a4c138f44b8f","Temperature":19.9,"Humidity":51,"DewPoint":9.5,"Btn":1,"Battery":68,"RSSI":-42},"ATC589a51":{"mac":"a4c138589a51","Temperature":19.6,"Humidity":51.8,"DewPoint":9.4,"Btn":1,"Battery":70,"RSSI":-60},"TempUnit":"C"}
            

            wird mit folgendem JSONATA ein Array mit Objekten (die einen Textschlüssel mit Eigenschaft "mac" - geht nur bei Typ Text - bei Zahlen benötigt man numerische Vergleiche) reduziert.

            payload.*[mac]
            

            will man im Übrigen auf Eigenschaften mit Zahlen als Wert selektieren, benötigt man die $exists() Funktion

            *[$exists(Temperature)]
            

            selektiert alle Objekte, die eine Eigenschaft Temperature enthalten.

            das Ergebnisarray kann dann einfach mit einer split Node in einzelne Nachrichten aufgeteilt werden:

            [{"mac":"a4c138f44b8f","Temperature":19.9,"Humidity":51,"DewPoint":9.5,"Btn":1,"Battery":68,"RSSI":-42},{"mac":"a4c138589a51","Temperature":19.6,"Humidity":51.8,"DewPoint":9.4,"Btn":1,"Battery":70,"RSSI":-60}]
            
            Jörg_J Offline
            Jörg_J Offline
            Jörg_
            schrieb am zuletzt editiert von Jörg_
            #5

            @mickym

            ging ja schneller als gedacht :)

            peferkt besten Dank läuft jetzt wie gewüscht ;) !!!

            1 Antwort Letzte Antwort
            0

            Hey! Du scheinst an dieser Unterhaltung interessiert zu sein, hast aber noch kein Konto.

            Hast du es satt, bei jedem Besuch durch die gleichen Beiträge zu scrollen? Wenn du dich für ein Konto anmeldest, kommst du immer genau dorthin zurück, wo du zuvor warst, und kannst dich über neue Antworten benachrichtigen lassen (entweder per E-Mail oder Push-Benachrichtigung). Du kannst auch Lesezeichen speichern und Beiträge positiv bewerten, um anderen Community-Mitgliedern deine Wertschätzung zu zeigen.

            Mit deinem Input könnte dieser Beitrag noch besser werden 💗

            Registrieren Anmelden
            Antworten
            • In einem neuen Thema antworten
            Anmelden zum Antworten
            • Älteste zuerst
            • Neuste zuerst
            • Meiste Stimmen


            Support us

            ioBroker
            Community Adapters
            Donate

            258

            Online

            32.9k

            Benutzer

            82.9k

            Themen

            1.3m

            Beiträge
            Community
            Impressum | Datenschutz-Bestimmungen | Nutzungsbedingungen | Einwilligungseinstellungen
            ioBroker Community 2014-2025
            logo
            • Anmelden

            • Du hast noch kein Konto? Registrieren

            • Anmelden oder registrieren, um zu suchen
            • Erster Beitrag
              Letzter Beitrag
            0
            • Home
            • Aktuell
            • Tags
            • Ungelesen 0
            • Kategorien
            • Unreplied
            • Beliebt
            • GitHub
            • Docu
            • Hilfe