Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Skripten / Logik
    4. JavaScript
    5. Shellypw/ mqtt einstellungen ä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

    Shellypw/ mqtt einstellungen ändern.

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

      Hallo,

      ich habe viele Shelly Geräte.
      Nun möchte ich allerdings aus diversen Gründen die Authentifizierung und die mqtt Einstellungen ändern.
      Hat jemand eine funktnionierendes Script, oder könnte mir helfen dies zu entwerfen?
      Aktuell habe ich dank ChatGPT das hier:

      const axios = require('axios');
      
      // URL deines Shelly-Geräts
      const shellyIp = 'https://192.168.2.67';  // Wenn dein Gerät HTTPS unterstützt
      
      // Altes Passwort und neues Passwort
      const altesPasswort = 'myOldPw';
      const neuesPasswort = 'myNewPw';
      
      // Authentifizierungsdaten für die Basis-Authentifizierung
      const username = 'admin';  // Standard-Benutzername
      const password = altesPasswort;  // Altes Passwort
      
      async function changePassword() {
          try {
              // API-Anfrage, um das Passwort zu ändern
              const response = await axios.post(`${shellyIp}/settings`, {
                  old_password: altesPasswort,  // altes Passwort
                  admin_password: neuesPasswort  // neues Passwort
              }, {
                  auth: {
                      username: username,  // Benutzernamen für die Authentifizierung
                      password: password    // Altes Passwort für die Authentifizierung
                  }
              });
      
              console.log('Passwort erfolgreich geändert:', response.data);
          } catch (error) {
              console.error('Fehler beim Ändern des Passworts:', error.response ? error.response.data : error.message);
          }
      }
      
      changePassword();
      

      Das funktioniert allerdings nicht...
      Es führt zu:

      script.js.A_Shelly.Passwortumstellung: Fehler beim Ändern des Passworts:
      
      1 Reply Last reply Reply Quote 0
      • First post
        Last post

      Support us

      ioBroker
      Community Adapters
      Donate

      692
      Online

      31.8k
      Users

      80.0k
      Topics

      1.3m
      Posts

      1
      1
      62
      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