Skip to content
  • Home
  • 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
ioBroker Logo

Community Forum

donate donate
  1. ioBroker Community Home
  2. Deutsch
  3. Entwicklung
  4. [gelöst] Wie einen Pfad zusammensetzen

NEWS

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

  • Jahresrückblick 2025 – unser neuer Blogbeitrag ist online! ✨
    BluefoxB
    Bluefox
    18
    1
    6.2k

  • Neuer Blogbeitrag: Monatsrückblick - Dezember 2025 🎄
    BluefoxB
    Bluefox
    13
    1
    1.5k

[gelöst] Wie einen Pfad zusammensetzen

Scheduled Pinned Locked Moved Entwicklung
3 Posts 2 Posters 402 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.
  • PeoplesP Offline
    PeoplesP Offline
    Peoples
    wrote on last edited by
    #1

    Hi,

    ich habe mal wieder ein Problem das wahrscheinlich für einen Profi nur ein klacks ist. Ich versuche gerade das Backupscript in einem Adapter zum laufen zu bekommen, doch scheitere schon an der dynamischen Zusammensetzung des Pfades.

    In meinem Script habe ich ein Array (Backup) und verarbeite die dort eingetragenen Werte (minimal,komplett,ccu) in einer Schleife weiter aus:

    function BackupStellen() {
        Backup.forEach(function(Bkp) {
        log(getState(instanz + pfad0 + 'Einstellungen.' + Bkp[0] +'.BackupZeit').val)
    
    

    Wenn ich nun beim Adapter den "Backuptyp" dynamisch machen will scheitere ich kläglich.

    Folgendes funktioniert:

    adapter.log.info('config minimal_BackupState: '    + adapter.config.minimal_BackupState);
    adapter.log.info('config ccu_BackupState: '    + adapter.config.ccu_BackupState);
    adapter.log.info('config komplett_BackupState: '    + adapter.config.komplett_BackupState);
    
    

    Wenn ich das nun wie oben über die Schleife machen möchte klappt das leider nicht

    function BackupStellen() {
        Backup.forEach(function(Bkp) {
    adapter.log.info(adapter.config.Bkp[0]+'_BackupState');
    
    });
    }
    

    Wie ist der Syntax damit das "adapter.config" sowie "_BackupState" immer gleich jedoch das Bkp[0] dynamisch mit den anderen Daten verknüpfbar sind?

    Vielleicht kann hier mal einer Licht ins Dunkel bringen.

    Ich beantworte keine Fragen zu Themen via PN

    1 Reply Last reply
    0
    • apollon77A Offline
      apollon77A Offline
      apollon77
      wrote on last edited by
      #2

      Naja

      adapter.config.Bkp … und davon Index 0 gibt es nicht.

      Was Du willst ist:

      adapter.config[Bkp[0]+'_BackupState']

      … also vom Objekte config den key "Bkp[0]+'_BackupState'"

      Beitrag hat geholfen? Votet rechts unten im Beitrag :-) https://paypal.me/Apollon77 / https://github.com/sponsors/Apollon77

      • Debug-Log für Instanz einschalten? Admin -> Instanzen -> Expertenmodus -> Instanz aufklappen - Loglevel ändern
      • Logfiles auf Platte /opt/iobroker/log/… nutzen, Admin schneidet Zeilen ab
      1 Reply Last reply
      0
      • PeoplesP Offline
        PeoplesP Offline
        Peoples
        wrote on last edited by
        #3

        Das meinte ich mit "für Profis ein Klacks"

        Dank dir!

        Ich beantworte keine Fragen zu Themen via PN

        1 Reply Last reply
        0

        Hello! It looks like you're interested in this conversation, but you don't have an account yet.

        Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

        With your input, this post could be even better 💗

        Register Login
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        Support us

        ioBroker
        Community Adapters
        Donate

        384

        Online

        32.8k

        Users

        82.7k

        Topics

        1.3m

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

        • Don't have an account? Register

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