Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. sinky

    NEWS

    • Neues Video "KI im Smart Home" - ioBroker plus n8n

    • Neues Video über Aliase, virtuelle Geräte und Kategorien

    • Wir empfehlen: Node.js 22.x

    • Profile
    • Following 0
    • Followers 0
    • Topics 1
    • Posts 2
    • Best 0
    • Groups 0

    sinky

    @sinky

    0
    Reputation
    3
    Profile views
    2
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    sinky Follow

    Latest posts made by sinky

    • RE: Vis Binding mit Zahl funktioniert nicht

      Hä, mit einem Testdatenpunkt funktioniert es bei mir dann auch.

      So sieht der problematische Datenpunkt aus

      {
        "type": "state",
        "common": {
          "name": "1-0:16_7_0__255.value",
          "type": "number",
          "read": true,
          "unit": "W",
          "role": "value",
          "write": false,
          "custom": {
            "influxdb.0": {
              "enabled": true,
              "storageType": "",
              "aliasId": "",
              "changesOnly": false,
              "debounce": 1000,
              "changesRelogInterval": 0,
              "changesMinDelta": 0,
              "debounceTime": 0,
              "blockTime": 60000,
              "ignoreBelowNumber": "",
              "disableSkippedValueLogging": false,
              "enableDebugLogs": false
            }
          }
        },
        "native": {
          "id": "1-0:16_7_0__255.value"
        },
        "_id": "smartmeter.0.1-0:16_7_0__255.value",
        "acl": {
          "object": 1636,
          "state": 1636,
          "ownerGroup": "system.group.administrator"
        },
        "from": "system.adapter.admin.0",
        "user": "system.user.admin",
        "ts": 1673021874671
      }
      

      Wie bekomme ich das jetzt mit diesem Datenpunkt hin?

      Gruß Marco

      posted in Visualisierung
      sinky
      sinky
    • Vis Binding mit Zahl funktioniert nicht

      Hallo, ich möchte in die CSS Farbe eine IF Abfrage einbauen.

      {x:smartmeter.0.1-0:16_7_0__255.value; parseFloat(x) < 1 ? "#ffc404" : "red"}
      

      Aber es ist immer RED egal ob der Wert über oder unter 1 liegt.
      Ein Test im HTML Widget zeigt das Problem:

      {smartmeter.0.1-0:16_7_0__255.value} <br/>
      {x:smartmeter.0.1-0:16_7_0__255.value; typeof x} <br/>
      {x:smartmeter.0.1-0:16_7_0__255.value; typeof parseFloat(x)} <br/>
      {x:smartmeter.0.1-0:16_7_0__255.value; parseFloat(x)} <br/>
      {x:smartmeter.0.1-0:16_7_0__255.value; parseFloat(x) < 1} <br/>
      

      Ergibt folgende Ausgabe in der View

      -148.53
      string
      number
      NaN
      false 
      

      typeof parseFloat funktioniert wie erwartet und gibt eine number zurück.
      Aber bei der folgenden Zeile ist es dann NaN

      Wo sitzt der Fehler?

      Grüße Marco

      posted in Visualisierung
      sinky
      sinky
    Community
    Impressum | Datenschutz-Bestimmungen | Nutzungsbedingungen
    The ioBroker Community 2014-2023
    logo