Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Andre3000

    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

    A
    • Profile
    • Following 0
    • Followers 0
    • Topics 2
    • Posts 17
    • Best 0
    • Groups 1

    Andre3000

    @Andre3000

    Starter

    0
    Reputation
    2
    Profile views
    17
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    Andre3000 Follow
    Starter

    Latest posts made by Andre3000

    • RE: JS-Funktion mit Ergebnis - Hexadezimal zu Dezimal

      @djmarc75 Das war die Lösung! Jetzt läuft es. Ich danke euch allen für die Mühen und den super schnellen Support.

      posted in Blockly
      A
      Andre3000
    • RE: JS-Funktion mit Ergebnis - Hexadezimal zu Dezimal

      @paul53 Bildschirmfoto 2022-12-13 um 15.12.57.png

      <xml xmlns="https://developers.google.com/blockly/xml">
       <variables>
         <variable id="@wly!s9.=$P|eqoW(37w">hex</variable>
       </variables>
       <block type="procedures_defcustomreturn" id="E+7ql{WXKc5p$fl8Y~5m" x="-338" y="-862">
         <mutation statements="false">
           <arg name="hex" varid="@wly!s9.=$P|eqoW(37w"></arg>
         </mutation>
         <field name="NAME">hex2dec</field>
         <field name="SCRIPT">cmV0dXJuIHBhcnNlSW50KGhleCwgMTYpOw==</field>
         <comment pinned="false" h="80" w="160">Beschreibe diese Funktion …</comment>
       </block>
       <block type="on_ext" id="DJak+8K8`e`}DGm`i,y3" x="-325" y="-827">
         <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="K!47v4.fLS*+lYC=27C5">
             <field name="oid">0_userdata.0.Input_HEX</field>
           </shadow>
         </value>
         <statement name="STATEMENT">
           <block type="variables_set" id="~VQ$kSov,Z*_gF[+@u4B">
             <field name="VAR" id="@wly!s9.=$P|eqoW(37w">hex</field>
             <value name="VALUE">
               <block type="text_getSubstring" id="qpcNcW=(fu~!`OS+{2]x">
                 <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="N}S}nXTKY+pt*D5M|m{r">
                     <field name="ATTR">state.val</field>
                   </block>
                 </value>
                 <value name="AT1">
                   <block type="math_number" id="kKPtslp=Q]_j3}g,)_=K">
                     <field name="NUM">2</field>
                   </block>
                 </value>
               </block>
             </value>
             <next>
               <block type="control" id="smq1BY-E%^xo]/BG_*w)">
                 <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                 <field name="OID">homee.0.DimmableRGBWLight-81.Color-615</field>
                 <field name="WITH_DELAY">FALSE</field>
                 <value name="VALUE">
                   <block type="procedures_callcustomreturn" id="N;r^{^6UA!u^z9Z)yx:B">
                     <mutation name="hex2dec">
                       <arg name="hex"></arg>
                     </mutation>
                     <value name="ARG0">
                       <block type="on_source" id="PVFc5Tw;otlg~9ix;ilc">
                         <field name="ATTR">state.val</field>
                       </block>
                     </value>
                   </block>
                 </value>
                 <next>
                   <block type="debug" id="TDS|)8v`Nvfg`8BdE;g}">
                     <field name="Severity">log</field>
                     <value name="TEXT">
                       <shadow type="text" id="CE}CfbUYY,$p?AK9nlEF">
                         <field name="TEXT">test</field>
                       </shadow>
                       <block type="variables_get" id="vURGF1P.rOr,)NPQ7{0M">
                         <field name="VAR" id="@wly!s9.=$P|eqoW(37w">hex</field>
                       </block>
                     </value>
                     <next>
                       <block type="debug" id="Ei8A@Yey5*nGcLY(L8tv">
                         <field name="Severity">log</field>
                         <value name="TEXT">
                           <shadow type="text" id=")qSg]71+,+z|]El1R^R3">
                             <field name="TEXT">test</field>
                           </shadow>
                           <block type="procedures_callcustomreturn" id="iBBRl,O]@E~sqpA8,I;t">
                             <mutation name="hex2dec">
                               <arg name="hex"></arg>
                             </mutation>
                             <value name="ARG0">
                               <block type="variables_get" id="$#D7f47}*EK:YjcIHz*9">
                                 <field name="VAR" id="@wly!s9.=$P|eqoW(37w">hex</field>
                               </block>
                             </value>
                           </block>
                         </value>
                       </block>
                     </next>
                   </block>
                 </next>
               </block>
             </next>
           </block>
         </statement>
       </block>
      </xml>
      

      posted in Blockly
      A
      Andre3000
    • RE: JS-Funktion mit Ergebnis - Hexadezimal zu Dezimal

      @paul53 Die Umrechnung funktioniert jetzt auch wunderbar! Vielen Dank erstmal dafür

      14:38:50.564	info	javascript.0 (11911) script.js.common.hextodec: 19ff0d
      14:38:50.565	info	javascript.0 (11911) script.js.common.hextodec: 1703693
      

      Jetzt muss dieser Wert nur noch irgendwie in mein RGB Objekt geschrieben werden.

      posted in Blockly
      A
      Andre3000
    • RE: JS-Funktion mit Ergebnis - Hexadezimal zu Dezimal

      @paul53 Wir kommen der Sache näher!

      javascript.0 (11911) script.js.common.hextodec: ff4124  
      

      Umrechung in Dezimal Funktioniert auch!

      	javascript.0 (11911) script.js.common.hextodec: 1852159
      

      Allerdings weiterhin:

      	2022-12-13 14:28:39.069	error	homee connection error: "value must be a number"
      
      posted in Blockly
      A
      Andre3000
    • RE: JS-Funktion mit Ergebnis - Hexadezimal zu Dezimal

      @paul53 ein Hexadezimaler Farbwert z.B. "#0800ff"
      So wird es jetzt auch im Log angezeigt

      14:17:43.685	info	javascript.0 (11911) script.js.common.hextodec: #5d54ff
      
      posted in Blockly
      A
      Andre3000
    • RE: JS-Funktion mit Ergebnis - Hexadezimal zu Dezimal

      @paul53 Es wird sicher nur ne Kleinigkeit sein. Ist mein erstes blockly an dem ich mich versuche.

      {
        "common": {
          "name": "Input_HEX",
          "desc": "Manuell erzeugt",
          "role": "state",
          "type": "string",
          "read": true,
          "write": true,
          "def": 0
        },
        "type": "state",
        "native": {},
        "_id": "0_userdata.0.Input_HEX",
        "from": "system.adapter.admin.0",
        "user": "system.user.admin",
        "ts": 1670937135908
      }
      
      posted in Blockly
      A
      Andre3000
    • RE: JS-Funktion mit Ergebnis - Hexadezimal zu Dezimal

      @paul53 Danke nochmal!

      Weiterhin der selbe Fehler.

      <xml xmlns="https://developers.google.com/blockly/xml">
        <variables>
          <variable id="@wly!s9.=$P|eqoW(37w">hex</variable>
        </variables>
        <block type="procedures_defcustomreturn" id="E+7ql{WXKc5p$fl8Y~5m" x="-338" y="-862">
          <mutation statements="false">
            <arg name="hex" varid="@wly!s9.=$P|eqoW(37w"></arg>
          </mutation>
          <field name="NAME">hex2dec</field>
          <field name="SCRIPT">cmV0dXJuIHBhcnNlSW50KGhleCwgMTYpOw==</field>
          <comment pinned="false" h="80" w="160">Beschreibe diese Funktion …</comment>
        </block>
        <block type="on_ext" id="DJak+8K8`e`}DGm`i,y3" x="-325" y="-827">
          <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="K!47v4.fLS*+lYC=27C5">
              <field name="oid">0_userdata.0.Input_HEX</field>
            </shadow>
          </value>
          <statement name="STATEMENT">
            <block type="control" id="smq1BY-E%^xo]/BG_*w)">
              <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
              <field name="OID">homee.0.DimmableRGBWLight-81.Color-615</field>
              <field name="WITH_DELAY">FALSE</field>
              <value name="VALUE">
                <block type="procedures_callcustomreturn" id="N;r^{^6UA!u^z9Z)yx:B">
                  <mutation name="hex2dec">
                    <arg name="hex"></arg>
                  </mutation>
                  <value name="ARG0">
                    <block type="on_source" id="PVFc5Tw;otlg~9ix;ilc">
                      <field name="ATTR">state.val</field>
                    </block>
                  </value>
                </block>
              </value>
            </block>
          </statement>
        </block>
      </xml>
      

      @apollon77 Eventuell möchtest du mal einen Blick drauf werfen, da das ursprüngliche "Problem" darin liegt, dass der Homee Adapter den Farbwert Dezimal in Objekte schreibt, aber die meisten Color Picker eher mit HEX Werten rechnen. Ich habe dazu auf github ein Issue gefunden, dass bereits vor vielen Jahren geclosed wurde. Hat sich der selbe "Fehler" wieder eingeschlichen oder ist das mittlerweile gewollt, dass die Werte in Dezimal geliefert werden?

      Beste Grüße
      André

      posted in Blockly
      A
      Andre3000
    • RE: JS-Funktion mit Ergebnis - Hexadezimal zu Dezimal

      @paul53 Danke für deine super schnelle Rückmeldung!

      Der Fehler bleibt leider bestehen.

      	homee connection error: "value must be a number"
      
      posted in Blockly
      A
      Andre3000
    • JS-Funktion mit Ergebnis - Hexadezimal zu Dezimal

      Hi Zusammen,

      ich habe zu diesem Thema bereits unzählige Beiträge gefunden und habe ernsthaft versucht eine Lösung zu finden, jedoch bin ich jetzt an einem Punkt an dem ich nicht weiterkomme.

      Konkret habe ich folgende Anforderung:

      • Ein Color Picker schreibt in ein manuell erstelltes Objekt einen hexadezimalen Wert (bereits erfolgreich umgesetzt)
      • Dieser Wert soll mithilfe eines Skripts (z.B. auf Blockly Basis) in Dezimal umgerechnet werden
      • Anschließend soll dieser Wert in ein Objekt eines Aktors geschrieben werden

      Bildschirmfoto 2022-12-13 um 13.31.43.png

      Die Funktion sieht folgendermaßen aus:

      return parseInt(hex, 16);
      

      Fehlermeldungen erhalte ich folgende:

      homee connection error: "value must be a number"
      

      Ich würde mich übers Tipps besonders freuen.

      Danke & Grüße
      André

      posted in Blockly
      A
      Andre3000
    • RE: Temperaturregler mit Farbverlauf

      @oliverio Vielen dank für deinen Tipp! Mit der Binding Funktion sieht das ganze schon deutlich attraktiver aus. Habe ca. 22 Farben mit den Soll-Temp Werten meiner Heizungssteuerung verknüpft. Jetzt wirkt das ganze dynamischer.

      Kämpfe gerade mit einem ganz anderen Problem. Leider aktualisieren sich die Werte in den Widgets nicht mehr. D.h. ich spiele am Regler und stelle den Sollwert von 8 auf 28 Grad und der Wert (String-unescaped) verändert sich nicht. Das ist vermutlich ein Thema für einen anderen Beitrag denke ich.

      Danke & Grüße,
      André

      posted in Visualisierung
      A
      Andre3000
    Community
    Impressum | Datenschutz-Bestimmungen | Nutzungsbedingungen
    The ioBroker Community 2014-2023
    logo