Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Entwicklung
    4. Aus Adapter Zugriff auf Breitengrad, Längengrad

    NEWS

    • Neuer Blog: Fotos und Eindrücke aus Solingen

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

    • ioBroker goes Matter ... Matter Adapter in Stable

    Aus Adapter Zugriff auf Breitengrad, Längengrad

    This topic has been deleted. Only users with topic management privileges can see it.
    • P
      peter_n last edited by peter_n

      Hallo,
      ich möchte in einem Adapter auf die Konfigurationsdaten der Basiseinstellungen (Breitengrad, Längengrad zugreifen)

      Beispiel in main.js des Adapters:

      let systemConfig = this.getObject('system.config');
      

      liefert undefined!

      Danke!

      UncleSam 1 Reply Last reply Reply Quote 0
      • UncleSam
        UncleSam Developer @peter_n last edited by

        @peter_n Die Lösung lautet: getForeignObject

        P 1 Reply Last reply Reply Quote 1
        • P
          peter_n @UncleSam last edited by

          @unclesam

          Danke!
          Aber irgendwas passt noch nicht: 'system.adapter.config' und 'system.config' liefern systemConfig = "undefined"

              let systemConfig = this.getForeignObject('system.adapter.config', () => {
                  if (this.systemConfig) {
                      this.log.debug(`latitude: ${systemConfig.common.latitude}`);
                      this.log.debug(`longitude: ${systemConfig.common.longitude}`);     
                  } 
                  else {
                      this.log.debug(`this.systemConfig: ${this.systemConfig}`);
                  }
              });
          P 1 Reply Last reply Reply Quote 0
          • P
            peter_n @peter_n last edited by

            @UncleSam

            Ok! Now its working

            this.getForeignObject('system.config', (err, data) => {
              if (data && data.common) {
                  this.longitude = data.common.longitude;
                  this.latitude = data.common.latitude; 
              }
            })
            

            Thanks

            1 Reply Last reply Reply Quote 0
            • First post
              Last post

            Support us

            ioBroker
            Community Adapters
            Donate

            845
            Online

            31.9k
            Users

            80.1k
            Topics

            1.3m
            Posts

            [gelöst]
            2
            4
            252
            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