Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Skripten / Logik
    4. JavaScript
    5. Adapter-Einstellungen zur Laufzeit verändern

    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

    Adapter-Einstellungen zur Laufzeit verändern

    This topic has been deleted. Only users with topic management privileges can see it.
    • M
      MCU @hansmann2401 last edited by MCU

      @hansmann2401 War schon richtig nur dort die Objekt-Eigenschaften.
      -> e84405df-7c74-443b-8327-cb90afdd6203-image.png
      deb63bae-8ee9-4613-bc2c-4a2245bac905-image.png
      ->
      660a9c18-57dd-4b44-a56b-ce0204052091-image.png
      Also bei Dir system.adapter.ford und ...ford.0

      H 1 Reply Last reply Reply Quote 0
      • H
        hansmann2401 @MCU last edited by

        @mcu

        Ahhh, ok:

        {
        "_id": "system.adapter.ford",
        "type": "adapter",
        "common": {
        "name": "ford",
        "version": "0.0.14",
        "title": "Ford",
        "titleLang": {
        "en": "Ford",
        "de": "Ford",
        "ru": "Форд",
        "pt": "Ford",
        "nl": "Ford",
        "fr": "Gué",
        "it": "Guado",
        "es": "Vado",
        "pl": "Bród",
        "zh-cn": "福特"
        },
        "desc": {
        "en": "Adapter for FordPass",
        "de": "Adapter für FordPass",
        "ru": "Адаптер для FordPass",
        "pt": "Adaptador para FordPass",
        "nl": "Adapter voor FordPass",
        "fr": "Adaptateur pour FordPass",
        "it": "Adattatore per FordPass",
        "es": "Adaptador para FordPass",
        "pl": "Adapter do FordPass",
        "zh-cn": "FordPass 适配器"
        },
        "authors": [
        "TA2k tombox2020@gmail.com"
        ],
        "keywords": [
        "ford",
        "FordPass"
        ],
        "license": "MIT",
        "platform": "Javascript/Node.js",
        "main": "main.js",
        "icon": "ford.png",
        "enabled": true,
        "extIcon": "https://raw.githubusercontent.com/TA2k/ioBroker.ford/master/admin/ford.png",
        "readme": "https://github.com/TA2k/ioBroker.ford/blob/master/README.md",
        "loglevel": "info",
        "mode": "daemon",
        "type": "vehicle",
        "compact": true,
        "connectionType": "cloud",
        "dataSource": "poll",
        "materialize": true,
        "plugins": {
        "sentry": {
        "dsn": "https://c6109f629f7f4212ba9375a55670d6ce@sentry.iobroker.net/158"
        }
        },
        "dependencies": [
        {
        "js-controller": ">=3.0.0"
        }
        ],
        "globalDependencies": [
        {
        "admin": ">=4.0.9"
        }
        ],
        "installedFrom": "iobroker.ford@0.0.14",
        "installedVersion": "0.0.14"
        },
        "native": {
        "username": "",
        "password": "",
        "interval": 5,
        "forceUpdate": true
        },
        "from": "system.host.iobroker_prod.cli",
        "ts": 1677440595962,
        "acl": {
        "object": 1636,
        "owner": "system.user.admin",
        "ownerGroup": "system.group.administrator"
        },
        "protectedNative": [
        "password"
        ],
        "encryptedNative": [
        "password"
        ],
        "notifications": [],
        "instanceObjects": [
        {
        "_id": "info",
        "type": "channel",
        "common": {
        "name": "Information"
        },
        "native": {}
        },
        {
        "_id": "info.connection",
        "type": "state",
        "common": {
        "role": "indicator.connected",
        "name": "Device or service connected",
        "type": "boolean",
        "read": true,
        "write": false,
        "def": false
        },
        "native": {}
        }
        ],
        "objects": []
        }

        M H 2 Replies Last reply Reply Quote 0
        • M
          MCU @hansmann2401 last edited by

          @hansmann2401
          2f6ca2d7-15ab-4ee0-9bb3-186858ada390-image.png

          1 Reply Last reply Reply Quote 0
          • H
            hansmann2401 @hansmann2401 last edited by

            Und hier von der 0.Instanz:

            {
            "_id": "system.adapter.ford.0",
            "type": "instance",
            "common": {
            "name": "ford",
            "version": "0.0.14",
            "title": "Ford",
            "titleLang": {
            "en": "Ford",
            "de": "Ford",
            "ru": "Форд",
            "pt": "Ford",
            "nl": "Ford",
            "fr": "Gué",
            "it": "Guado",
            "es": "Vado",
            "pl": "Bród",
            "zh-cn": "福特"
            },
            "desc": {
            "en": "Adapter for FordPass",
            "de": "Adapter für FordPass",
            "ru": "Адаптер для FordPass",
            "pt": "Adaptador para FordPass",
            "nl": "Adapter voor FordPass",
            "fr": "Adaptateur pour FordPass",
            "it": "Adattatore per FordPass",
            "es": "Adaptador para FordPass",
            "pl": "Adapter do FordPass",
            "zh-cn": "FordPass 适配器"
            },
            "authors": [
            "TA2k tombox2020@gmail.com"
            ],
            "keywords": [
            "ford",
            "FordPass"
            ],
            "license": "MIT",
            "platform": "Javascript/Node.js",
            "main": "main.js",
            "icon": "ford.png",
            "enabled": true,
            "extIcon": "https://raw.githubusercontent.com/TA2k/ioBroker.ford/master/admin/ford.png",
            "readme": "https://github.com/TA2k/ioBroker.ford/blob/master/README.md",
            "loglevel": "info",
            "mode": "daemon",
            "type": "vehicle",
            "compact": true,
            "connectionType": "cloud",
            "dataSource": "poll",
            "materialize": true,
            "plugins": {
            "sentry": {
            "dsn": "https://c6109f629f7f4212ba9375a55670d6ce@sentry.iobroker.net/158"
            }
            },
            "dependencies": [
            {
            "js-controller": ">=3.0.0"
            }
            ],
            "globalDependencies": [
            {
            "admin": ">=4.0.9"
            }
            ],
            "installedFrom": "iobroker.ford@0.0.14",
            "installedVersion": "0.0.14",
            "host": "iobroker_prod"
            },
            "native": {
            "username": "@",
            "password": "xxxxxx",
            "interval": 20, <- das möchte ich verändern!
            "forceUpdate": true
            },
            "from": "system.host.iobroker_prod.cli",
            "ts": xxxxxxxxxxxxxxxxxxxxxxxxxxx,
            "acl": {
            "object": 1636,
            "owner": "system.user.admin",
            "ownerGroup": "system.group.administrator"
            },
            "protectedNative": [
            "password"
            ],
            "encryptedNative": [
            "password"
            ],
            "notifications": [],
            "instanceObjects": [
            {
            "_id": "info",
            "type": "channel",
            "common": {
            "name": "Information"
            },
            "native": {}
            },
            {
            "_id": "info.connection",
            "type": "state",
            "common": {
            "role": "indicator.connected",
            "name": "Device or service connected",
            "type": "boolean",
            "read": true,
            "write": false,
            "def": false
            },
            "native": {}
            }
            ],
            "objects": [],
            "user": "system.user.admin"
            }

            M paul53 2 Replies Last reply Reply Quote 0
            • M
              MCU @hansmann2401 last edited by MCU

              @hansmann2401 javascript ist ok?
              Solche Daten bitte grundsätzlich in Code-Tags
              -> markieren und 27997be5-95d1-4b5f-8612-d6f522988714-image.png klicken. Danke.

              H 1 Reply Last reply Reply Quote 0
              • H
                hansmann2401 @MCU last edited by

                @mcu
                Ok, sorry, war schon spät...;-)

                Javascript ist ok.

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

                  @hansmann2401 sagte: "interval": 20, <- das möchte ich verändern!

                  const idInst = 'system.adapter.ford.0';
                  const objInst = getObject(idInst);
                  
                  schedule('0 * * * *', function() {
                      let interval = 20;
                      let hour = new Date().getHours();
                      if(hour >= 6 && hour <= 10) interval = 30; // Tageszeit
                      if(objInst.native.interval != interval) {
                          objInst.common.enabled = false; //stop
                          objInst.native.interval = interval;
                          setObject(idInst, objInst);
                          setTimeout(function() {
                              objInst.common.enabled = true; // start
                              setObject(idInst, objInst);
                          }, 500);
                      }
                  });
                  
                  H 2 Replies Last reply Reply Quote 0
                  • H
                    hansmann2401 @paul53 last edited by

                    @paul53

                    Vielen lieben Dank!
                    Ich werde es ausprobieren und berichten...
                    VG vom Niederrhein!

                    1 Reply Last reply Reply Quote 0
                    • H
                      hansmann2401 @paul53 last edited by

                      @paul53 :

                      Hallo, das Auslesen des Ist-Wertes klappt, aber das Stoppen, Interval-Verändern und wieder Starten klappen leider nicht...
                      Keine Veränderung und kein Neustart.

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

                        @hansmann2401 sagte: Stoppen, Interval-Verändern und wieder Starten klappen leider nicht...

                        In der Konfiguration der JS-Instanz ist "setObject" freigegeben?

                        JS-Konfig.JPG

                        H 1 Reply Last reply Reply Quote 0
                        • H
                          hansmann2401 @paul53 last edited by

                          @paul53 :

                          Das war es gewesen....jetzt funzt es!
                          Vielen Dank Paul53!

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

                          Support us

                          ioBroker
                          Community Adapters
                          Donate

                          557
                          Online

                          31.9k
                          Users

                          80.1k
                          Topics

                          1.3m
                          Posts

                          3
                          14
                          588
                          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