Skip to content
  • Home
  • Recent
  • Tags
  • 0 Unread 0
  • Categories
  • Unreplied
  • Popular
  • 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

  • Default (No Skin)
  • No Skin
Collapse
ioBroker Logo

Community Forum

donate donate
  1. ioBroker Community Home
  2. Deutsch
  3. Skripten / Logik
  4. Blockly
  5. Nutzungsdauer vom Handy anzeigen lassen (unifi)

NEWS

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

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

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

Nutzungsdauer vom Handy anzeigen lassen (unifi)

Scheduled Pinned Locked Moved Blockly
11 Posts 3 Posters 266 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    Roelli
    wrote on last edited by Roelli
    #1

    Hallo.

    Ich habe einen Uptime Datenpunkt im Unify-Adapter. Der zeigt mir alle 30 Sekunden einen aktuellen Wert in Sekunden an wie lange ein Gerät online ist.

    Ich würde gerne in der VIS anzeigen lassen wie lange jemand z.B. mit dem Handy online ist.
    (alle Blockly-Beispiele die ich im Netz gefunden und ausprobiert habe, haben leider nicht funktioniert)

    Hier ist mal mein nicht funktionierendes Skript:

    tutnich.jpg

    <xml xmlns="https://developers.google.com/blockly/xml">
      <variables>
        <variable id="fY_F9{eY1;h}wP?vcr()">UptimeZeit</variable>
      </variables>
      <block type="comment" id="/;ZRw=#X-(8q/6mmWt-j" x="88" y="-362">
        <field name="COMMENT">Datenpunkt anlegen</field>
        <next>
          <block type="create" id="K(QDlz0t6.{2Pq+PF_A^">
            <field name="NAME">0_userdata.0.unifi.Nutzungsdauer_Frank</field>
            <value name="VALUE">
              <block type="math_number" id="F:fd)tm:n!J6^vPJg$:H">
                <field name="NUM">0</field>
              </block>
            </value>
            <value name="COMMON">
              <block type="text" id="q6Pk,4oOFfz~N`%)`^jw">
                <field name="TEXT">{"name": "NutzungsdauerFrank", "type": "string", "unit": "h", "write": true, "read": true}</field>
              </block>
            </value>
            <next>
              <block type="comment" id="dwTsB5EXpHuS0=+=4Gp.">
                <field name="COMMENT">um 0:01 den Wert auf 0 setzen</field>
                <next>
                  <block type="schedule" id="b[lyw/{nfZfvqKs4+VvL">
                    <field name="SCHEDULE">{"time":{"exactTime":true,"start":"00:01"},"period":{"days":1}}</field>
                    <statement name="STATEMENT">
                      <block type="variables_set" id="_WC{AOB{MCn`w+CZ0:[F">
                        <field name="VAR" id="fY_F9{eY1;h}wP?vcr()">UptimeZeit</field>
                        <value name="VALUE">
                          <block type="math_number" id="ce?-+ZAn1^Gn=!,`A^J[">
                            <field name="NUM">0</field>
                          </block>
                        </value>
                      </block>
                    </statement>
                    <next>
                      <block type="comment" id="hx=3,gLEAlY2M5P9|.Zs">
                        <field name="COMMENT">Berechnen</field>
                        <next>
                          <block type="on_ext" id="8,jc8wcL/E4r7n$HaBfB">
                            <mutation xmlns="http://www.w3.org/1999/xhtml" items="1"></mutation>
                            <field name="CONDITION">ne</field>
                            <field name="ACK_CONDITION"></field>
                            <value name="OID0">
                              <shadow type="field_oid" id="?xFLO|`y~#Vhz,Q~=yLv">
                                <field name="oid">unifi.1.default.clients.18:65:90:81:be:bf.uptime</field>
                              </shadow>
                            </value>
                            <statement name="STATEMENT">
                              <block type="debug" id="?UPgrIZ-lci;kNCIfRn?">
                                <field name="Severity">log</field>
                                <value name="TEXT">
                                  <shadow type="text" id="ZoX+2y9fnOMe?v%6h$lZ">
                                    <field name="TEXT">test</field>
                                  </shadow>
                                  <block type="get_value" id="JmvnIHh%bV[/d-2oHxn,">
                                    <field name="ATTR">val</field>
                                    <field name="OID">unifi.1.default.clients.18:65:90:81:be:bf.uptime</field>
                                  </block>
                                </value>
                                <next>
                                  <block type="controls_if" id="T_5#n@lBG-_83OFlf|)D">
                                    <value name="IF0">
                                      <block type="logic_negate" id="9O]ctrj~[QMSl;srQEr@">
                                        <value name="BOOL">
                                          <block type="on_source" id="i%Re+gm?HisoQvZ;y2H?">
                                            <field name="ATTR">state.val</field>
                                          </block>
                                        </value>
                                      </block>
                                    </value>
                                    <statement name="DO0">
                                      <block type="variables_set" id="LE?[]!rh4Vs2JM3NZN5t">
                                        <field name="VAR" id="fY_F9{eY1;h}wP?vcr()">UptimeZeit</field>
                                        <value name="VALUE">
                                          <block type="math_arithmetic" id="PZ:nIxCw/6AX!Fk!_TBg" inline="false">
                                            <field name="OP">ADD</field>
                                            <value name="A">
                                              <shadow type="math_number">
                                                <field name="NUM">1</field>
                                              </shadow>
                                              <block type="variables_get" id="xcrw1;dE|qXShSx-otl[">
                                                <field name="VAR" id="fY_F9{eY1;h}wP?vcr()">UptimeZeit</field>
                                              </block>
                                            </value>
                                            <value name="B">
                                              <shadow type="math_number">
                                                <field name="NUM">1</field>
                                              </shadow>
                                              <block type="math_arithmetic" id="Invk3@2?f1O75MEI=sS!" inline="false">
                                                <field name="OP">MINUS</field>
                                                <value name="A">
                                                  <shadow type="math_number">
                                                    <field name="NUM">1</field>
                                                  </shadow>
                                                  <block type="on_source" id="e7iCe8|M,+^]3/?~+(:v">
                                                    <field name="ATTR">state.lc</field>
                                                  </block>
                                                </value>
                                                <value name="B">
                                                  <shadow type="math_number">
                                                    <field name="NUM">1</field>
                                                  </shadow>
                                                  <block type="on_source" id="lpoYv%diwkTMG@(m(`Xg">
                                                    <field name="ATTR">oldState.lc</field>
                                                  </block>
                                                </value>
                                              </block>
                                            </value>
                                          </block>
                                        </value>
                                        <next>
                                          <block type="comment" id=")8ne~ZLQBD(i(Yud=L:}">
                                            <field name="COMMENT">in Datenpunkt schreiben</field>
                                            <next>
                                              <block type="update" id=",wh2(O`,J,1c4LrU5Xd2">
                                                <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                                <field name="OID">0_userdata.0.unifi.Nutzungsdauer_Frank</field>
                                                <field name="WITH_DELAY">FALSE</field>
                                                <value name="VALUE">
                                                  <block type="variables_get" id="4+929|Af=:Z(!b}{w_Sc">
                                                    <field name="VAR" id="fY_F9{eY1;h}wP?vcr()">UptimeZeit</field>
                                                  </block>
                                                </value>
                                                <next>
                                                  <block type="debug" id="#;K;/u%_kmz(l?i0Vr5X">
                                                    <field name="Severity">log</field>
                                                    <value name="TEXT">
                                                      <shadow type="text" id="Tvr?+gMKk$:J/eB:;db[">
                                                        <field name="TEXT">test</field>
                                                      </shadow>
                                                      <block type="variables_get" id="C$k?WDu//?ZuRK?AN,ko">
                                                        <field name="VAR" id="fY_F9{eY1;h}wP?vcr()">UptimeZeit</field>
                                                      </block>
                                                    </value>
                                                  </block>
                                                </next>
                                              </block>
                                            </next>
                                          </block>
                                        </next>
                                      </block>
                                    </statement>
                                  </block>
                                </next>
                              </block>
                            </statement>
                          </block>
                        </next>
                      </block>
                    </next>
                  </block>
                </next>
              </block>
            </next>
          </block>
        </next>
      </block>
      <block type="convert_from_date" id="dY(:0?U]KEwy5hgz}SVt" disabled="true" x="863" y="-37">
        <mutation xmlns="http://www.w3.org/1999/xhtml" format="false" language="false"></mutation>
        <field name="OPTION">m</field>
        <value name="VALUE">
          <block type="variables_get" id="rN1L)t5e]@iqV^2z`ypW">
            <field name="VAR" id="fY_F9{eY1;h}wP?vcr()">UptimeZeit</field>
          </block>
        </value>
      </block>
    </xml>
    

    NUC6i7KYK M.2 32GB RAM mit Proxmox
    14 AccessPoints, 5 Switches 115 Adapter, 67913 Objekte, 57954 Zustände,126x Shelly, 26 Thermostate, Fire Tablets, DMX, USV, 18x echodot, 9xKlima, 4x heizung, beamer, 6x IP Speed dome, AiOnTheEdge, Tasmota Wemos, Fingerabdrucksensoren, VOIP TFE, Türsteuerung, BMZ,EMA

    paul53P 1 Reply Last reply
    0
    • R Roelli

      Hallo.

      Ich habe einen Uptime Datenpunkt im Unify-Adapter. Der zeigt mir alle 30 Sekunden einen aktuellen Wert in Sekunden an wie lange ein Gerät online ist.

      Ich würde gerne in der VIS anzeigen lassen wie lange jemand z.B. mit dem Handy online ist.
      (alle Blockly-Beispiele die ich im Netz gefunden und ausprobiert habe, haben leider nicht funktioniert)

      Hier ist mal mein nicht funktionierendes Skript:

      tutnich.jpg

      <xml xmlns="https://developers.google.com/blockly/xml">
        <variables>
          <variable id="fY_F9{eY1;h}wP?vcr()">UptimeZeit</variable>
        </variables>
        <block type="comment" id="/;ZRw=#X-(8q/6mmWt-j" x="88" y="-362">
          <field name="COMMENT">Datenpunkt anlegen</field>
          <next>
            <block type="create" id="K(QDlz0t6.{2Pq+PF_A^">
              <field name="NAME">0_userdata.0.unifi.Nutzungsdauer_Frank</field>
              <value name="VALUE">
                <block type="math_number" id="F:fd)tm:n!J6^vPJg$:H">
                  <field name="NUM">0</field>
                </block>
              </value>
              <value name="COMMON">
                <block type="text" id="q6Pk,4oOFfz~N`%)`^jw">
                  <field name="TEXT">{"name": "NutzungsdauerFrank", "type": "string", "unit": "h", "write": true, "read": true}</field>
                </block>
              </value>
              <next>
                <block type="comment" id="dwTsB5EXpHuS0=+=4Gp.">
                  <field name="COMMENT">um 0:01 den Wert auf 0 setzen</field>
                  <next>
                    <block type="schedule" id="b[lyw/{nfZfvqKs4+VvL">
                      <field name="SCHEDULE">{"time":{"exactTime":true,"start":"00:01"},"period":{"days":1}}</field>
                      <statement name="STATEMENT">
                        <block type="variables_set" id="_WC{AOB{MCn`w+CZ0:[F">
                          <field name="VAR" id="fY_F9{eY1;h}wP?vcr()">UptimeZeit</field>
                          <value name="VALUE">
                            <block type="math_number" id="ce?-+ZAn1^Gn=!,`A^J[">
                              <field name="NUM">0</field>
                            </block>
                          </value>
                        </block>
                      </statement>
                      <next>
                        <block type="comment" id="hx=3,gLEAlY2M5P9|.Zs">
                          <field name="COMMENT">Berechnen</field>
                          <next>
                            <block type="on_ext" id="8,jc8wcL/E4r7n$HaBfB">
                              <mutation xmlns="http://www.w3.org/1999/xhtml" items="1"></mutation>
                              <field name="CONDITION">ne</field>
                              <field name="ACK_CONDITION"></field>
                              <value name="OID0">
                                <shadow type="field_oid" id="?xFLO|`y~#Vhz,Q~=yLv">
                                  <field name="oid">unifi.1.default.clients.18:65:90:81:be:bf.uptime</field>
                                </shadow>
                              </value>
                              <statement name="STATEMENT">
                                <block type="debug" id="?UPgrIZ-lci;kNCIfRn?">
                                  <field name="Severity">log</field>
                                  <value name="TEXT">
                                    <shadow type="text" id="ZoX+2y9fnOMe?v%6h$lZ">
                                      <field name="TEXT">test</field>
                                    </shadow>
                                    <block type="get_value" id="JmvnIHh%bV[/d-2oHxn,">
                                      <field name="ATTR">val</field>
                                      <field name="OID">unifi.1.default.clients.18:65:90:81:be:bf.uptime</field>
                                    </block>
                                  </value>
                                  <next>
                                    <block type="controls_if" id="T_5#n@lBG-_83OFlf|)D">
                                      <value name="IF0">
                                        <block type="logic_negate" id="9O]ctrj~[QMSl;srQEr@">
                                          <value name="BOOL">
                                            <block type="on_source" id="i%Re+gm?HisoQvZ;y2H?">
                                              <field name="ATTR">state.val</field>
                                            </block>
                                          </value>
                                        </block>
                                      </value>
                                      <statement name="DO0">
                                        <block type="variables_set" id="LE?[]!rh4Vs2JM3NZN5t">
                                          <field name="VAR" id="fY_F9{eY1;h}wP?vcr()">UptimeZeit</field>
                                          <value name="VALUE">
                                            <block type="math_arithmetic" id="PZ:nIxCw/6AX!Fk!_TBg" inline="false">
                                              <field name="OP">ADD</field>
                                              <value name="A">
                                                <shadow type="math_number">
                                                  <field name="NUM">1</field>
                                                </shadow>
                                                <block type="variables_get" id="xcrw1;dE|qXShSx-otl[">
                                                  <field name="VAR" id="fY_F9{eY1;h}wP?vcr()">UptimeZeit</field>
                                                </block>
                                              </value>
                                              <value name="B">
                                                <shadow type="math_number">
                                                  <field name="NUM">1</field>
                                                </shadow>
                                                <block type="math_arithmetic" id="Invk3@2?f1O75MEI=sS!" inline="false">
                                                  <field name="OP">MINUS</field>
                                                  <value name="A">
                                                    <shadow type="math_number">
                                                      <field name="NUM">1</field>
                                                    </shadow>
                                                    <block type="on_source" id="e7iCe8|M,+^]3/?~+(:v">
                                                      <field name="ATTR">state.lc</field>
                                                    </block>
                                                  </value>
                                                  <value name="B">
                                                    <shadow type="math_number">
                                                      <field name="NUM">1</field>
                                                    </shadow>
                                                    <block type="on_source" id="lpoYv%diwkTMG@(m(`Xg">
                                                      <field name="ATTR">oldState.lc</field>
                                                    </block>
                                                  </value>
                                                </block>
                                              </value>
                                            </block>
                                          </value>
                                          <next>
                                            <block type="comment" id=")8ne~ZLQBD(i(Yud=L:}">
                                              <field name="COMMENT">in Datenpunkt schreiben</field>
                                              <next>
                                                <block type="update" id=",wh2(O`,J,1c4LrU5Xd2">
                                                  <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                                  <field name="OID">0_userdata.0.unifi.Nutzungsdauer_Frank</field>
                                                  <field name="WITH_DELAY">FALSE</field>
                                                  <value name="VALUE">
                                                    <block type="variables_get" id="4+929|Af=:Z(!b}{w_Sc">
                                                      <field name="VAR" id="fY_F9{eY1;h}wP?vcr()">UptimeZeit</field>
                                                    </block>
                                                  </value>
                                                  <next>
                                                    <block type="debug" id="#;K;/u%_kmz(l?i0Vr5X">
                                                      <field name="Severity">log</field>
                                                      <value name="TEXT">
                                                        <shadow type="text" id="Tvr?+gMKk$:J/eB:;db[">
                                                          <field name="TEXT">test</field>
                                                        </shadow>
                                                        <block type="variables_get" id="C$k?WDu//?ZuRK?AN,ko">
                                                          <field name="VAR" id="fY_F9{eY1;h}wP?vcr()">UptimeZeit</field>
                                                        </block>
                                                      </value>
                                                    </block>
                                                  </next>
                                                </block>
                                              </next>
                                            </block>
                                          </next>
                                        </block>
                                      </statement>
                                    </block>
                                  </next>
                                </block>
                              </statement>
                            </block>
                          </next>
                        </block>
                      </next>
                    </block>
                  </next>
                </block>
              </next>
            </block>
          </next>
        </block>
        <block type="convert_from_date" id="dY(:0?U]KEwy5hgz}SVt" disabled="true" x="863" y="-37">
          <mutation xmlns="http://www.w3.org/1999/xhtml" format="false" language="false"></mutation>
          <field name="OPTION">m</field>
          <value name="VALUE">
            <block type="variables_get" id="rN1L)t5e]@iqV^2z`ypW">
              <field name="VAR" id="fY_F9{eY1;h}wP?vcr()">UptimeZeit</field>
            </block>
          </value>
        </block>
      </xml>
      
      paul53P Offline
      paul53P Offline
      paul53
      wrote on last edited by
      #2

      @roelli sagte: Uptime Datenpunkt im Unify-Adapter. Der zeigt mir alle 30 Sekunden einen aktuellen Wert in Sekunden an wie lange ein Gerät online ist.

      Wert in s kumulativ? Ohne Zeit-Begrenzung?

      Bitte verzichtet auf Chat-Nachrichten, denn die Handhabung ist grauenhaft !
      Produktiv: RPi 2 mit S.USV, HM-MOD-RPI und SLC-USB-Stick mit root fs

      R 1 Reply Last reply
      0
      • paul53P paul53

        @roelli sagte: Uptime Datenpunkt im Unify-Adapter. Der zeigt mir alle 30 Sekunden einen aktuellen Wert in Sekunden an wie lange ein Gerät online ist.

        Wert in s kumulativ? Ohne Zeit-Begrenzung?

        R Offline
        R Offline
        Roelli
        wrote on last edited by
        #3

        @paul53
        Sieht so aus. Der Wert steigt immer nur positiv an. Ich habe allerdings auch nicht beobachten können ob, wie und wann das mal zurückgesetzt wird.

        Vermutlich ist das ja auch egal?
        Denn bei anderen Skripten scheint man lediglich die Differenz zu berechnen.
        Also.. wenn keine Änderung.. dann nix machen.
        Wenn Änderung, dann Differenz berechnen und ausgeben.

        NUC6i7KYK M.2 32GB RAM mit Proxmox
        14 AccessPoints, 5 Switches 115 Adapter, 67913 Objekte, 57954 Zustände,126x Shelly, 26 Thermostate, Fire Tablets, DMX, USV, 18x echodot, 9xKlima, 4x heizung, beamer, 6x IP Speed dome, AiOnTheEdge, Tasmota Wemos, Fingerabdrucksensoren, VOIP TFE, Türsteuerung, BMZ,EMA

        paul53P 1 Reply Last reply
        0
        • R Roelli

          @paul53
          Sieht so aus. Der Wert steigt immer nur positiv an. Ich habe allerdings auch nicht beobachten können ob, wie und wann das mal zurückgesetzt wird.

          Vermutlich ist das ja auch egal?
          Denn bei anderen Skripten scheint man lediglich die Differenz zu berechnen.
          Also.. wenn keine Änderung.. dann nix machen.
          Wenn Änderung, dann Differenz berechnen und ausgeben.

          paul53P Offline
          paul53P Offline
          paul53
          wrote on last edited by paul53
          #4

          @roelli
          Der Datenpunkt ist mit unit "h" erstellt. Du möchtest "hh:mm"?

          Blockly_temp.JPG

          <xml xmlns="https://developers.google.com/blockly/xml">
           <variables>
             <variable id="fY_F9{eY1;h}wP?vcr()">UptimeZeit</variable>
             <variable id="?EJ`gu88:dm2f6c(O0fA">uptimeHeute</variable>
           </variables>
           <block type="comment" id="/;ZRw=#X-(8q/6mmWt-j" x="88" y="-362">
             <field name="COMMENT">Datenpunkt anlegen</field>
             <next>
               <block type="create" id="K(QDlz0t6.{2Pq+PF_A^">
                 <field name="NAME">0_userdata.0.unifi.Nutzungsdauer_Frank</field>
                 <value name="VALUE">
                   <block type="math_number" id="F:fd)tm:n!J6^vPJg$:H">
                     <field name="NUM">0</field>
                   </block>
                 </value>
                 <value name="COMMON">
                   <block type="text" id="q6Pk,4oOFfz~N`%)`^jw">
                     <field name="TEXT">{"name": "NutzungsdauerFrank", "type": "string", "unit": "h", "write": true, "read": true}</field>
                   </block>
                 </value>
                 <next>
                   <block type="comment" id="dwTsB5EXpHuS0=+=4Gp.">
                     <field name="COMMENT">um 0:01 den Wert merken</field>
                     <next>
                       <block type="schedule" id="b[lyw/{nfZfvqKs4+VvL">
                         <field name="SCHEDULE">1 0 * * *</field>
                         <statement name="STATEMENT">
                           <block type="variables_set" id="_WC{AOB{MCn`w+CZ0:[F">
                             <field name="VAR" id="fY_F9{eY1;h}wP?vcr()">UptimeZeit</field>
                             <value name="VALUE">
                               <block type="get_value" id="9Ox]xc@g|k2Vl5XwkWf6">
                                 <field name="ATTR">val</field>
                                 <field name="OID">unifi.1.default.clients.18:65:90:81:be:bf.uptime</field>
                               </block>
                             </value>
                           </block>
                         </statement>
                         <next>
                           <block type="comment" id="hx=3,gLEAlY2M5P9|.Zs">
                             <field name="COMMENT">Berechnen</field>
                             <next>
                               <block type="on_ext" id="8,jc8wcL/E4r7n$HaBfB">
                                 <mutation xmlns="http://www.w3.org/1999/xhtml" items="1"></mutation>
                                 <field name="CONDITION">ne</field>
                                 <field name="ACK_CONDITION"></field>
                                 <value name="OID0">
                                   <shadow type="field_oid" id="?xFLO|`y~#Vhz,Q~=yLv">
                                     <field name="oid">unifi.1.default.clients.18:65:90:81:be:bf.uptime</field>
                                   </shadow>
                                 </value>
                                 <statement name="STATEMENT">
                                   <block type="debug" id="?UPgrIZ-lci;kNCIfRn?">
                                     <field name="Severity">log</field>
                                     <value name="TEXT">
                                       <shadow type="text" id="ZoX+2y9fnOMe?v%6h$lZ">
                                         <field name="TEXT">test</field>
                                       </shadow>
                                       <block type="on_source" id="i%Re+gm?HisoQvZ;y2H?">
                                         <field name="ATTR">state.val</field>
                                       </block>
                                     </value>
                                     <next>
                                       <block type="variables_set" id="+Ad_I(4;Hx9C#}vW2u:3">
                                         <field name="VAR" id="?EJ`gu88:dm2f6c(O0fA">uptimeHeute</field>
                                         <value name="VALUE">
                                           <block type="math_arithmetic" id="#.(*={p.K+|SSE3~X`4." inline="false">
                                             <field name="OP">ADD</field>
                                             <value name="A">
                                               <shadow type="math_number" id="ic3~jzU3Heq7a]h$my[N">
                                                 <field name="NUM">1</field>
                                               </shadow>
                                               <block type="math_arithmetic" id=".mm%y[Glk7cd6%LuRXa-">
                                                 <field name="OP">MULTIPLY</field>
                                                 <value name="A">
                                                   <shadow type="math_number" id="HcdJJ1aCFn?dZ]YwAv5h">
                                                     <field name="NUM">1000</field>
                                                   </shadow>
                                                 </value>
                                                 <value name="B">
                                                   <shadow type="math_number" id="Wkax6/#15pV!${E9IE@4">
                                                     <field name="NUM">1</field>
                                                   </shadow>
                                                   <block type="math_arithmetic" id="Invk3@2?f1O75MEI=sS!">
                                                     <field name="OP">MINUS</field>
                                                     <value name="A">
                                                       <shadow type="math_number">
                                                         <field name="NUM">1</field>
                                                       </shadow>
                                                       <block type="on_source" id="e7iCe8|M,+^]3/?~+(:v">
                                                         <field name="ATTR">state.val</field>
                                                       </block>
                                                     </value>
                                                     <value name="B">
                                                       <shadow type="math_number" id="F`gi#wosHQ0g`l.:#+pc">
                                                         <field name="NUM">1</field>
                                                       </shadow>
                                                       <block type="variables_get" id="xcrw1;dE|qXShSx-otl[">
                                                         <field name="VAR" id="fY_F9{eY1;h}wP?vcr()">UptimeZeit</field>
                                                       </block>
                                                     </value>
                                                   </block>
                                                 </value>
                                               </block>
                                             </value>
                                             <value name="B">
                                               <shadow type="math_number" id="5]u@T|+HV0Op_TI4:g(w">
                                                 <field name="NUM">1</field>
                                               </shadow>
                                               <block type="convert_from_date" id="AwmW29lLcLxZG%k;H#]4">
                                                 <mutation xmlns="http://www.w3.org/1999/xhtml" format="false" language="false"></mutation>
                                                 <field name="OPTION">object</field>
                                                 <value name="VALUE">
                                                   <block type="text" id="7Um.T_hWoFIoi=UF/(xS">
                                                     <field name="TEXT">1970-01-01 00:00</field>
                                                   </block>
                                                 </value>
                                               </block>
                                             </value>
                                           </block>
                                         </value>
                                         <next>
                                           <block type="variables_set" id="mkdE@1?+[f.d7?[}%U5V">
                                             <field name="VAR" id="?EJ`gu88:dm2f6c(O0fA">uptimeHeute</field>
                                             <value name="VALUE">
                                               <block type="convert_from_date" id="c.j)Fc5=0bDEWf6xx#+m">
                                                 <mutation xmlns="http://www.w3.org/1999/xhtml" format="false" language="false"></mutation>
                                                 <field name="OPTION">hh:mm</field>
                                                 <value name="VALUE">
                                                   <block type="variables_get" id="_re-~2thuGY^uWubf{Kp">
                                                     <field name="VAR" id="?EJ`gu88:dm2f6c(O0fA">uptimeHeute</field>
                                                   </block>
                                                 </value>
                                               </block>
                                             </value>
                                             <next>
                                               <block type="comment" id=")8ne~ZLQBD(i(Yud=L:}">
                                                 <field name="COMMENT">in Datenpunkt schreiben</field>
                                                 <next>
                                                   <block type="update" id=",wh2(O`,J,1c4LrU5Xd2">
                                                     <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                                     <field name="OID">0_userdata.0.unifi.Nutzungsdauer_Frank</field>
                                                     <field name="WITH_DELAY">FALSE</field>
                                                     <value name="VALUE">
                                                       <block type="variables_get" id="4+929|Af=:Z(!b}{w_Sc">
                                                         <field name="VAR" id="?EJ`gu88:dm2f6c(O0fA">uptimeHeute</field>
                                                       </block>
                                                     </value>
                                                     <next>
                                                       <block type="debug" id="#;K;/u%_kmz(l?i0Vr5X">
                                                         <field name="Severity">log</field>
                                                         <value name="TEXT">
                                                           <shadow type="text" id="Tvr?+gMKk$:J/eB:;db[">
                                                             <field name="TEXT">test</field>
                                                           </shadow>
                                                           <block type="variables_get" id="C$k?WDu//?ZuRK?AN,ko">
                                                             <field name="VAR" id="?EJ`gu88:dm2f6c(O0fA">uptimeHeute</field>
                                                           </block>
                                                         </value>
                                                       </block>
                                                     </next>
                                                   </block>
                                                 </next>
                                               </block>
                                             </next>
                                           </block>
                                         </next>
                                       </block>
                                     </next>
                                   </block>
                                 </statement>
                               </block>
                             </next>
                           </block>
                         </next>
                       </block>
                     </next>
                   </block>
                 </next>
               </block>
             </next>
           </block>
          </xml>
          

          Bitte verzichtet auf Chat-Nachrichten, denn die Handhabung ist grauenhaft !
          Produktiv: RPi 2 mit S.USV, HM-MOD-RPI und SLC-USB-Stick mit root fs

          R 1 Reply Last reply
          0
          • paul53P paul53

            @roelli
            Der Datenpunkt ist mit unit "h" erstellt. Du möchtest "hh:mm"?

            Blockly_temp.JPG

            <xml xmlns="https://developers.google.com/blockly/xml">
             <variables>
               <variable id="fY_F9{eY1;h}wP?vcr()">UptimeZeit</variable>
               <variable id="?EJ`gu88:dm2f6c(O0fA">uptimeHeute</variable>
             </variables>
             <block type="comment" id="/;ZRw=#X-(8q/6mmWt-j" x="88" y="-362">
               <field name="COMMENT">Datenpunkt anlegen</field>
               <next>
                 <block type="create" id="K(QDlz0t6.{2Pq+PF_A^">
                   <field name="NAME">0_userdata.0.unifi.Nutzungsdauer_Frank</field>
                   <value name="VALUE">
                     <block type="math_number" id="F:fd)tm:n!J6^vPJg$:H">
                       <field name="NUM">0</field>
                     </block>
                   </value>
                   <value name="COMMON">
                     <block type="text" id="q6Pk,4oOFfz~N`%)`^jw">
                       <field name="TEXT">{"name": "NutzungsdauerFrank", "type": "string", "unit": "h", "write": true, "read": true}</field>
                     </block>
                   </value>
                   <next>
                     <block type="comment" id="dwTsB5EXpHuS0=+=4Gp.">
                       <field name="COMMENT">um 0:01 den Wert merken</field>
                       <next>
                         <block type="schedule" id="b[lyw/{nfZfvqKs4+VvL">
                           <field name="SCHEDULE">1 0 * * *</field>
                           <statement name="STATEMENT">
                             <block type="variables_set" id="_WC{AOB{MCn`w+CZ0:[F">
                               <field name="VAR" id="fY_F9{eY1;h}wP?vcr()">UptimeZeit</field>
                               <value name="VALUE">
                                 <block type="get_value" id="9Ox]xc@g|k2Vl5XwkWf6">
                                   <field name="ATTR">val</field>
                                   <field name="OID">unifi.1.default.clients.18:65:90:81:be:bf.uptime</field>
                                 </block>
                               </value>
                             </block>
                           </statement>
                           <next>
                             <block type="comment" id="hx=3,gLEAlY2M5P9|.Zs">
                               <field name="COMMENT">Berechnen</field>
                               <next>
                                 <block type="on_ext" id="8,jc8wcL/E4r7n$HaBfB">
                                   <mutation xmlns="http://www.w3.org/1999/xhtml" items="1"></mutation>
                                   <field name="CONDITION">ne</field>
                                   <field name="ACK_CONDITION"></field>
                                   <value name="OID0">
                                     <shadow type="field_oid" id="?xFLO|`y~#Vhz,Q~=yLv">
                                       <field name="oid">unifi.1.default.clients.18:65:90:81:be:bf.uptime</field>
                                     </shadow>
                                   </value>
                                   <statement name="STATEMENT">
                                     <block type="debug" id="?UPgrIZ-lci;kNCIfRn?">
                                       <field name="Severity">log</field>
                                       <value name="TEXT">
                                         <shadow type="text" id="ZoX+2y9fnOMe?v%6h$lZ">
                                           <field name="TEXT">test</field>
                                         </shadow>
                                         <block type="on_source" id="i%Re+gm?HisoQvZ;y2H?">
                                           <field name="ATTR">state.val</field>
                                         </block>
                                       </value>
                                       <next>
                                         <block type="variables_set" id="+Ad_I(4;Hx9C#}vW2u:3">
                                           <field name="VAR" id="?EJ`gu88:dm2f6c(O0fA">uptimeHeute</field>
                                           <value name="VALUE">
                                             <block type="math_arithmetic" id="#.(*={p.K+|SSE3~X`4." inline="false">
                                               <field name="OP">ADD</field>
                                               <value name="A">
                                                 <shadow type="math_number" id="ic3~jzU3Heq7a]h$my[N">
                                                   <field name="NUM">1</field>
                                                 </shadow>
                                                 <block type="math_arithmetic" id=".mm%y[Glk7cd6%LuRXa-">
                                                   <field name="OP">MULTIPLY</field>
                                                   <value name="A">
                                                     <shadow type="math_number" id="HcdJJ1aCFn?dZ]YwAv5h">
                                                       <field name="NUM">1000</field>
                                                     </shadow>
                                                   </value>
                                                   <value name="B">
                                                     <shadow type="math_number" id="Wkax6/#15pV!${E9IE@4">
                                                       <field name="NUM">1</field>
                                                     </shadow>
                                                     <block type="math_arithmetic" id="Invk3@2?f1O75MEI=sS!">
                                                       <field name="OP">MINUS</field>
                                                       <value name="A">
                                                         <shadow type="math_number">
                                                           <field name="NUM">1</field>
                                                         </shadow>
                                                         <block type="on_source" id="e7iCe8|M,+^]3/?~+(:v">
                                                           <field name="ATTR">state.val</field>
                                                         </block>
                                                       </value>
                                                       <value name="B">
                                                         <shadow type="math_number" id="F`gi#wosHQ0g`l.:#+pc">
                                                           <field name="NUM">1</field>
                                                         </shadow>
                                                         <block type="variables_get" id="xcrw1;dE|qXShSx-otl[">
                                                           <field name="VAR" id="fY_F9{eY1;h}wP?vcr()">UptimeZeit</field>
                                                         </block>
                                                       </value>
                                                     </block>
                                                   </value>
                                                 </block>
                                               </value>
                                               <value name="B">
                                                 <shadow type="math_number" id="5]u@T|+HV0Op_TI4:g(w">
                                                   <field name="NUM">1</field>
                                                 </shadow>
                                                 <block type="convert_from_date" id="AwmW29lLcLxZG%k;H#]4">
                                                   <mutation xmlns="http://www.w3.org/1999/xhtml" format="false" language="false"></mutation>
                                                   <field name="OPTION">object</field>
                                                   <value name="VALUE">
                                                     <block type="text" id="7Um.T_hWoFIoi=UF/(xS">
                                                       <field name="TEXT">1970-01-01 00:00</field>
                                                     </block>
                                                   </value>
                                                 </block>
                                               </value>
                                             </block>
                                           </value>
                                           <next>
                                             <block type="variables_set" id="mkdE@1?+[f.d7?[}%U5V">
                                               <field name="VAR" id="?EJ`gu88:dm2f6c(O0fA">uptimeHeute</field>
                                               <value name="VALUE">
                                                 <block type="convert_from_date" id="c.j)Fc5=0bDEWf6xx#+m">
                                                   <mutation xmlns="http://www.w3.org/1999/xhtml" format="false" language="false"></mutation>
                                                   <field name="OPTION">hh:mm</field>
                                                   <value name="VALUE">
                                                     <block type="variables_get" id="_re-~2thuGY^uWubf{Kp">
                                                       <field name="VAR" id="?EJ`gu88:dm2f6c(O0fA">uptimeHeute</field>
                                                     </block>
                                                   </value>
                                                 </block>
                                               </value>
                                               <next>
                                                 <block type="comment" id=")8ne~ZLQBD(i(Yud=L:}">
                                                   <field name="COMMENT">in Datenpunkt schreiben</field>
                                                   <next>
                                                     <block type="update" id=",wh2(O`,J,1c4LrU5Xd2">
                                                       <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                                       <field name="OID">0_userdata.0.unifi.Nutzungsdauer_Frank</field>
                                                       <field name="WITH_DELAY">FALSE</field>
                                                       <value name="VALUE">
                                                         <block type="variables_get" id="4+929|Af=:Z(!b}{w_Sc">
                                                           <field name="VAR" id="?EJ`gu88:dm2f6c(O0fA">uptimeHeute</field>
                                                         </block>
                                                       </value>
                                                       <next>
                                                         <block type="debug" id="#;K;/u%_kmz(l?i0Vr5X">
                                                           <field name="Severity">log</field>
                                                           <value name="TEXT">
                                                             <shadow type="text" id="Tvr?+gMKk$:J/eB:;db[">
                                                               <field name="TEXT">test</field>
                                                             </shadow>
                                                             <block type="variables_get" id="C$k?WDu//?ZuRK?AN,ko">
                                                               <field name="VAR" id="?EJ`gu88:dm2f6c(O0fA">uptimeHeute</field>
                                                             </block>
                                                           </value>
                                                         </block>
                                                       </next>
                                                     </block>
                                                   </next>
                                                 </block>
                                               </next>
                                             </block>
                                           </next>
                                         </block>
                                       </next>
                                     </block>
                                   </statement>
                                 </block>
                               </next>
                             </block>
                           </next>
                         </block>
                       </next>
                     </block>
                   </next>
                 </block>
               </next>
             </block>
            </xml>
            

            R Offline
            R Offline
            Roelli
            wrote on last edited by
            #5

            @paul53

            Danke! Sieht wesentlich schlauer aus als mein Versuch!
            Hab's gerade ausprobiert... im Datenpunkt wird aber nur "NaN:NaN" geschrieben.
            Hab ich da was falsch gemacht? Datenpunkt falsch formatiert?
            Aber der Debugwert ist auch schon "NaN:NaN"

            NUC6i7KYK M.2 32GB RAM mit Proxmox
            14 AccessPoints, 5 Switches 115 Adapter, 67913 Objekte, 57954 Zustände,126x Shelly, 26 Thermostate, Fire Tablets, DMX, USV, 18x echodot, 9xKlima, 4x heizung, beamer, 6x IP Speed dome, AiOnTheEdge, Tasmota Wemos, Fingerabdrucksensoren, VOIP TFE, Türsteuerung, BMZ,EMA

            paul53P 1 Reply Last reply
            0
            • R Roelli

              @paul53

              Danke! Sieht wesentlich schlauer aus als mein Versuch!
              Hab's gerade ausprobiert... im Datenpunkt wird aber nur "NaN:NaN" geschrieben.
              Hab ich da was falsch gemacht? Datenpunkt falsch formatiert?
              Aber der Debugwert ist auch schon "NaN:NaN"

              paul53P Offline
              paul53P Offline
              paul53
              wrote on last edited by
              #6

              @roelli
              Füge mal eine weitere Logausgabe ein, die den Typ anzeigt:

              Bild_2021-09-05_194518.png

              Bitte verzichtet auf Chat-Nachrichten, denn die Handhabung ist grauenhaft !
              Produktiv: RPi 2 mit S.USV, HM-MOD-RPI und SLC-USB-Stick mit root fs

              R 1 Reply Last reply
              0
              • paul53P paul53

                @roelli
                Füge mal eine weitere Logausgabe ein, die den Typ anzeigt:

                Bild_2021-09-05_194518.png

                R Offline
                R Offline
                Roelli
                wrote on last edited by
                #7

                @paul53

                fehler2.jpg

                NUC6i7KYK M.2 32GB RAM mit Proxmox
                14 AccessPoints, 5 Switches 115 Adapter, 67913 Objekte, 57954 Zustände,126x Shelly, 26 Thermostate, Fire Tablets, DMX, USV, 18x echodot, 9xKlima, 4x heizung, beamer, 6x IP Speed dome, AiOnTheEdge, Tasmota Wemos, Fingerabdrucksensoren, VOIP TFE, Türsteuerung, BMZ,EMA

                paul53P 1 Reply Last reply
                0
                • R Roelli

                  @paul53

                  fehler2.jpg

                  paul53P Offline
                  paul53P Offline
                  paul53
                  wrote on last edited by
                  #8

                  @roelli
                  Die Variable UptimeZeit muss bei Skriptstart initialisiert werden, da sie sonst bis 00:01 Uhr undefined enthält.

                  Bild_2021-09-05_215142.png

                  Bitte verzichtet auf Chat-Nachrichten, denn die Handhabung ist grauenhaft !
                  Produktiv: RPi 2 mit S.USV, HM-MOD-RPI und SLC-USB-Stick mit root fs

                  R 1 Reply Last reply
                  0
                  • paul53P paul53

                    @roelli
                    Die Variable UptimeZeit muss bei Skriptstart initialisiert werden, da sie sonst bis 00:01 Uhr undefined enthält.

                    Bild_2021-09-05_215142.png

                    R Offline
                    R Offline
                    Roelli
                    wrote on last edited by
                    #9

                    @paul53

                    Das Script scheint generell zu funktionieren. Es zählt hoch.
                    Allerdings scheint es zu viel und/oder zu oft zu zählen.
                    (ich habe morgens früh schon 10Stunden dort stehen)

                    Möglicherweise ist aber auch der Datenpunkt vom unify Controller nicht der beste.
                    Hast Du auch unify? Läuft's bei Dir?

                    Danke,
                    Frank.

                    NUC6i7KYK M.2 32GB RAM mit Proxmox
                    14 AccessPoints, 5 Switches 115 Adapter, 67913 Objekte, 57954 Zustände,126x Shelly, 26 Thermostate, Fire Tablets, DMX, USV, 18x echodot, 9xKlima, 4x heizung, beamer, 6x IP Speed dome, AiOnTheEdge, Tasmota Wemos, Fingerabdrucksensoren, VOIP TFE, Türsteuerung, BMZ,EMA

                    HomoranH paul53P 2 Replies Last reply
                    0
                    • R Roelli

                      @paul53

                      Das Script scheint generell zu funktionieren. Es zählt hoch.
                      Allerdings scheint es zu viel und/oder zu oft zu zählen.
                      (ich habe morgens früh schon 10Stunden dort stehen)

                      Möglicherweise ist aber auch der Datenpunkt vom unify Controller nicht der beste.
                      Hast Du auch unify? Läuft's bei Dir?

                      Danke,
                      Frank.

                      HomoranH Do not disturb
                      HomoranH Do not disturb
                      Homoran
                      Global Moderator Administrators
                      wrote on last edited by Homoran
                      #10

                      @roelli sagte in Nutzungsdauer vom Handy anzeigen lassen (unifi):

                      Möglicherweise ist aber auch der Datenpunkt vom unify Controller nicht der beste.

                      der zeigt IMHO die komplette Verbindungszeit zum AP an, nicht die Onlinezeit

                      Passt es denn zu den Werten im Unifi-Controller
                      unifi_Betriebszeit.png
                      hier die letzte Spalte.
                      Ich nutze den Adapter nicht

                      kein Support per PN! - Fragen im Forum stellen - es gibt fast nichts, was nicht auch für andere interessant ist.

                      Benutzt das Voting rechts unten im Beitrag wenn er euch geholfen hat.

                      der Installationsfixer: curl -fsL https://iobroker.net/fix.sh | bash -

                      1 Reply Last reply
                      0
                      • R Roelli

                        @paul53

                        Das Script scheint generell zu funktionieren. Es zählt hoch.
                        Allerdings scheint es zu viel und/oder zu oft zu zählen.
                        (ich habe morgens früh schon 10Stunden dort stehen)

                        Möglicherweise ist aber auch der Datenpunkt vom unify Controller nicht der beste.
                        Hast Du auch unify? Läuft's bei Dir?

                        Danke,
                        Frank.

                        paul53P Offline
                        paul53P Offline
                        paul53
                        wrote on last edited by
                        #11

                        @roelli sagte: Hast Du auch unify?

                        Nein.

                        Bitte verzichtet auf Chat-Nachrichten, denn die Handhabung ist grauenhaft !
                        Produktiv: RPi 2 mit S.USV, HM-MOD-RPI und SLC-USB-Stick mit root fs

                        1 Reply Last reply
                        0
                        Reply
                        • Reply as topic
                        Log in to reply
                        • Oldest to Newest
                        • Newest to Oldest
                        • Most Votes


                        Support us

                        ioBroker
                        Community Adapters
                        Donate

                        777

                        Online

                        32.4k

                        Users

                        81.5k

                        Topics

                        1.3m

                        Posts
                        Community
                        Impressum | Datenschutz-Bestimmungen | Nutzungsbedingungen | Einwilligungseinstellungen
                        ioBroker Community 2014-2025
                        logo
                        • Login

                        • Don't have an account? Register

                        • Login or register to search.
                        • First post
                          Last post
                        0
                        • Home
                        • Recent
                        • Tags
                        • Unread 0
                        • Categories
                        • Unreplied
                        • Popular
                        • GitHub
                        • Docu
                        • Hilfe