Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Skripten / Logik
    4. Hilfe, Batterie Status von Windows Tablet an Iobroker senden

    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

    Hilfe, Batterie Status von Windows Tablet an Iobroker senden

    This topic has been deleted. Only users with topic management privileges can see it.
    • M
      Merz @liv-in-sky last edited by

      @liv-in-sky 🤭

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

        @merz

        https://github.com/Clever/saml2/issues/199

        hat schon ab version 12 einproblem

        evtl mal testen - dieses tool kann auch über command line

        https://www.nirsoft.net/utils/battery_information_view.html

        oder mit dem befehl - kann nicht testen - kein laptop zur hand

        WMIC PATH Win32_Battery Get EstimatedChargeRemaining
        

        https://www.thewindowsclub.com/check-battery-level-using-command-line

        Hazno created this issue in Clever/saml2

        closed xmlbuilder dependency doesn't support Node 12 (LTS) #199

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

          Mit node 12 müsste es klappen.
          bitte mal ausprobieren.

          M 1 Reply Last reply Reply Quote 0
          • M
            Merz @bahnuhr last edited by Merz

            @bahnuhr ich werds gleich mal testen und gebe dann gleich Rückmeldung.
            Gleiche meldung. mit version v12.22 Screenshot 2022-03-17 184602.jpg

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

              @merz

              was zur not auch ginge

              ein batch job, der alle 10 min über taskmanager an iobroker sendet - über curl und simpleapi-adapter

              batch muss angeglichen werden
              falls der befehl curl nicht auf dem laptop ist - kann installiert werden

              batch:

              wmic path win32_battery get EstimatedChargeRemaining  |findstr/n ^^|findstr "^[2]" > tem.txt
              set /p VAR=<tem.txt
              echo %VAR%
              
              C:\Windows\SysWOW64\curl http://192.168.178.59:8087/set/0_userdata.0.data?value=%VAR%
              
              
              M 1 Reply Last reply Reply Quote 1
              • M
                Merz @liv-in-sky last edited by

                @liv-in-sky danke probiere ich gleich mal aus.

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

                  @merz die batch datei und der curl befehl - curl in das verzeichnis kopieren, welches im batch steht - oder woanders hin - auf virusscanner achten - könnte sich melden - ist aber kein virus - versprochen 🙂

                  daten.7z

                  M 1 Reply Last reply Reply Quote 1
                  • M
                    Merz @liv-in-sky last edited by

                    @liv-in-sky Danke.
                    Habe jetzt Simple Api in ioboker installiert. Aber unter adapter ist der nicht zu sehen. Nur unter Objekte habe ich Simple Api >Admin.
                    Muss ich da noch was einstellen?

                    simple-api.0
                    	2022-03-17 18:55:53.297	info	http server listening on port 8087
                    simple-api.0
                    	2022-03-17 18:55:53.281	info	Allow states only when user is owner: false
                    simple-api.0
                    	2022-03-17 18:55:53.280	info	simpleAPI server listening on port 8087
                    simple-api.0
                    	2022-03-17 18:55:53.239	info	starting. Version 2.6.3 in /opt/iobroker/node_modules/iobroker.simple-api, node: v14.19.0, js-controller: 4.0.15
                    
                    liv-in-sky 1 Reply Last reply Reply Quote 0
                    • liv-in-sky
                      liv-in-sky @Merz last edited by

                      @merz

                      nur installieren und dann die instanz einrichten mit dem port

                      mach mal refresh browser - evtl versteckt sich der adapter oder die instanz

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

                        @liv-in-sky Danke der refresh hat geholfen.
                        Diese Meldungen habe ich jetzt noch

                        simple-api.0
                        	2022-03-17 19:25:25.693	warn	Malformed URL encoding for /set/0_userdata.0.data?value=%VAR%: URIError: URI malformed
                        simple-api.0
                        	2022-03-17 19:25:25.663	warn	Malformed URL encoding for /set/0_userdata.0.data?value=%VAR%: URIError: URI malformed
                        

                        Das ist in der cmd

                        C:\Windows\system32>wmic path win32_battery get EstimatedChargeRemaining    | findstr/n ^  | findstr "^[2]"  1>tem.txt
                        
                        C:\Windows\system32>set /p VAR= 0<tem.txt
                        
                        C:\Windows\system32>echo 2:36
                        2:36
                        
                        C:\Windows\system32>C:\Windows\SysWOW64\curl http://192.168.178.82:8087/set/0_userdata.0.data?value=2:36                
                        "error: datapoint \"0_userdata.0.data\" not found"
                        C:\Windows\system32>pause
                        Drücken Sie eine beliebige Taste . . .
                        
                        

                        Im log ist nichts zu sehen von dem Wert. Ist die Meldung not found normal?
                        Er legt auch keine datei in den Ordner an. Hab es mit Adminrechte ausgefuert.

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

                          @merz

                          hast du den datenpunkt angelegt ?

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

                            @liv-in-sky jetzt ja. Aber erlich gesagt weiss ich nicht ob das richtig ist.

                            {
                              "common": {
                                "name": "data",
                                "desc": "Manuell erzeugt",
                                "role": "state",
                                "type": "number",
                                "read": true,
                                "write": true,
                                "def": 0
                              },
                              "type": "state",
                              "_id": "0_userdata.0.data_value",
                              "acl": {
                                "object": 1636,
                                "state": 1636,
                                "owner": "system.user.admin",
                                "ownerGroup": "system.group.administrator"
                              },
                              "from": "system.adapter.admin.0",
                              "user": "system.user.admin",
                              "ts": 1647544200065
                            }
                            
                            liv-in-sky 2 Replies Last reply Reply Quote 0
                            • liv-in-sky
                              liv-in-sky @Merz last edited by liv-in-sky

                              @merz

                              nicht vom type number sondern string - das gelieferete ergebnis müssen wir später noch etwas aufbereiten - in einem blockly

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

                                @merz

                                du kannst den dp auch so benennen wie es in dein ordner system paßt - hauptsache im batch ist dann der richtige drin

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

                                  @liv-in-sky hehe geil ich bekomme endlich ein wert.

                                  2:16 keine ahnung was die 2 da heissen soll aber 16 sind auf jedenfall die Batteriepozent.

                                  liv-in-sky 2 Replies Last reply Reply Quote 0
                                  • liv-in-sky
                                    liv-in-sky @Merz last edited by

                                    @merz

                                    ja - das meinte ich - ich habe den batch noch nicht so weit unter kontrolle, dass nur 16 kommt

                                    du kannst ja auf den dp triggern und schneidest das 2: ab und konvertierst das ganze zu einer zahl -damit kannst du dann entscheiden, wann du die steckdose einschaltest

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

                                      @merz

                                      ungefähr so

                                      Image 1.png

                                      M 2 Replies Last reply Reply Quote 0
                                      • M
                                        Merz @liv-in-sky last edited by

                                        @liv-in-sky cool Danke sehr ich werde es pobieren und lasse von mir hören.

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

                                          @liv-in-sky irgendwie stehe ich auf dem Schlauch. Ich habe den Blocky Baustein soweit wie in deinem Bild hinbekommen aber mehr auch nicht. Da fehlt doch noch etwas aber ich finde es einfach nicht raus. Da muss doch wenn objektid sich ändert tue etwas kriege es aber nicht hin.

                                          liv-in-sky Wal 2 Replies Last reply Reply Quote 0
                                          • liv-in-sky
                                            liv-in-sky @Merz last edited by

                                            @merz

                                            dieses script sollte funktionieren

                                            die dp musst du natürlich einstellen

                                            <xml xmlns="https://developers.google.com/blockly/xml">
                                             <variables>
                                               <variable id="$Lf)}fcFKC#]cLmegXp[">myBatt</variable>
                                               <variable id="yWPPHyOfIbj!;=rkLvao">zufall</variable>
                                             </variables>
                                             <block type="on" id="x!RuoBz@TG=H/9dZdL6u" x="-713" y="113">
                                               <field name="OID">0_userdata.0.data</field>
                                               <field name="CONDITION">ne</field>
                                               <field name="ACK_CONDITION"></field>
                                               <statement name="STATEMENT">
                                                 <block type="variables_set" id="[58bh)H?J#2(O:F6z592">
                                                   <field name="VAR" id="$Lf)}fcFKC#]cLmegXp[">myBatt</field>
                                                   <value name="VALUE">
                                                     <block type="convert_tonumber" id="LAas5RuYD2hCdp*x:aGt">
                                                       <value name="VALUE">
                                                         <block type="text_getSubstring" id="gAHdFcSp0{=2aPOJ%JJb">
                                                           <mutation at1="true" at2="false"></mutation>
                                                           <field name="WHERE1">FROM_START</field>
                                                           <field name="WHERE2">LAST</field>
                                                           <value name="STRING">
                                                             <block type="on_source" id="7,SK=E#LT#T+.|s(XlNP">
                                                               <field name="ATTR">state.val</field>
                                                             </block>
                                                           </value>
                                                           <value name="AT1">
                                                             <block type="math_number" id="m@Szh9FCM|:U[myd5,lv">
                                                               <field name="NUM">3</field>
                                                             </block>
                                                           </value>
                                                         </block>
                                                       </value>
                                                     </block>
                                                   </value>
                                                   <next>
                                                     <block type="variables_set" id="NwjJvIi~aAisSzt^@85B">
                                                       <field name="VAR" id="yWPPHyOfIbj!;=rkLvao">zufall</field>
                                                       <value name="VALUE">
                                                         <block type="math_random_int" id="T^6ZV_ZM7h[Y~5s9Ry`x">
                                                           <value name="FROM">
                                                             <shadow type="math_number" id="rRv@{v,n)-a6`U2ECfqr">
                                                               <field name="NUM">1</field>
                                                             </shadow>
                                                             <block type="math_number" id="|/S9oVn^.:VF9ef%aN2w">
                                                               <field name="NUM">25</field>
                                                             </block>
                                                           </value>
                                                           <value name="TO">
                                                             <shadow type="math_number" id="S_Ht[jD_EJc4kA,+vv6@">
                                                               <field name="NUM">45</field>
                                                             </shadow>
                                                             <block type="math_number" id="/Ryv}lntk;Ahju9tJ!.b">
                                                               <field name="NUM">45</field>
                                                             </block>
                                                           </value>
                                                         </block>
                                                       </value>
                                                       <next>
                                                         <block type="controls_if" id="u7nVBdRMxk!4DG050^pq">
                                                           <value name="IF0">
                                                             <block type="logic_operation" id=".;0fp/-xy)*B3tP6`}ym" inline="false">
                                                               <field name="OP">OR</field>
                                                               <value name="A">
                                                                 <block type="logic_compare" id="/*]7{~Dt5k({loil]huD">
                                                                   <field name="OP">LT</field>
                                                                   <value name="A">
                                                                     <block type="variables_get" id="9B4P1Nt6UH9y{!zDyu[s">
                                                                       <field name="VAR" id="$Lf)}fcFKC#]cLmegXp[">myBatt</field>
                                                                     </block>
                                                                   </value>
                                                                   <value name="B">
                                                                     <block type="variables_get" id="QsNVq0O5G^gO$KM7OGoZ">
                                                                       <field name="VAR" id="yWPPHyOfIbj!;=rkLvao">zufall</field>
                                                                     </block>
                                                                   </value>
                                                                 </block>
                                                               </value>
                                                               <value name="B">
                                                                 <block type="logic_compare" id="440}vI6yt7]6)jG1PS~]">
                                                                   <field name="OP">LT</field>
                                                                   <value name="A">
                                                                     <block type="variables_get" id="3Q0RJK=!`T?`S-.UiL7g">
                                                                       <field name="VAR" id="$Lf)}fcFKC#]cLmegXp[">myBatt</field>
                                                                     </block>
                                                                   </value>
                                                                   <value name="B">
                                                                     <block type="math_number" id="-^z{$M:z9E`Q:N}T-EyE">
                                                                       <field name="NUM">25</field>
                                                                     </block>
                                                                   </value>
                                                                 </block>
                                                               </value>
                                                             </block>
                                                           </value>
                                                           <statement name="DO0">
                                                             <block type="controls_if" id="5MYNaN$yOWvOS*l:S}zB">
                                                               <value name="IF0">
                                                                 <block type="logic_negate" id="u2/;`HpRfV7Z;rLw~v/}">
                                                                   <value name="BOOL">
                                                                     <block type="get_value" id="SS^V~PmkE8Y/11[o=?U@">
                                                                       <field name="ATTR">val</field>
                                                                       <field name="OID">0_userdata.0.schalter</field>
                                                                     </block>
                                                                   </value>
                                                                 </block>
                                                               </value>
                                                               <statement name="DO0">
                                                                 <block type="control" id="LsDY{2sCu{aW@_|:Mo(0">
                                                                   <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                                                   <field name="OID">0_userdata.0.schalter</field>
                                                                   <field name="WITH_DELAY">FALSE</field>
                                                                   <value name="VALUE">
                                                                     <block type="logic_boolean" id="eFn/ehX6rnv@R-Fua4`d">
                                                                       <field name="BOOL">TRUE</field>
                                                                     </block>
                                                                   </value>
                                                                 </block>
                                                               </statement>
                                                             </block>
                                                           </statement>
                                                           <next>
                                                             <block type="controls_if" id="DFP?aUG).`udxe4awi#s">
                                                               <value name="IF0">
                                                                 <block type="logic_compare" id="rv0789^~9E/K]du(O!nk">
                                                                   <field name="OP">GTE</field>
                                                                   <value name="A">
                                                                     <block type="variables_get" id="%?#K~ra3m@JLhlHASsZ+">
                                                                       <field name="VAR" id="$Lf)}fcFKC#]cLmegXp[">myBatt</field>
                                                                     </block>
                                                                   </value>
                                                                   <value name="B">
                                                                     <block type="math_number" id="Rkn#w0I*]LI!1mWkwlHO">
                                                                       <field name="NUM">98</field>
                                                                     </block>
                                                                   </value>
                                                                 </block>
                                                               </value>
                                                               <statement name="DO0">
                                                                 <block type="control" id="O{[WdcK?=@+S*$dCFzg:">
                                                                   <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                                                   <field name="OID">0_userdata.0.schalter</field>
                                                                   <field name="WITH_DELAY">FALSE</field>
                                                                   <value name="VALUE">
                                                                     <block type="logic_boolean" id="j%AJHjs*#6kQrI{j1ff,">
                                                                       <field name="BOOL">FALSE</field>
                                                                     </block>
                                                                   </value>
                                                                 </block>
                                                               </statement>
                                                             </block>
                                                           </next>
                                                         </block>
                                                       </next>
                                                     </block>
                                                   </next>
                                                 </block>
                                               </statement>
                                             </block>
                                            </xml>
                                            

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

                                            Support us

                                            ioBroker
                                            Community Adapters
                                            Donate

                                            581
                                            Online

                                            31.8k
                                            Users

                                            80.0k
                                            Topics

                                            1.3m
                                            Posts

                                            6
                                            48
                                            2102
                                            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