Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Skripten / Logik
    4. JavaScript
    5. Unifi WLAN Script 2 mit Anwesenheitskontrolle

    NEWS

    • [erledigt] 15. 05. Wartungsarbeiten am ioBroker Forum

    • ioBroker goes Matter ... Matter Adapter in Stable

    • Monatsrückblick - April 2025

    Unifi WLAN Script 2 mit Anwesenheitskontrolle

    This topic has been deleted. Only users with topic management privileges can see it.
    • D
      dos1973 @dslraser last edited by

      @liv-in-sky

      das mit CODE01 funktioniert, da sind alle DP für mich enthalten. Nur in dem DP wird der Code leider ohne Bindestrich angezeigt.... d.h ich müsste ein extra Script schreiben, dass den Wert mit Bindestrich anpasst. Oder lässt sich das irgendwie in Vis Direkt "abschneiden/ zusammenbauen)

      oder gleich mit Bindestrich in deinem DP anzeigen, wäre Super 😉

      @dslraser

      hier mal meine Gast Konfig.
      Du siehst ich habe auf verschiedenen AP und Netzen das Netz nicht aktiv -> vielleicht liegt es daran.

      über gast Netzwerk bearbeiten aus dem Browser die ID entnehmen
      Bildschirmfoto 2019-10-03 um 13.23.01.png

      im Script

         "Gast_Dos": { name: "Gast_Dos", id: "5ceec2f8885a32000f160ae7", desc: "Gast_Dos", smart: "Gast_Dos" }
      

      Bildschirmfoto 2019-10-03 um 13.17.06.png

      Bildschirmfoto 2019-10-03 um 13.17.26.png

      liv-in-sky 1 Reply Last reply Reply Quote 0
      • D
        dos1973 last edited by

        @liv-in-sky noch eine Frage
        woher nimmst du die Information, welcher client auf welchem AP und Netz eingebucht ist. Gibt es das als DP?

        Bildschirmfoto 2019-10-03 um 13.31.17.png

        liv-in-sky 1 Reply Last reply Reply Quote 0
        • liv-in-sky
          liv-in-sky @dos1973 last edited by

          @dos1973

          du brauchst den bindestrich nicht einzugeben bei der anmeldung - aber wegen der "schönheit" habe ich es geändert und wird im nächsten update mit bindestrich im datanpunkt stehen 🙂

          1 Reply Last reply Reply Quote 0
          • liv-in-sky
            liv-in-sky @dos1973 last edited by

            @dos1973

            nein - das habe ich überlegt - aber ich wollte vermeiden, das ich für jeden client einen unterordner habe (ähnlich wie bei den vouchers') - die info ist bei jedem client enthalten - also auch vorhanden
            🙂 mittlerweile komme ich auch bald auf eine " zu große anzahl von datenpunkten"

            was schwebt dir vor? möchtest du für einzelne clients den ap wissen (als datenpunkt) oder eher alle clients pro ap ?

            oder soll der existierende table auch auf ap sortiert werden können ?

            D 1 Reply Last reply Reply Quote 0
            • D
              dos1973 @liv-in-sky last edited by

              @liv-in-sky
              mit der Anzahl der DP ist nachvollziehbar...
              um ehrlich zu sein... habe ich noch keine Präferenz.

              für uns zH will ich die HandyDP als Anwesenheit nutzen, da wäre es einfach schön gewesen auch zu sehen auf welchem AP die sind. Sind die Kinder in ihrem Zimmer oder im WZ? 😉

              aber das kann ich auch aus der gesamtTabelle sehen...

              liv-in-sky 1 Reply Last reply Reply Quote 0
              • liv-in-sky
                liv-in-sky @dos1973 last edited by

                @dos1973

                damit bekommst du die gewünschten daten - ist nur schnell gemacht - geht vielleicht auch "eleganter" - anstatt debug einfach in einen eigenen datenpunkt schreiben - du musst das script anpassen - pfeile - grüner pfeil ist gesuchtes gerät -

                Image 3.png

                <xml xmlns="http://www.w3.org/1999/xhtml">
                 <variables>
                   <variable type="" id="1yc.2a7Fhs7Y.@zGG37T">Text</variable>
                   <variable type="undefined" id="timeout2">timeout2</variable>
                   <variable type="undefined" id="timeout">timeout</variable>
                 </variables>
                 <block type="create" id="8-a,zec2]iXXiu~KbTb)" x="-137" y="212">
                   <field name="NAME">javascript.2.WLANUnifi.MyDatapoints.GalaxyS9</field>
                   <value name="VALUE">
                     <block type="text" id="kTUip;e4veo6?X2Y`E4K">
                       <field name="TEXT">not confirmed</field>
                     </block>
                   </value>
                   <next>
                     <block type="on_ext" id="A!y(/X8n6Qvb`Z!lUY3e">
                       <mutation items="1"></mutation>
                       <field name="CONDITION">ne</field>
                       <field name="ACK_CONDITION"></field>
                       <value name="OID0">
                         <shadow type="field_oid" id="Shx?0e82RXa#t|fj+4Vl">
                           <field name="oid">javascript.2.WLANUnifi.Wifi_Client_States.Galaxy-S9</field>
                         </shadow>
                       </value>
                       <statement name="STATEMENT">
                         <block type="controls_if" id="]Ul7moybjK?G7(ZKL5L)">
                           <mutation else="1"></mutation>
                           <value name="IF0">
                             <block type="logic_compare" id="+lkUpS5T5$~i#1.YRo{!">
                               <field name="OP">EQ</field>
                               <value name="A">
                                 <block type="get_value" id="Y%OxC{vbS0/[5[2[dKL/">
                                   <field name="ATTR">val</field>
                                   <field name="OID">javascript.2.WLANUnifi.Wifi_Client_States.Galaxy-S9</field>
                                 </block>
                               </value>
                               <value name="B">
                                 <block type="logic_boolean" id=":bL3)rJ||eSgpvnSfoSO">
                                   <field name="BOOL">TRUE</field>
                                 </block>
                               </value>
                             </block>
                           </value>
                           <statement name="DO0">
                             <block type="variables_set" id="2RF.HU=*a-l=(5Awopt4">
                               <field name="VAR" id="1yc.2a7Fhs7Y.@zGG37T" variabletype="">Text</field>
                               <value name="VALUE">
                                 <block type="get_value" id="[|b=Ek5:N`EjM%RTKUjO">
                                   <field name="ATTR">val</field>
                                   <field name="OID">javascript.2.WLANUnifi.Wifi_Clients</field>
                                 </block>
                               </value>
                               <next>
                                 <block type="variables_set" id="s@!p,Bq};V;pP36{X.(9">
                                   <field name="VAR" id="1yc.2a7Fhs7Y.@zGG37T" variabletype="">Text</field>
                                   <value name="VALUE">
                                     <block type="text_getSubstring" id="u#dVe;IVeVbAncpka^BS">
                                       <mutation at1="true" at2="false"></mutation>
                                       <field name="WHERE1">FROM_START</field>
                                       <field name="WHERE2">LAST</field>
                                       <value name="STRING">
                                         <block type="variables_get" id="Q{[lBU$yCgx1!.2#l`n^">
                                           <field name="VAR" id="1yc.2a7Fhs7Y.@zGG37T" variabletype="">Text</field>
                                         </block>
                                       </value>
                                       <value name="AT1">
                                         <block type="text_indexOf" id="FM][.Nl;bnHrF!MNuiMS">
                                           <field name="END">FIRST</field>
                                           <value name="VALUE">
                                             <block type="variables_get" id="7~)t{!~XBZ28Pzj,^fR=">
                                               <field name="VAR" id="1yc.2a7Fhs7Y.@zGG37T" variabletype="">Text</field>
                                             </block>
                                           </value>
                                           <value name="FIND">
                                             <shadow type="text" id="DmUS9pqaLvo%vB:doEj5">
                                               <field name="TEXT">Galaxy-S9</field>
                                             </shadow>
                                           </value>
                                         </block>
                                       </value>
                                     </block>
                                   </value>
                                   <next>
                                     <block type="variables_set" id=");k~T3C(:kfVi5S`EnpS">
                                       <field name="VAR" id="1yc.2a7Fhs7Y.@zGG37T" variabletype="">Text</field>
                                       <value name="VALUE">
                                         <block type="text_getSubstring" id="5y)kiZ4,m%IHu]I,ps|i">
                                           <mutation at1="true" at2="false"></mutation>
                                           <field name="WHERE1">FROM_START</field>
                                           <field name="WHERE2">LAST</field>
                                           <value name="STRING">
                                             <block type="variables_get" id="8OCOES9pEJ2yZCQsXr$,">
                                               <field name="VAR" id="1yc.2a7Fhs7Y.@zGG37T" variabletype="">Text</field>
                                             </block>
                                           </value>
                                           <value name="AT1">
                                             <block type="text_indexOf" id="N|6Z]C}N!M3LtP};Uvbb">
                                               <field name="END">FIRST</field>
                                               <value name="VALUE">
                                                 <block type="variables_get" id="e{@Svtr!/9wcdwPhU?+w">
                                                   <field name="VAR" id="1yc.2a7Fhs7Y.@zGG37T" variabletype="">Text</field>
                                                 </block>
                                               </value>
                                               <value name="FIND">
                                                 <shadow type="text" id="Z0Ys#!DnZ~oA/I=?LIt4">
                                                   <field name="TEXT">.</field>
                                                 </shadow>
                                               </value>
                                             </block>
                                           </value>
                                         </block>
                                       </value>
                                       <next>
                                         <block type="variables_set" id="6.Q8yQ?KE_7C/v/VDJSD">
                                           <field name="VAR" id="1yc.2a7Fhs7Y.@zGG37T" variabletype="">Text</field>
                                           <value name="VALUE">
                                             <block type="text_getSubstring" id="LR$cr2$pkK}?Ures)nWl">
                                               <mutation at1="true" at2="false"></mutation>
                                               <field name="WHERE1">FROM_START</field>
                                               <field name="WHERE2">LAST</field>
                                               <value name="STRING">
                                                 <block type="variables_get" id="fuQSgWx*54lS86]+BdCG">
                                                   <field name="VAR" id="1yc.2a7Fhs7Y.@zGG37T" variabletype="">Text</field>
                                                 </block>
                                               </value>
                                               <value name="AT1">
                                                 <block type="math_arithmetic" id="eEB[P;*xt*[D5qD0!zWc">
                                                   <field name="OP">ADD</field>
                                                   <value name="A">
                                                     <shadow type="math_number" id="XX-m.j57IZhZ1#718vug">
                                                       <field name="NUM">1</field>
                                                     </shadow>
                                                     <block type="text_indexOf" id="#.TVXPv?aHUh;:9Jk20s">
                                                       <field name="END">FIRST</field>
                                                       <value name="VALUE">
                                                         <block type="variables_get" id="z0tHHnVZ0iN%OQjk}T~N">
                                                           <field name="VAR" id="1yc.2a7Fhs7Y.@zGG37T" variabletype="">Text</field>
                                                         </block>
                                                       </value>
                                                       <value name="FIND">
                                                         <shadow type="text" id="C`Tmbhf]]bmO2~{!ZV-n">
                                                           <field name="TEXT">&lt;td&gt;</field>
                                                         </shadow>
                                                       </value>
                                                     </block>
                                                   </value>
                                                   <value name="B">
                                                     <shadow type="math_number" id="_{p$l?7m(S]F{V4lL/z=">
                                                       <field name="NUM">4</field>
                                                     </shadow>
                                                   </value>
                                                 </block>
                                               </value>
                                             </block>
                                           </value>
                                           <next>
                                             <block type="variables_set" id="V?^!8yX!gm@{$RD$nQmK">
                                               <field name="VAR" id="1yc.2a7Fhs7Y.@zGG37T" variabletype="">Text</field>
                                               <value name="VALUE">
                                                 <block type="text_getSubstring" id="acAkFOB3p$AwM8SQYMZ1">
                                                   <mutation at1="false" at2="true"></mutation>
                                                   <field name="WHERE1">FIRST</field>
                                                   <field name="WHERE2">FROM_START</field>
                                                   <value name="STRING">
                                                     <block type="variables_get" id="681nTyoYb/?xZAQ.tY(0">
                                                       <field name="VAR" id="1yc.2a7Fhs7Y.@zGG37T" variabletype="">Text</field>
                                                     </block>
                                                   </value>
                                                   <value name="AT2">
                                                     <block type="math_arithmetic" id="U*r@5[uF|d5w3_LgCJZQ">
                                                       <field name="OP">MINUS</field>
                                                       <value name="A">
                                                         <shadow type="math_number" id="C.O6x_wlVy*X^fqX5S/t">
                                                           <field name="NUM">1</field>
                                                         </shadow>
                                                         <block type="text_indexOf" id="uT,DsnP#$HPN*,h+9$VQ">
                                                           <field name="END">FIRST</field>
                                                           <value name="VALUE">
                                                             <block type="variables_get" id="pibFbfTL%]K0IKWb_a6j">
                                                               <field name="VAR" id="1yc.2a7Fhs7Y.@zGG37T" variabletype="">Text</field>
                                                             </block>
                                                           </value>
                                                           <value name="FIND">
                                                             <shadow type="text" id="e2+q@UIeC5IMQ])2G^t(">
                                                               <field name="TEXT">&lt;/td&gt;</field>
                                                             </shadow>
                                                           </value>
                                                         </block>
                                                       </value>
                                                       <value name="B">
                                                         <shadow type="math_number" id="![bxjz,k5XRRm^K`zeZ:">
                                                           <field name="NUM">1</field>
                                                         </shadow>
                                                       </value>
                                                     </block>
                                                   </value>
                                                 </block>
                                               </value>
                                               <next>
                                                 <block type="debug" id="-BafsXO%2xUsy#p~E{Zt">
                                                   <field name="Severity">warn</field>
                                                   <value name="TEXT">
                                                     <shadow type="text" id="X1s|GX|b/EfKylZV=c)L">
                                                       <field name="TEXT">test</field>
                                                     </shadow>
                                                     <block type="variables_get" id="6v_4GYQ{w_~Xi?1=0N,#">
                                                       <field name="VAR" id="1yc.2a7Fhs7Y.@zGG37T" variabletype="">Text</field>
                                                     </block>
                                                   </value>
                                                   <next>
                                                     <block type="timeouts_settimeout" id="!MxIAnVcbY5!?LrBOg)@">
                                                       <field name="NAME">timeout</field>
                                                       <field name="DELAY">2</field>
                                                       <field name="UNIT">sec</field>
                                                       <statement name="STATEMENT">
                                                         <block type="control" id="[!K3Gg]*^*Q]iy2^2X:}">
                                                           <mutation delay_input="false"></mutation>
                                                           <field name="OID">javascript.2.WLANUnifi.MyDatapoints.GalaxyS9</field>
                                                           <field name="WITH_DELAY">FALSE</field>
                                                           <value name="VALUE">
                                                             <block type="variables_get" id="FApT7/!WW^Ys^/!v~wi(">
                                                               <field name="VAR" id="1yc.2a7Fhs7Y.@zGG37T" variabletype="">Text</field>
                                                             </block>
                                                           </value>
                                                         </block>
                                                       </statement>
                                                     </block>
                                                   </next>
                                                 </block>
                                               </next>
                                             </block>
                                           </next>
                                         </block>
                                       </next>
                                     </block>
                                   </next>
                                 </block>
                               </next>
                             </block>
                           </statement>
                           <statement name="ELSE">
                             <block type="debug" id="d|G@]10Sq+Sqa`;ANKC.">
                               <field name="Severity">warn</field>
                               <value name="TEXT">
                                 <shadow type="text" id="X1s|GX|b/EfKylZV=c)L">
                                   <field name="TEXT">test</field>
                                 </shadow>
                                 <block type="text" id="YnFI$0A7WfQ)SjQ$+3Xf">
                                   <field name="TEXT">nicht angemeldet</field>
                                 </block>
                               </value>
                               <next>
                                 <block type="timeouts_settimeout" id="-*n!K8A8}oU^PhQjf($#">
                                   <field name="NAME">timeout2</field>
                                   <field name="DELAY">2</field>
                                   <field name="UNIT">sec</field>
                                   <statement name="STATEMENT">
                                     <block type="control" id="^+#/Cur(Td1}aAS7%eNT">
                                       <mutation delay_input="false"></mutation>
                                       <field name="OID">javascript.2.WLANUnifi.MyDatapoints.GalaxyS9</field>
                                       <field name="WITH_DELAY">FALSE</field>
                                       <value name="VALUE">
                                         <block type="text" id="eYT:+8X~D;tiimV;Qv4T">
                                           <field name="TEXT">nicht angemeldet</field>
                                         </block>
                                       </value>
                                     </block>
                                   </statement>
                                 </block>
                               </next>
                             </block>
                           </statement>
                         </block>
                       </statement>
                     </block>
                   </next>
                 </block>
                </xml>
                

                das script muss einmal laufen, damit der datenpunkt angelegt wird - anschliessend kannst du die zu schreibenden datenpunkte auswählen

                1 Reply Last reply Reply Quote 0
                • liv-in-sky
                  liv-in-sky last edited by

                  neues script update - Alarm, Clients-ohne-Namen, LAN clients >> switch und usg integration und bindestriche in voucher-datenpunkte bei code

                  bei update alles unter "AB HIER NICHTS MEHR ÄNDERN " ersetzen - datenpunkte vorher löschen

                  D 1 Reply Last reply Reply Quote 0
                  • D
                    dos1973 @liv-in-sky last edited by

                    @liv-in-sky
                    Zeile 111 wirft einen Fehler

                    lk-standard-voucher

                    ich habe es aaskommentiert -> script läuft... richtig?

                    liv-in-sky 1 Reply Last reply Reply Quote 0
                    • liv-in-sky
                      liv-in-sky @dos1973 last edited by

                      @dos1973 danke dir copy fehler

                      teste bitte die neue variante - bei update alles unter "AB HIER NICHTS MEHR ÄNDERN " ersetzen -keine datenpunkte löschen

                      D 1 Reply Last reply Reply Quote 0
                      • D
                        dos1973 @liv-in-sky last edited by

                        @liv-in-sky kopiert, ersetzt, keine DP gelöscht.

                        bisher keine FM...

                        D 1 Reply Last reply Reply Quote 0
                        • D
                          dos1973 @dos1973 last edited by dos1973

                          @liv-in-sky

                          hmm, jetzt stimmen Teile meiner Clients nicht mehr mit on/offline Status überein?

                          D 1 Reply Last reply Reply Quote 0
                          • Nashra
                            Nashra Most Active Forum Testing last edited by

                            Hm, kommt davon wenn man nicht richtig liest.
                            DP alle gelöscht, neues Script rein und jetzt kommen keine Daten mehr 😞

                            PS: Fehler mit Switch auch beseitigt, Lan/Wlan komplett neu aufgesetzt 🙂

                            1 Reply Last reply Reply Quote 0
                            • D
                              dos1973 @dos1973 last edited by

                              @liv-in-sky

                              die müssten eigentlich 95% true sein.
                              Bildschirmfoto 2019-10-03 um 17.02.55.png

                              alles gelöscht und script neu gestartet hilft auch nicht...

                              1 Reply Last reply Reply Quote 0
                              • liv-in-sky
                                liv-in-sky last edited by liv-in-sky

                                @dos1973 @Nashra

                                ihr macht mir freude !

                                habe nochmal das script vom forum genommen eine andere instanz gewählt und script ausgeführt - läuft -
                                script stop - startet mal bitte eure javainstanz neu - script start

                                habt ihr auch die settings nochmal gecheckt - wurde etwas überschrieben ?

                                1 Reply Last reply Reply Quote 0
                                • Nashra
                                  Nashra Most Active Forum Testing last edited by

                                  Hat leider nicht funktioniert. Dann mal den iobroker neu gestartet, leider auch nichts gebracht.
                                  DP werden zwar angelegt aber es kommen keine Daten.

                                  liv-in-sky 1 Reply Last reply Reply Quote 0
                                  • D
                                    dos1973 last edited by

                                    bei mir nur teilweise erfolg...
                                    offline clients sind zwar zum Teil wieder auf true, aber nicht alle. Und es fehlen mir jetzt clients in der Liste die definitiv da sind, hat auch einen Alias

                                    liv-in-sky 1 Reply Last reply Reply Quote 0
                                    • liv-in-sky
                                      liv-in-sky @Nashra last edited by

                                      @Nashra überhaupt keine - bei keinem datenpunkt - werden nur angelgt, das war's

                                      Nashra 1 Reply Last reply Reply Quote 0
                                      • liv-in-sky
                                        liv-in-sky @dos1973 last edited by

                                        @dos1973 @Nashra

                                        benutzt einfach das alte script wieder

                                        unifi-main-script-27-09-19.txt

                                        D 1 Reply Last reply Reply Quote 0
                                        • D
                                          dos1973 @liv-in-sky last edited by dos1973

                                          @liv-in-sky
                                          habs wieder das alte reingenommen
                                          alle dp gelöscht

                                          was gleich auffällt, alle Clients wieder true - aber es fehlen clients...

                                          liv-in-sky 1 Reply Last reply Reply Quote 0
                                          • liv-in-sky
                                            liv-in-sky @dos1973 last edited by

                                            @dos1973 @Nashra
                                            ich muss erst etwas zeit finden um das neue script zum laufen zu bringen - das problem - bei mir läuft es - also weiß ich im moment nicht, nach was ich suchen soll

                                            falls jmd von euch lust auf eine teamviewer session hat - dann könnten wir das neue nochmal testen

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

                                            Support us

                                            ioBroker
                                            Community Adapters
                                            Donate

                                            771
                                            Online

                                            31.6k
                                            Users

                                            79.5k
                                            Topics

                                            1.3m
                                            Posts

                                            javascript monitoring
                                            46
                                            1358
                                            346218
                                            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