Skip to content
  • Recent
  • Tags
  • 0 Unread 0
  • Categories
  • Unreplied
  • Popular
  • GitHub
  • Docu
  • Hilfe
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Logo
  1. ioBroker Community Home
  2. Deutsch
  3. Skripten / Logik
  4. Was heisst 'Wrong type of X: "string", wenn das X doch ein "object" ist?

NEWS

  • Wartung am 15.11. – Forum ab 22:00 Uhr nicht erreichbar
    BluefoxB
    Bluefox
    12
    2
    278

  • UPDATE 31.10.: Amazon Alexa - ioBroker Skill läuft aus ?
    apollon77A
    apollon77
    48
    3
    8.0k

  • Monatsrückblick – September 2025
    BluefoxB
    Bluefox
    13
    1
    1.7k

Was heisst 'Wrong type of X: "string", wenn das X doch ein "object" ist?

Was heisst 'Wrong type of X: "string", wenn das X doch ein "object" ist?

Scheduled Pinned Locked Moved Skripten / Logik
1 Posts 1 Posters 315 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    adarof
    wrote on last edited by
    #1

    Hallo,

    Habe mir manuell ein paar Objekt angelegt, die ich mit einem javascript beschreibe.

    Dabei erscheint bei mir im Log:

    javascript.0	2017-12-26 17:55:13.936	warn	at Object. (script.js.common.dwd-highestSeverity2:11:3)
    javascript.0	2017-12-26 17:55:13.928	warn	Wrong type of admin.0.dwd-HighestForecast.object: "string". Please fix, while deprecated and will not work in next versions.
    

    Dabei ist der betreffende Datenpunkt 'admin.0.dwd-HighestForecast.object' aber garkein "string" sondern ein "object". Hier die "raw" Infos davon:

    {
      "common": {
        "name": "object",
        "role": "",
        "type": "object",
        "desc": "Manuell erzeugt",
        "read": true,
        "write": true
      },
      "native": {},
      "acl": {
        "object": 1638,
        "owner": "system.user.admin",
        "ownerGroup": "system.group.administrator",
        "state": 1638
      },
      "_id": "admin.0.dwd-HighestForecast.object",
      "type": "state"
    }
    
    

    Beschreiben tue ich in dieser Art und Weise:

    setState("admin.0.dwd-HighestForecast.object"/*object*/, getState("dwd.0.warning.object").val, true);
    

    Wobei der Quell-Datenpunkt eine gleiche definition hat (nämlich aus dem DWD Adapter, wie man sicherlich leicht erraten kann).

    Was möchte mir die Meldung also sagen?

    Update: Glaube ich habs etwas verstanden:

    Mein .val liefert mir vom Quell-Objekt einen JSON-String; den weise ich dann durch das setState dem Ziel-Objekt zu, was zu der Warnung führt.

    Wie erstelle ich denn ein Kopie eines Objekte und weise sie zu "the ioBroker way" ?

    Gruss

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    Support us

    ioBroker
    Community Adapters
    Donate

    212

    Online

    32.4k

    Users

    81.3k

    Topics

    1.3m

    Posts
    Community
    Impressum | Datenschutz-Bestimmungen | Nutzungsbedingungen
    ioBroker Community 2014-2025
    logo
    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Recent
    • Tags
    • Unread 0
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe