Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Skripten / Logik
    4. Iobroker, Wert von mysensors an CCU übergeben

    NEWS

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

    • ioBroker goes Matter ... Matter Adapter in Stable

    • Monatsrückblick - April 2025

    Iobroker, Wert von mysensors an CCU übergeben

    This topic has been deleted. Only users with topic management privileges can see it.
    • I
      iobroker-6043 last edited by

      Hallo Community

      Kriege meine Temperaturwerde von mysensors/nodeMCU TempSensor.

      Möchte diesen Wert in eine CCU Systemvariable schreiben.

      setState('hm-rega.0.5237', '"mysensors.0.192_168_1_103.0.0_TEMP.V_TEMP"/192_168_1_103.0.0_TEMP.V_TEMP/');

      {

      "common": {

      "name": "192_168_1_103.0.0_TEMP.V_TEMP",

      "type": "string",

      "role": "value.temperature",

      "min": 0,

      "def": 0,

      "read": true,

      "write": false

      },

      "native": {

      "ip": "192.168.1.103",

      "id": "0",

      "childId": "0",

      "subType": "S_TEMP",

      "varType": "V_TEMP",

      "subTypeNum": 6,

      "varTypeNum": 0

      },

      "acl": {

      "object": 1638,

      "owner": "system.user.admin",

      "ownerGroup": "system.group.administrator",

      "state": 1638

      },

      "_id": "mysensors.0.192_168_1_103.0.0_TEMP.V_TEMP",

      "type": "state"

      }

      1 Reply Last reply Reply Quote 0
      • paul53
        paul53 last edited by

        Das Datenpunktobjekt hat eine falschen "type": "string"; es sollte "type": "number" sein. Außerdem fehlt "unit": "°C".

        {
        "common": {
        "name": "192_168_1_103.0.0_TEMP.V_TEMP",
        "type": "number",
        "role": "value.temperature",
        "min": 0,
        "def": 0,
        "read": true,
        "write": false,
        "unit": "°C"
        },
        "native": {
        "ip": "192.168.1.103",
        "id": "0",
        "childId": "0",
        "subType": "S_TEMP",
        "varType": "V_TEMP",
        "subTypeNum": 6,
        "varTypeNum": 0
        },
        "acl": {
        "object": 1638,
        "owner": "system.user.admin",
        "ownerGroup": "system.group.administrator",
        "state": 1638
        },
        "_id": "mysensors.0.192_168_1_103.0.0_TEMP.V_TEMP",
        "type": "state"
        }
        

        Wenn die Werte vom Typ "number" sind:

        setState('hm-rega.0.5237', getState('mysensors.0.192_168_1_103.0.0_TEMP.V_TEMP').val);
        

        Wenn die Werte aber vom Typ "string" sind, dann:

        setState('hm-rega.0.5237', parseFloat(getState('mysensors.0.192_168_1_103.0.0_TEMP.V_TEMP').val));
        

        Den Typ kann man testen:

        log('Typ: ' + typeof getState('mysensors.0.192_168_1_103.0.0_TEMP.V_TEMP').val);
        
        1 Reply Last reply Reply Quote 0
        • First post
          Last post

        Support us

        ioBroker
        Community Adapters
        Donate

        1.0k
        Online

        31.7k
        Users

        79.7k
        Topics

        1.3m
        Posts

        2
        2
        579
        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