Skip to content
  • Home
  • Aktuell
  • Tags
  • 0 Ungelesen 0
  • Kategorien
  • Unreplied
  • Beliebt
  • 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

  • Standard: (Kein Skin)
  • Kein Skin
Einklappen
ioBroker Logo

Community Forum

  1. ioBroker Community Home
  2. Deutsch
  3. ioBroker Allgemein
  4. Unifi Steuern ohne Adapter (Script,SSH)

NEWS

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

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

  • Neues Video "KI im Smart Home" - ioBroker plus n8n
    BluefoxB
    Bluefox
    15
    1
    2.6k

Unifi Steuern ohne Adapter (Script,SSH)

Geplant Angeheftet Gesperrt Verschoben ioBroker Allgemein
152 Beiträge 16 Kommentatoren 26.2k Aufrufe 4 Watching
  • Älteste zuerst
  • Neuste zuerst
  • Meiste Stimmen
Antworten
  • In einem neuen Thema antworten
Anmelden zum Antworten
Dieses Thema wurde gelöscht. Nur Nutzer mit entsprechenden Rechten können es sehen.
  • draexlerD draexler

    @ilovegym Kann man über ssh auch voucher für gästewlan generieren?

    liv-in-skyL Offline
    liv-in-skyL Offline
    liv-in-sky
    schrieb am zuletzt editiert von
    #21

    @draexler sagte in Adapter: ioBroker.unifi:

    @ilovegym Kann man über ssh auch voucher für gästewlan generieren?

    teste mal das - da kannst du angeblich vouchers anlegen - habe die nicht aktiviert, daher kann ich nicht testen

    du musst die node-unifi in die zusätzlichen npm module in der js.instanz eintragen

    const Unifi = require('node-unifi');
    
    const unifi = new Unifi.Controller({hostname:"192.168.178.xx",port:'8443', sslverify: false});
    
    (async () => {
      try {
        // LOGIN
        const loginData = await unifi.login('user', 'password!');
        console.log('login: ' + loginData);
       
    
    
       //const switchmac="b4:fb:e4:f3:96:63"
        // Get data from a specific unifi device based on MAC address
        //const deviceData = await unifi.getAccessDevices(switchmac);
        // Console.log('getAccessDevices: ' + JSON.stringify(deviceData));
    
        // Get device id
        //const deviceId = deviceData[0]._id;
        //console.log('deviceId: ' + deviceId + ' ip: ' + deviceData[0].ip);
    
     // GET SITE STATS
       // const sites = await unifi.getSitesStats();
       // console.log('getSitesStats: ' + sites[0].name + ':' + sites.length);
       // console.log(JSON.stringify(sites));
    
        // GET SITE SYSINFO
       // const sysinfo = await unifi.getSiteSysinfo();
       // console.log('getSiteSysinfo: ' + sysinfo.length);
        //console.log(JSON.stringify(sysinfo));
    
        // GET CLIENT DEVICES
      //  const clientData = await unifi.getClientDevices();
       // console.log('getClientDevices: ' + clientData.length);
       // console.log(JSON.stringify(clientData));
    
        // GET ALL USERS EVER CONNECTED
        //const usersData = await unifi.getAllUsers();
        //console.log('getAllUsers: ' + usersData.length);
        //console.log(JSON.stringify(usersData));
    
        const clientVoucher = await unifi.createVouchers(123,1,0,"testthis");
    
        // LOGOUT
        const logoutData = await unifi.logout();
        console.log('logout: ' + JSON.stringify(logoutData));
      } catch (error) {
        console.log('ERROR: ' + error);
      }
    })();
    
    

    nach einem gelösten Thread wäre es sinnvoll dies in der Überschrift des ersten Posts einzutragen [gelöst]-... Bitte benutzt das Voting rechts unten im Beitrag wenn er euch geholfen hat. Forum-Tools: PicPick https://picpick.app/en/download/ und ScreenToGif https://www.screentogif.com/downloads.html

    draexlerD 1 Antwort Letzte Antwort
    0
    • liv-in-skyL liv-in-sky

      @draexler sagte in Adapter: ioBroker.unifi:

      @ilovegym Kann man über ssh auch voucher für gästewlan generieren?

      teste mal das - da kannst du angeblich vouchers anlegen - habe die nicht aktiviert, daher kann ich nicht testen

      du musst die node-unifi in die zusätzlichen npm module in der js.instanz eintragen

      const Unifi = require('node-unifi');
      
      const unifi = new Unifi.Controller({hostname:"192.168.178.xx",port:'8443', sslverify: false});
      
      (async () => {
        try {
          // LOGIN
          const loginData = await unifi.login('user', 'password!');
          console.log('login: ' + loginData);
         
      
      
         //const switchmac="b4:fb:e4:f3:96:63"
          // Get data from a specific unifi device based on MAC address
          //const deviceData = await unifi.getAccessDevices(switchmac);
          // Console.log('getAccessDevices: ' + JSON.stringify(deviceData));
      
          // Get device id
          //const deviceId = deviceData[0]._id;
          //console.log('deviceId: ' + deviceId + ' ip: ' + deviceData[0].ip);
      
       // GET SITE STATS
         // const sites = await unifi.getSitesStats();
         // console.log('getSitesStats: ' + sites[0].name + ':' + sites.length);
         // console.log(JSON.stringify(sites));
      
          // GET SITE SYSINFO
         // const sysinfo = await unifi.getSiteSysinfo();
         // console.log('getSiteSysinfo: ' + sysinfo.length);
          //console.log(JSON.stringify(sysinfo));
      
          // GET CLIENT DEVICES
        //  const clientData = await unifi.getClientDevices();
         // console.log('getClientDevices: ' + clientData.length);
         // console.log(JSON.stringify(clientData));
      
          // GET ALL USERS EVER CONNECTED
          //const usersData = await unifi.getAllUsers();
          //console.log('getAllUsers: ' + usersData.length);
          //console.log(JSON.stringify(usersData));
      
          const clientVoucher = await unifi.createVouchers(123,1,0,"testthis");
      
          // LOGOUT
          const logoutData = await unifi.logout();
          console.log('logout: ' + JSON.stringify(logoutData));
        } catch (error) {
          console.log('ERROR: ' + error);
        }
      })();
      
      
      draexlerD Nicht stören
      draexlerD Nicht stören
      draexler
      schrieb am zuletzt editiert von
      #22

      @liv-in-sky Hört sich schon mal gut an. Also trage ich einfach in der js.instanz bei den npm Komponenten "node-unifi" ein? Wenn ja, wie geht es dann weiter? Arbeite wie die meisten hier nur mit Blockly...

      liv-in-skyL 2 Antworten Letzte Antwort
      0
      • draexlerD draexler

        @liv-in-sky Hört sich schon mal gut an. Also trage ich einfach in der js.instanz bei den npm Komponenten "node-unifi" ein? Wenn ja, wie geht es dann weiter? Arbeite wie die meisten hier nur mit Blockly...

        liv-in-skyL Offline
        liv-in-skyL Offline
        liv-in-sky
        schrieb am zuletzt editiert von liv-in-sky
        #23

        @draexler sagte in Adapter: ioBroker.unifi:

        Also trage ich einfach in der js.instanz bei den npm Komponenten "node-unifi" ein?

        ja

        Image 056.png
        eintragen und enter drücken - sonst wird es nicht angenommen - die instanz startet dann neu

        ansschliessend script anlegen und hostname (zeile3) und user und kennwort (zeile8) anpassen

        dann:
        aufrufen und im voucher-admin nachsehen, ob was angekommen ist

        nach einem gelösten Thread wäre es sinnvoll dies in der Überschrift des ersten Posts einzutragen [gelöst]-... Bitte benutzt das Voting rechts unten im Beitrag wenn er euch geholfen hat. Forum-Tools: PicPick https://picpick.app/en/download/ und ScreenToGif https://www.screentogif.com/downloads.html

        1 Antwort Letzte Antwort
        0
        • draexlerD draexler

          @liv-in-sky Hört sich schon mal gut an. Also trage ich einfach in der js.instanz bei den npm Komponenten "node-unifi" ein? Wenn ja, wie geht es dann weiter? Arbeite wie die meisten hier nur mit Blockly...

          liv-in-skyL Offline
          liv-in-skyL Offline
          liv-in-sky
          schrieb am zuletzt editiert von
          #24

          @draexler

          Image 057.png

          hier siehst du was in die klammer der funktion createVouchers kommen muss

          es müßte reichen, wenn du minutes,count,quota und note einträgst createVouchers(180,1,0,"testthisvoucher");

          nach einem gelösten Thread wäre es sinnvoll dies in der Überschrift des ersten Posts einzutragen [gelöst]-... Bitte benutzt das Voting rechts unten im Beitrag wenn er euch geholfen hat. Forum-Tools: PicPick https://picpick.app/en/download/ und ScreenToGif https://www.screentogif.com/downloads.html

          1 Antwort Letzte Antwort
          0
          • kmxakK Offline
            kmxakK Offline
            kmxak
            Most Active
            schrieb am zuletzt editiert von
            #25

            ich frage mal direkt dazwischen ob man den voucher code auch irgendwo abgreifen kann damit ich den irgendwo darstellen kann und nicht im portal schauen muss

            Gruß Alex

            liv-in-skyL 1 Antwort Letzte Antwort
            0
            • kmxakK kmxak

              ich frage mal direkt dazwischen ob man den voucher code auch irgendwo abgreifen kann damit ich den irgendwo darstellen kann und nicht im portal schauen muss

              liv-in-skyL Offline
              liv-in-skyL Offline
              liv-in-sky
              schrieb am zuletzt editiert von
              #26

              @kmxak

              das selbe script nur mit der funktion - teste mal -- ich hoffe es stimmt so

              const myVouchers = await unifi.getVouchers();
              console.log("vouchers: "+ myVouchers)
              

              nach einem gelösten Thread wäre es sinnvoll dies in der Überschrift des ersten Posts einzutragen [gelöst]-... Bitte benutzt das Voting rechts unten im Beitrag wenn er euch geholfen hat. Forum-Tools: PicPick https://picpick.app/en/download/ und ScreenToGif https://www.screentogif.com/downloads.html

              1 Antwort Letzte Antwort
              0
              • kmxakK Offline
                kmxakK Offline
                kmxak
                Most Active
                schrieb am zuletzt editiert von
                #27

                mh ich bekomme aktuell Error: failed to detect UniFiOS status

                Gruß Alex

                liv-in-skyL 1 Antwort Letzte Antwort
                0
                • kmxakK kmxak

                  mh ich bekomme aktuell Error: failed to detect UniFiOS status

                  liv-in-skyL Offline
                  liv-in-skyL Offline
                  liv-in-sky
                  schrieb am zuletzt editiert von
                  #28

                  @kmxak

                  ich nutze die controller auf linux installiert - hast du den auch

                  nach einem gelösten Thread wäre es sinnvoll dies in der Überschrift des ersten Posts einzutragen [gelöst]-... Bitte benutzt das Voting rechts unten im Beitrag wenn er euch geholfen hat. Forum-Tools: PicPick https://picpick.app/en/download/ und ScreenToGif https://www.screentogif.com/downloads.html

                  1 Antwort Letzte Antwort
                  0
                  • kmxakK Offline
                    kmxakK Offline
                    kmxak
                    Most Active
                    schrieb am zuletzt editiert von
                    #29

                    ne ich hab ne udm pro

                    Gruß Alex

                    liv-in-skyL 2 Antworten Letzte Antwort
                    0
                    • kmxakK kmxak

                      ne ich hab ne udm pro

                      liv-in-skyL Offline
                      liv-in-skyL Offline
                      liv-in-sky
                      schrieb am zuletzt editiert von
                      #30

                      @kmxak

                      das ist die seite, wo ich die infos her habe - https://github.com/jens-maus/node-unifi

                      laut diesem issue, sollte es theoretisch funktionieren https://github.com/jens-maus/node-unifi/issues/227

                      nach einem gelösten Thread wäre es sinnvoll dies in der Überschrift des ersten Posts einzutragen [gelöst]-... Bitte benutzt das Voting rechts unten im Beitrag wenn er euch geholfen hat. Forum-Tools: PicPick https://picpick.app/en/download/ und ScreenToGif https://www.screentogif.com/downloads.html

                      1 Antwort Letzte Antwort
                      0
                      • liv-in-skyL Offline
                        liv-in-skyL Offline
                        liv-in-sky
                        schrieb am zuletzt editiert von
                        #31

                        wer interesse hat, was alles gehen sollte

                        https://github.com/jens-maus/node-unifi/blob/master/unifi.js

                        bei mir werden rechts die ganzen funktionen angezeigt:

                        Image 059.png

                        nach einem gelösten Thread wäre es sinnvoll dies in der Überschrift des ersten Posts einzutragen [gelöst]-... Bitte benutzt das Voting rechts unten im Beitrag wenn er euch geholfen hat. Forum-Tools: PicPick https://picpick.app/en/download/ und ScreenToGif https://www.screentogif.com/downloads.html

                        1 Antwort Letzte Antwort
                        0
                        • kmxakK kmxak

                          ne ich hab ne udm pro

                          liv-in-skyL Offline
                          liv-in-skyL Offline
                          liv-in-sky
                          schrieb am zuletzt editiert von liv-in-sky
                          #32

                          @kmxak

                          bei mir sind wohl noch alte vouchers im system

                          mit diesem script sehe ich sie und könnte sie dann in der vis anzeigen ode rüber telegram versenden ...

                          
                          
                          const Unifi = require('node-unifi');
                          
                          const unifi = new Unifi.Controller({hostname:"192.168.178.1xx",port:'8443', sslverify: false});
                          
                          (async () => {
                           try {
                             // LOGIN
                             const loginData = await unifi.login('user', 'passw!');
                             console.log('login: ' + loginData);
                            
                          
                          
                            const switchmac="b4:fb:e4:f3:96:63"
                             // Get data from a specific unifi device based on MAC address
                             const deviceData = await unifi.getAccessDevices(switchmac);
                             // Console.log('getAccessDevices: ' + JSON.stringify(deviceData));
                          
                             // Get device id
                             const deviceId = deviceData[0]._id;
                             console.log('deviceId: ' + deviceId + ' ip: ' + deviceData[0].ip);
                          
                          // GET SITE STATS
                            // const sites = await unifi.getSitesStats();
                            // console.log('getSitesStats: ' + sites[0].name + ':' + sites.length);
                            // console.log(JSON.stringify(sites));
                          
                             // GET SITE SYSINFO
                            // const sysinfo = await unifi.getSiteSysinfo();
                            // console.log('getSiteSysinfo: ' + sysinfo.length);
                             //console.log(JSON.stringify(sysinfo));
                          
                             // GET CLIENT DEVICES
                           //  const clientData = await unifi.getClientDevices();
                            // console.log('getClientDevices: ' + clientData.length);
                            // console.log(JSON.stringify(clientData));
                          
                             // GET ALL USERS EVER CONNECTED
                             //const usersData = await unifi.getAllUsers();
                             //console.log('getAllUsers: ' + usersData.length);
                             //console.log(JSON.stringify(usersData));
                          
                          //   const clientVoucher = await unifi.createVouchers(123,1,0,"testthis");
                          
                             const myVouchers = await unifi.getVouchers();
                             console.log("vouchers: "+ JSON.stringify(myVouchers))
                          
                             // LOGOUT
                             const logoutData = await unifi.logout();
                             console.log('logout: ' + JSON.stringify(logoutData));
                           } catch (error) {
                             console.log('ERROR: ' + error);
                           }
                          });
                          
                          
                          
                          
                          
                          

                          log:

                          script.js.MYSTUFF.ALLERLEI.AAAUNIFI.unifi-wlan-schalten3: vouchers: [{"duration":123,"qos_overwrite":false,"note":"testthis","code":"6566218181","for_hotspot":false,"create_time":1717058841,"quota":0,"site_id":"5cadc7f53b6a3967dd7e5369","_id":"66583d19108fed3b1dc7283c","admin_name":"e","used":0,"status":"VALID_MULTI","status_expires":0},{"duration":123,"qos_overwrite":false,"note":"testthis","code":"7113118220","for_hotspot":false,"create_time":1717058021,"quota":0,"site_id":"5cadc7f53b6a3967dd7e5369","_id":"665839e5108fed3b1dc72722","admin_name":"e","used":0,"status":"VALID_MULTI","status_expires":0},{"duration":123,"qos_overwrite":false,"note":"testthis","code":"4515536233","for_hotspot":false,"create_time":1717057059,"quota":0,"site_id":"5cadc7f53b6a3967dd7e5369","_id":"66583623108fed3b1dc725f0","admin_name":"e","used":0,"status":"VALID_MULTI","status_expires":0},{"duration":5760,"qos_overwrite":false,"note":null,"code":"8241421156","for_hotspot":false,"create_time":1650354689,"quota":1,"site_id":"5cadc7f53b6a3967dd7e5369","_id":"625e6a0197578402ac2db67c","admin_name":"e","used":0,"status":"VALID_ONE","status_expires":0},{"duration":5760,"qos_overwrite":false,"note":null,"code":"7446834263","for_hotspot":false,"create_time":1650354689,"quota":1,"site_id":"5cadc7f53b6a3967dd7e5369","_id":"625e6a0197578402ac2db67b","admin_name":"e","used":0,"status":"VALID_ONE","status_expires":0},{"duration":525600,"qos_overwrite":false,"note":null,"code":"7358319725","for_hotspot":false,"create_time":1650354660,"quota":1,"site_id":"5cadc7f53b6a3967dd7e5369","_id":"625e69e497578402ac2db679","admin_name":"e","used":0,"status":"VALID_ONE","status_expires":0},{"duration":1440,"qos_overwrite":false,"note":null,"code":"2729460620","for_hotspot":false,"create_time":1627921177,"quota":1,"site_id":"5cadc7f53b6a3967dd7e5369","_id":"61081b1997578402177f7096","admin_name":"e","used":0,"status":"VALID_ONE","status_expires":0},{"duration":1440,"qos_overwrite":false,"note":null,"code":"1795017450","for_hotspot":false,"create_time":1627921177,"quota":1,"site_id":"5cadc7f53b6a3967dd7e5369","_id":"61081b1997578402177f7095","admin_name":"e","used":0,"status":"VALID_ONE","status_expires":0},{"duration":1440,"qos_overwrite":false,"note":null,"code":"2281225310","for_hotspot":false,"create_time":1627921177,"quota":1,"site_id":"5cadc7f53b6a3967dd7e5369","_id":"61081b1997578402177f7094","admin_name":"e","used":0,"status":"VALID_ONE","status_expires":0},{"duration":1440,"qos_overwrite":false,"note":null,"code":"0356279115","for_hotspot":false,"create_time":1627921177,"quota":1,"site_id":"5cadc7f53b6a3967dd7e5369","_id":"61081b1997578402177f7093","admin_name":"e","used":0,"status":"VALID_ONE","status_expires":0},{"duration":1440,"qos_overwrite":false,"note":null,"code":"3544056744","for_hotspot":false,"create_time":1627921177,"quota":1,"site_id":"5cadc7f53b6a3967dd7e5369","_id":"61081b1997578402177f7092","admin_name":"e","used":0,"status":"VALID_ONE","status_expires":0},{"duration":1440,"qos_overwrite":false,"note":null,"code":"6426769406","for_hotspot":false,"create_time":1627921177,"quota":1,"site_id":"5cadc7f53b6a3967dd7e5369","_id":"61081b1997578402177f7091","admin_name":"e","used":0,"status":"VALID_ONE","status_expires":0},{"duration":1440,"qos_overwrite":false,"note":null,"code":"2298091277","for_hotspot":false,"create_time":1627921177,"quota":1,"site_id":"5cadc7f53b6a3967dd7e5369","_id":"61081b1997578402177f7090","admin_name":"e","used":0,"status":"VALID_ONE","status_expires":0},{"duration":1440,"qos_overwrite":false,"note":null,"code":"8878654311","for_hotspot":false,"create_time":1627921177,"quota":1,"site_id":"5cadc7f53b6a3967dd7e5369","_id":"61081b1997578402177f708f","admin_name":"e","used":0,"status":"VALID_ONE","status_expires":0},{"duration":1440,"qos_overwrite":false,"note":null,"code":"6946187591","for_hotspot":false,"create_time":1627921177,"quota":1,"site_id":"5cadc7f53b6a3967dd7e5369","_id":"61081b1997578402177f708e","admin_name":"e","used":0,"status":"VALID_ONE","status_expires":0},{"duration":1440,"qos_overwrite":false,"note":null,"code":"0579279641","for_hotspot":false,"create_time":1627921177,"quota":1,"site_id":"5cadc7f53b6a3967dd7e5369","_id":"61081b1997578402177f708d","admin_name":"e","used":0,"status":"VALID_ONE","status_expires":0}]
                          
                          

                          im log ist der erste eintrag ein test mit 123... - wurde wohl angelegt - damit funktioniert es wohl

                          nach einem gelösten Thread wäre es sinnvoll dies in der Überschrift des ersten Posts einzutragen [gelöst]-... Bitte benutzt das Voting rechts unten im Beitrag wenn er euch geholfen hat. Forum-Tools: PicPick https://picpick.app/en/download/ und ScreenToGif https://www.screentogif.com/downloads.html

                          kmxakK 1 Antwort Letzte Antwort
                          0
                          • kmxakK Offline
                            kmxakK Offline
                            kmxak
                            Most Active
                            schrieb am zuletzt editiert von
                            #33

                            die info mit dem port dazu müsste ich ja den code ändern.

                            die letzte info mit den funktionen ist nützlich. wie bekommst die anzeige hin? mir wird das in github nicht angezeigt

                            Gruß Alex

                            liv-in-skyL 2 Antworten Letzte Antwort
                            0
                            • kmxakK kmxak

                              die info mit dem port dazu müsste ich ja den code ändern.

                              die letzte info mit den funktionen ist nützlich. wie bekommst die anzeige hin? mir wird das in github nicht angezeigt

                              liv-in-skyL Offline
                              liv-in-skyL Offline
                              liv-in-sky
                              schrieb am zuletzt editiert von
                              #34

                              @kmxak
                              das weiß ich nicht :-( war einfach da - wie sieht es bei dir aus

                              nach einem gelösten Thread wäre es sinnvoll dies in der Überschrift des ersten Posts einzutragen [gelöst]-... Bitte benutzt das Voting rechts unten im Beitrag wenn er euch geholfen hat. Forum-Tools: PicPick https://picpick.app/en/download/ und ScreenToGif https://www.screentogif.com/downloads.html

                              kmxakK 1 Antwort Letzte Antwort
                              0
                              • liv-in-skyL liv-in-sky

                                @kmxak

                                bei mir sind wohl noch alte vouchers im system

                                mit diesem script sehe ich sie und könnte sie dann in der vis anzeigen ode rüber telegram versenden ...

                                
                                
                                const Unifi = require('node-unifi');
                                
                                const unifi = new Unifi.Controller({hostname:"192.168.178.1xx",port:'8443', sslverify: false});
                                
                                (async () => {
                                 try {
                                   // LOGIN
                                   const loginData = await unifi.login('user', 'passw!');
                                   console.log('login: ' + loginData);
                                  
                                
                                
                                  const switchmac="b4:fb:e4:f3:96:63"
                                   // Get data from a specific unifi device based on MAC address
                                   const deviceData = await unifi.getAccessDevices(switchmac);
                                   // Console.log('getAccessDevices: ' + JSON.stringify(deviceData));
                                
                                   // Get device id
                                   const deviceId = deviceData[0]._id;
                                   console.log('deviceId: ' + deviceId + ' ip: ' + deviceData[0].ip);
                                
                                // GET SITE STATS
                                  // const sites = await unifi.getSitesStats();
                                  // console.log('getSitesStats: ' + sites[0].name + ':' + sites.length);
                                  // console.log(JSON.stringify(sites));
                                
                                   // GET SITE SYSINFO
                                  // const sysinfo = await unifi.getSiteSysinfo();
                                  // console.log('getSiteSysinfo: ' + sysinfo.length);
                                   //console.log(JSON.stringify(sysinfo));
                                
                                   // GET CLIENT DEVICES
                                 //  const clientData = await unifi.getClientDevices();
                                  // console.log('getClientDevices: ' + clientData.length);
                                  // console.log(JSON.stringify(clientData));
                                
                                   // GET ALL USERS EVER CONNECTED
                                   //const usersData = await unifi.getAllUsers();
                                   //console.log('getAllUsers: ' + usersData.length);
                                   //console.log(JSON.stringify(usersData));
                                
                                //   const clientVoucher = await unifi.createVouchers(123,1,0,"testthis");
                                
                                   const myVouchers = await unifi.getVouchers();
                                   console.log("vouchers: "+ JSON.stringify(myVouchers))
                                
                                   // LOGOUT
                                   const logoutData = await unifi.logout();
                                   console.log('logout: ' + JSON.stringify(logoutData));
                                 } catch (error) {
                                   console.log('ERROR: ' + error);
                                 }
                                });
                                
                                
                                
                                
                                
                                

                                log:

                                script.js.MYSTUFF.ALLERLEI.AAAUNIFI.unifi-wlan-schalten3: vouchers: [{"duration":123,"qos_overwrite":false,"note":"testthis","code":"6566218181","for_hotspot":false,"create_time":1717058841,"quota":0,"site_id":"5cadc7f53b6a3967dd7e5369","_id":"66583d19108fed3b1dc7283c","admin_name":"e","used":0,"status":"VALID_MULTI","status_expires":0},{"duration":123,"qos_overwrite":false,"note":"testthis","code":"7113118220","for_hotspot":false,"create_time":1717058021,"quota":0,"site_id":"5cadc7f53b6a3967dd7e5369","_id":"665839e5108fed3b1dc72722","admin_name":"e","used":0,"status":"VALID_MULTI","status_expires":0},{"duration":123,"qos_overwrite":false,"note":"testthis","code":"4515536233","for_hotspot":false,"create_time":1717057059,"quota":0,"site_id":"5cadc7f53b6a3967dd7e5369","_id":"66583623108fed3b1dc725f0","admin_name":"e","used":0,"status":"VALID_MULTI","status_expires":0},{"duration":5760,"qos_overwrite":false,"note":null,"code":"8241421156","for_hotspot":false,"create_time":1650354689,"quota":1,"site_id":"5cadc7f53b6a3967dd7e5369","_id":"625e6a0197578402ac2db67c","admin_name":"e","used":0,"status":"VALID_ONE","status_expires":0},{"duration":5760,"qos_overwrite":false,"note":null,"code":"7446834263","for_hotspot":false,"create_time":1650354689,"quota":1,"site_id":"5cadc7f53b6a3967dd7e5369","_id":"625e6a0197578402ac2db67b","admin_name":"e","used":0,"status":"VALID_ONE","status_expires":0},{"duration":525600,"qos_overwrite":false,"note":null,"code":"7358319725","for_hotspot":false,"create_time":1650354660,"quota":1,"site_id":"5cadc7f53b6a3967dd7e5369","_id":"625e69e497578402ac2db679","admin_name":"e","used":0,"status":"VALID_ONE","status_expires":0},{"duration":1440,"qos_overwrite":false,"note":null,"code":"2729460620","for_hotspot":false,"create_time":1627921177,"quota":1,"site_id":"5cadc7f53b6a3967dd7e5369","_id":"61081b1997578402177f7096","admin_name":"e","used":0,"status":"VALID_ONE","status_expires":0},{"duration":1440,"qos_overwrite":false,"note":null,"code":"1795017450","for_hotspot":false,"create_time":1627921177,"quota":1,"site_id":"5cadc7f53b6a3967dd7e5369","_id":"61081b1997578402177f7095","admin_name":"e","used":0,"status":"VALID_ONE","status_expires":0},{"duration":1440,"qos_overwrite":false,"note":null,"code":"2281225310","for_hotspot":false,"create_time":1627921177,"quota":1,"site_id":"5cadc7f53b6a3967dd7e5369","_id":"61081b1997578402177f7094","admin_name":"e","used":0,"status":"VALID_ONE","status_expires":0},{"duration":1440,"qos_overwrite":false,"note":null,"code":"0356279115","for_hotspot":false,"create_time":1627921177,"quota":1,"site_id":"5cadc7f53b6a3967dd7e5369","_id":"61081b1997578402177f7093","admin_name":"e","used":0,"status":"VALID_ONE","status_expires":0},{"duration":1440,"qos_overwrite":false,"note":null,"code":"3544056744","for_hotspot":false,"create_time":1627921177,"quota":1,"site_id":"5cadc7f53b6a3967dd7e5369","_id":"61081b1997578402177f7092","admin_name":"e","used":0,"status":"VALID_ONE","status_expires":0},{"duration":1440,"qos_overwrite":false,"note":null,"code":"6426769406","for_hotspot":false,"create_time":1627921177,"quota":1,"site_id":"5cadc7f53b6a3967dd7e5369","_id":"61081b1997578402177f7091","admin_name":"e","used":0,"status":"VALID_ONE","status_expires":0},{"duration":1440,"qos_overwrite":false,"note":null,"code":"2298091277","for_hotspot":false,"create_time":1627921177,"quota":1,"site_id":"5cadc7f53b6a3967dd7e5369","_id":"61081b1997578402177f7090","admin_name":"e","used":0,"status":"VALID_ONE","status_expires":0},{"duration":1440,"qos_overwrite":false,"note":null,"code":"8878654311","for_hotspot":false,"create_time":1627921177,"quota":1,"site_id":"5cadc7f53b6a3967dd7e5369","_id":"61081b1997578402177f708f","admin_name":"e","used":0,"status":"VALID_ONE","status_expires":0},{"duration":1440,"qos_overwrite":false,"note":null,"code":"6946187591","for_hotspot":false,"create_time":1627921177,"quota":1,"site_id":"5cadc7f53b6a3967dd7e5369","_id":"61081b1997578402177f708e","admin_name":"e","used":0,"status":"VALID_ONE","status_expires":0},{"duration":1440,"qos_overwrite":false,"note":null,"code":"0579279641","for_hotspot":false,"create_time":1627921177,"quota":1,"site_id":"5cadc7f53b6a3967dd7e5369","_id":"61081b1997578402177f708d","admin_name":"e","used":0,"status":"VALID_ONE","status_expires":0}]
                                
                                

                                im log ist der erste eintrag ein test mit 123... - wurde wohl angelegt - damit funktioniert es wohl

                                kmxakK Offline
                                kmxakK Offline
                                kmxak
                                Most Active
                                schrieb am zuletzt editiert von
                                #35

                                @liv-in-sky sagte in Adapter: ioBroker.unifi:

                                @kmxak

                                bei mir sind wohl noch alte vouchers im system

                                mit diesem script sehe ich sie und könnte sie dann in der vis anzeigen ode rüber telegram versenden ...

                                
                                
                                const Unifi = require('node-unifi');
                                
                                const unifi = new Unifi.Controller({hostname:"192.168.178.1xx",port:'8443', sslverify: false});
                                
                                (async () => {
                                 try {
                                   // LOGIN
                                   const loginData = await unifi.login('user', 'passw!');
                                   console.log('login: ' + loginData);
                                  
                                
                                
                                  const switchmac="b4:fb:e4:f3:96:63"
                                   // Get data from a specific unifi device based on MAC address
                                   const deviceData = await unifi.getAccessDevices(switchmac);
                                   // Console.log('getAccessDevices: ' + JSON.stringify(deviceData));
                                
                                   // Get device id
                                   const deviceId = deviceData[0]._id;
                                   console.log('deviceId: ' + deviceId + ' ip: ' + deviceData[0].ip);
                                
                                // GET SITE STATS
                                  // const sites = await unifi.getSitesStats();
                                  // console.log('getSitesStats: ' + sites[0].name + ':' + sites.length);
                                  // console.log(JSON.stringify(sites));
                                
                                   // GET SITE SYSINFO
                                  // const sysinfo = await unifi.getSiteSysinfo();
                                  // console.log('getSiteSysinfo: ' + sysinfo.length);
                                   //console.log(JSON.stringify(sysinfo));
                                
                                   // GET CLIENT DEVICES
                                 //  const clientData = await unifi.getClientDevices();
                                  // console.log('getClientDevices: ' + clientData.length);
                                  // console.log(JSON.stringify(clientData));
                                
                                   // GET ALL USERS EVER CONNECTED
                                   //const usersData = await unifi.getAllUsers();
                                   //console.log('getAllUsers: ' + usersData.length);
                                   //console.log(JSON.stringify(usersData));
                                
                                //   const clientVoucher = await unifi.createVouchers(123,1,0,"testthis");
                                
                                   const myVouchers = await unifi.getVouchers();
                                   console.log("vouchers: "+ JSON.stringify(myVouchers))
                                
                                   // LOGOUT
                                   const logoutData = await unifi.logout();
                                   console.log('logout: ' + JSON.stringify(logoutData));
                                 } catch (error) {
                                   console.log('ERROR: ' + error);
                                 }
                                })();
                                
                                log(getObject('system.host.iobroker59').native.os.platform)
                                
                                
                                
                                

                                log:

                                script.js.MYSTUFF.ALLERLEI.AAAUNIFI.unifi-wlan-schalten3: vouchers: [{"duration":123,"qos_overwrite":false,"note":"testthis","code":"6566218181","for_hotspot":false,"create_time":1717058841,"quota":0,"site_id":"5cadc7f53b6a3967dd7e5369","_id":"66583d19108fed3b1dc7283c","admin_name":"e","used":0,"status":"VALID_MULTI","status_expires":0},{"duration":123,"qos_overwrite":false,"note":"testthis","code":"7113118220","for_hotspot":false,"create_time":1717058021,"quota":0,"site_id":"5cadc7f53b6a3967dd7e5369","_id":"665839e5108fed3b1dc72722","admin_name":"e","used":0,"status":"VALID_MULTI","status_expires":0},{"duration":123,"qos_overwrite":false,"note":"testthis","code":"4515536233","for_hotspot":false,"create_time":1717057059,"quota":0,"site_id":"5cadc7f53b6a3967dd7e5369","_id":"66583623108fed3b1dc725f0","admin_name":"e","used":0,"status":"VALID_MULTI","status_expires":0},{"duration":5760,"qos_overwrite":false,"note":null,"code":"8241421156","for_hotspot":false,"create_time":1650354689,"quota":1,"site_id":"5cadc7f53b6a3967dd7e5369","_id":"625e6a0197578402ac2db67c","admin_name":"e","used":0,"status":"VALID_ONE","status_expires":0},{"duration":5760,"qos_overwrite":false,"note":null,"code":"7446834263","for_hotspot":false,"create_time":1650354689,"quota":1,"site_id":"5cadc7f53b6a3967dd7e5369","_id":"625e6a0197578402ac2db67b","admin_name":"e","used":0,"status":"VALID_ONE","status_expires":0},{"duration":525600,"qos_overwrite":false,"note":null,"code":"7358319725","for_hotspot":false,"create_time":1650354660,"quota":1,"site_id":"5cadc7f53b6a3967dd7e5369","_id":"625e69e497578402ac2db679","admin_name":"e","used":0,"status":"VALID_ONE","status_expires":0},{"duration":1440,"qos_overwrite":false,"note":null,"code":"2729460620","for_hotspot":false,"create_time":1627921177,"quota":1,"site_id":"5cadc7f53b6a3967dd7e5369","_id":"61081b1997578402177f7096","admin_name":"e","used":0,"status":"VALID_ONE","status_expires":0},{"duration":1440,"qos_overwrite":false,"note":null,"code":"1795017450","for_hotspot":false,"create_time":1627921177,"quota":1,"site_id":"5cadc7f53b6a3967dd7e5369","_id":"61081b1997578402177f7095","admin_name":"e","used":0,"status":"VALID_ONE","status_expires":0},{"duration":1440,"qos_overwrite":false,"note":null,"code":"2281225310","for_hotspot":false,"create_time":1627921177,"quota":1,"site_id":"5cadc7f53b6a3967dd7e5369","_id":"61081b1997578402177f7094","admin_name":"e","used":0,"status":"VALID_ONE","status_expires":0},{"duration":1440,"qos_overwrite":false,"note":null,"code":"0356279115","for_hotspot":false,"create_time":1627921177,"quota":1,"site_id":"5cadc7f53b6a3967dd7e5369","_id":"61081b1997578402177f7093","admin_name":"e","used":0,"status":"VALID_ONE","status_expires":0},{"duration":1440,"qos_overwrite":false,"note":null,"code":"3544056744","for_hotspot":false,"create_time":1627921177,"quota":1,"site_id":"5cadc7f53b6a3967dd7e5369","_id":"61081b1997578402177f7092","admin_name":"e","used":0,"status":"VALID_ONE","status_expires":0},{"duration":1440,"qos_overwrite":false,"note":null,"code":"6426769406","for_hotspot":false,"create_time":1627921177,"quota":1,"site_id":"5cadc7f53b6a3967dd7e5369","_id":"61081b1997578402177f7091","admin_name":"e","used":0,"status":"VALID_ONE","status_expires":0},{"duration":1440,"qos_overwrite":false,"note":null,"code":"2298091277","for_hotspot":false,"create_time":1627921177,"quota":1,"site_id":"5cadc7f53b6a3967dd7e5369","_id":"61081b1997578402177f7090","admin_name":"e","used":0,"status":"VALID_ONE","status_expires":0},{"duration":1440,"qos_overwrite":false,"note":null,"code":"8878654311","for_hotspot":false,"create_time":1627921177,"quota":1,"site_id":"5cadc7f53b6a3967dd7e5369","_id":"61081b1997578402177f708f","admin_name":"e","used":0,"status":"VALID_ONE","status_expires":0},{"duration":1440,"qos_overwrite":false,"note":null,"code":"6946187591","for_hotspot":false,"create_time":1627921177,"quota":1,"site_id":"5cadc7f53b6a3967dd7e5369","_id":"61081b1997578402177f708e","admin_name":"e","used":0,"status":"VALID_ONE","status_expires":0},{"duration":1440,"qos_overwrite":false,"note":null,"code":"0579279641","for_hotspot":false,"create_time":1627921177,"quota":1,"site_id":"5cadc7f53b6a3967dd7e5369","_id":"61081b1997578402177f708d","admin_name":"e","used":0,"status":"VALID_ONE","status_expires":0}]
                                
                                

                                im log ist der erste eintrag ein test mit 123... - wurde wohl angelegt - damit funktioniert es wohl

                                dazu müsste ich erstmal den login fixen. ich habe ja noch andere sachen da laufen die können sich verbinden. auch der protect adapter kann sich verbinden... mal sehen wenn ich mal zeit habe ... lege es auf den haufen mit todo :grimacing:

                                Gruß Alex

                                1 Antwort Letzte Antwort
                                0
                                • liv-in-skyL liv-in-sky

                                  @kmxak
                                  das weiß ich nicht :-( war einfach da - wie sieht es bei dir aus

                                  kmxakK Offline
                                  kmxakK Offline
                                  kmxak
                                  Most Active
                                  schrieb am zuletzt editiert von
                                  #36

                                  @liv-in-sky sagte in Adapter: ioBroker.unifi:

                                  @kmxak
                                  das weiß ich nicht :-( war einfach da - wie sieht es bei dir aus

                                  sorry mein fehler war mit dem browser nicht eingeloggt.

                                  Gruß Alex

                                  1 Antwort Letzte Antwort
                                  0
                                  • kmxakK Offline
                                    kmxakK Offline
                                    kmxak
                                    Most Active
                                    schrieb am zuletzt editiert von kmxak
                                    #37

                                    ah, jetzt geht es... falscher port :face_palm:

                                    bekomme aber nur:

                                    javascript.0	11:50:46.998	info	script.js.User.Unifi.Unifi_Node: login: true
                                    javascript.0	11:50:47.064	info	script.js.User.Unifi.Unifi_Node: vouchers: [object Object],[object Object],[object Object],[object Object],[object Object]
                                    javascript.0	11:50:47.084	info	script.js.User.Unifi.Unifi_Node: logout: {"success":true}
                                    

                                    der hier funzt nicht mit deinem aus dem code geht es

                                    console.log("vouchers: "+ myVouchers)
                                    

                                    Gruß Alex

                                    liv-in-skyL 1 Antwort Letzte Antwort
                                    0
                                    • kmxakK kmxak

                                      die info mit dem port dazu müsste ich ja den code ändern.

                                      die letzte info mit den funktionen ist nützlich. wie bekommst die anzeige hin? mir wird das in github nicht angezeigt

                                      liv-in-skyL Offline
                                      liv-in-skyL Offline
                                      liv-in-sky
                                      schrieb am zuletzt editiert von
                                      #38

                                      @kmxak sagte in Adapter: ioBroker.unifi:

                                      die info mit dem port dazu müsste ich ja den code ändern.

                                      kannst du ja machen - die datei unifi.js liegt ja im verzeichnis vom iobroker

                                      Image 060.png

                                      auf eigene verantwortung

                                      nach einem gelösten Thread wäre es sinnvoll dies in der Überschrift des ersten Posts einzutragen [gelöst]-... Bitte benutzt das Voting rechts unten im Beitrag wenn er euch geholfen hat. Forum-Tools: PicPick https://picpick.app/en/download/ und ScreenToGif https://www.screentogif.com/downloads.html

                                      1 Antwort Letzte Antwort
                                      0
                                      • kmxakK kmxak

                                        ah, jetzt geht es... falscher port :face_palm:

                                        bekomme aber nur:

                                        javascript.0	11:50:46.998	info	script.js.User.Unifi.Unifi_Node: login: true
                                        javascript.0	11:50:47.064	info	script.js.User.Unifi.Unifi_Node: vouchers: [object Object],[object Object],[object Object],[object Object],[object Object]
                                        javascript.0	11:50:47.084	info	script.js.User.Unifi.Unifi_Node: logout: {"success":true}
                                        

                                        der hier funzt nicht mit deinem aus dem code geht es

                                        console.log("vouchers: "+ myVouchers)
                                        
                                        liv-in-skyL Offline
                                        liv-in-skyL Offline
                                        liv-in-sky
                                        schrieb am zuletzt editiert von
                                        #39

                                        @kmxak sagte in Adapter: ioBroker.unifi:

                                        console.log("vouchers: "+ myVouchers)

                                        mein fehler

                                        so muss es heißen

                                        console.log("vouchers: "+ JSON.stringify(myVouchers))
                                        

                                        nach einem gelösten Thread wäre es sinnvoll dies in der Überschrift des ersten Posts einzutragen [gelöst]-... Bitte benutzt das Voting rechts unten im Beitrag wenn er euch geholfen hat. Forum-Tools: PicPick https://picpick.app/en/download/ und ScreenToGif https://www.screentogif.com/downloads.html

                                        1 Antwort Letzte Antwort
                                        0
                                        • kmxakK Offline
                                          kmxakK Offline
                                          kmxak
                                          Most Active
                                          schrieb am zuletzt editiert von
                                          #40

                                          ja danke damit ging es und es funktioniert.

                                          Damit kann ich ja weiterarbeiten.

                                          Gruß Alex

                                          ? 1 Antwort Letzte Antwort
                                          1
                                          Antworten
                                          • In einem neuen Thema antworten
                                          Anmelden zum Antworten
                                          • Älteste zuerst
                                          • Neuste zuerst
                                          • Meiste Stimmen


                                          Support us

                                          ioBroker
                                          Community Adapters
                                          Donate
                                          FAQ Cloud / IOT
                                          HowTo: Node.js-Update
                                          HowTo: Backup/Restore
                                          Downloads
                                          BLOG

                                          620

                                          Online

                                          32.4k

                                          Benutzer

                                          81.4k

                                          Themen

                                          1.3m

                                          Beiträge
                                          Community
                                          Impressum | Datenschutz-Bestimmungen | Nutzungsbedingungen | Einwilligungseinstellungen
                                          ioBroker Community 2014-2025
                                          logo
                                          • Anmelden

                                          • Du hast noch kein Konto? Registrieren

                                          • Anmelden oder registrieren, um zu suchen
                                          • Erster Beitrag
                                            Letzter Beitrag
                                          0
                                          • Home
                                          • Aktuell
                                          • Tags
                                          • Ungelesen 0
                                          • Kategorien
                                          • Unreplied
                                          • Beliebt
                                          • GitHub
                                          • Docu
                                          • Hilfe