Ankündigung

Einklappen
Keine Ankündigung bisher.

- √ - Google Blockly als visueller Editor für sh.py Logiken

Einklappen
X
 
  • Filter
  • Zeit
  • Anzeigen
Alles löschen
neue Beiträge

    #31
    Und dieser Fehler kommt im Debug Log
    Code:
     blockly_toolbox Logic: blockly_toolbox, File: /usr/smarthome/logics/blockly_toolbox.py, Line: 31, Method: <module>, Exception: 'Item' object has no attribute 'type' -- scheduler.py:_task:334
    Traceback (most recent call last):
      File "/usr/smarthome/lib/scheduler.py", line 327, in _task
        exec(obj.bytecode)
      File "/usr/smarthome/logics/blockly_toolbox.py", line 31, in <module>
        elif s.type() == 'num' :
    AttributeError: 'Item' object has no attribute 'type'

    Kommentar


      #32
      zuerst mal super sache, würd mich freuen wenn was draus wird.

      hier auch das "leer" Problem, egal ob chrome oder firefox.
      falls ich beim Testen helfen kann oder sonstige Infos benötigt werden, einfach melden.

      Christian
      Angehängte Dateien

      Kommentar


        #33
        Hi, danke!
        was passiert wenn du dann den "Seite neu laden" Button klickst?
        DW

        Kommentar


          #34
          Also bei mir war ein Fehler das die xml Datei in einen anderen Pfad liegt als bei dir. /usr/local/smarthome ich habe das local nicht.
          Und das andere ist das ich bei der num. str. bool list einen Fehler bekomme bei der if elif Anweisung.

          Und wo kann ich Werte einstellen wie Wahr, Unwahr und dergleichen das habe ich leider nicht zur Auswahl

          Bitte vl um Hilfe.

          Kommentar


            #35
            stimmt. kommt.

            Kommentar


              #36
              nach dem neu laden das gleiche, die xml hab ich überprüft, die findet er, hab testweise einen anderen Pfad angegeben dann kommt eine Fehlermeldung.

              nur damit ich keinen Fehler gemacht hab, deine items hab ich aus der blocky-items.conf rausgeschmissen und testweise durch

              Code:
                  [[kino_temp]]
                      type = num
                      blockly_sensor = Temperatur Kino
              		knx_dpt = 9
              		knx_cache = 3/6/0
              ersetzt

              Kommentar


                #37
                Ich glaube der ganz erste Eintrag in der conf muss [blockbly] sein das er es zuordnen kann. Oder du stellst das in der blockbly Datei um ganz am Ende wo sh.blockbly steht

                Kommentar


                  #38
                  schon klar, den ersten teil hab ich nicht angefasst, meinte das ich nur die letzten paar items gelöscht hab die die werte definieren

                  Kommentar


                    #39
                    am besten wird sein du startest dein smarthome mal mit Debug -d bei mir kam dieser Fehler

                    Code:
                    File "/usr/smarthome/logics/blockly_toolbox.py", line 31, in <module>
                        elif s.type() == 'num' :
                    AttributeError: 'Item' object has no attribute 'type'
                    vl ist bei dir da auch was komisch

                    Kommentar


                      #40
                      Hi,

                      die Item Methode type() gibt es momentan nicht in stable, die ist nur in develop vorhanden.

                      Bis bald

                      Marcus

                      Kommentar


                        #41
                        Möchte mich einmal selbst zitieren:
                        Zitat von walldi Beitrag anzeigen
                        ... müsste man mit Markus einiges abstimmen, denn ich greife an wesentlichen Stellen in die Datenstruktur über Aufrufe ein, die nicht als API veröffentlicht sind...
                        ... und evtl in aktuellen oder kommenden Versionen von smarthome.py nicht vorhanden sind.

                        Außerdem:
                        Zitat von walldi Beitrag anzeigen
                        BITTE: ... Nur auf einem Nicht-Produktiv-System installieren.
                        Nach abwägen des Für und Wider (1:0 Stimmen hier) habe ich mich dafür entschieden, in ein Plugin umzuziehen. Für dieses WE geplant...

                        Gruß, DW

                        Kommentar


                          #42
                          hab die dev version, sieht nach meinem begrenzten verständis gut aus, hier ein auszug aus dem debuglog

                          Code:
                          2015-01-17 12:33:17,210 DEBUG    blockly_toolbox Item blockly.toolbox = <xml id="toolbox" style="display: none"> <category name="Trigger"> 
                              <block type="sh_trigger_item"> 
                                   <field name="TRIG_ITEM"></field>
                                   <field name="ITEMLIST">[]</field>
                               </block> 
                              <block type="sh_trigger_cycle"></block> 
                              <block type="sh_trigger_sun"></block> 
                              <block type="sh_trigger_daily"></block> 
                          </category>
                          <category name="Sensoren">
                          <block type="sh_item_get"> 
                                           <field name="ITEM"></field>
                                           <field name="ITEMLIST">[['Temperatur Kino', 'blockly.kino_temp']]</field>
                                           <field name="TYPE">num</field>
                                       </block> 
                          </category>
                          <category name="Aktoren">
                          </category>
                          <hr></hr>
                               <category name="Logic">
                                <category name="If">
                                  <block type="controls_if"></block>
                                  <block type="controls_if">
                                    <mutation else="1"></mutation>
                                  </block>
                                  <block type="controls_if">
                                    <mutation elseif="1" else="1"></mutation>
                                  </block>
                                </category>
                                <category name="Boolean">
                                  <block type="logic_compare"></block>
                                  <block type="logic_operation"></block>
                                  <block type="logic_negate"></block>
                                  <block type="logic_boolean"></block>
                                  <block type="logic_null"></block>
                                  <block type="logic_ternary"></block>
                                </category>
                              </category>
                              <category name="Loops">
                                <block type="controls_repeat_ext">
                                  <value name="TIMES">
                                    <block type="math_number">
                                      <field name="NUM">10</field>
                                    </block>
                                  </value>
                                </block>
                                <block type="controls_whileUntil"></block>
                                <block type="controls_for">
                                  <field name="VAR">i</field>
                                  <value name="FROM">
                                    <block type="math_number">
                                      <field name="NUM">1</field>
                                    </block>
                                  </value>
                                  <value name="TO">
                                    <block type="math_number">
                                      <field name="NUM">10</field>
                                    </block>
                                  </value>
                                  <value name="BY">
                                    <block type="math_number">
                                      <field name="NUM">1</field>
                                    </block>
                                  </value>
                                </block>
                                <block type="controls_forEach"></block>
                                <block type="controls_flow_statements"></block>
                              </category>
                              <category name="Math">
                                <block type="math_number"></block>
                                <block type="math_arithmetic"></block>
                                <block type="math_single"></block>
                                <block type="math_trig"></block>
                                <block type="math_constant"></block>
                                <block type="math_number_property"></block>
                                <block type="math_change">
                                  <value name="DELTA">
                                    <block type="math_number">
                                      <field name="NUM">1</field>
                                    </block>
                                  </value>
                                </block>
                                <block type="math_round"></block>
                                <block type="math_on_list"></block>
                                <block type="math_modulo"></block>
                                <block type="math_constrain">
                                  <value name="LOW">
                                    <block type="math_number">
                                      <field name="NUM">1</field>
                                    </block>
                                  </value>
                                  <value name="HIGH">
                                    <block type="math_number">
                                      <field name="NUM">100</field>
                                    </block>
                                  </value>
                                </block>
                                <block type="math_random_int">
                                  <value name="FROM">
                                    <block type="math_number">
                                      <field name="NUM">1</field>
                                    </block>
                                  </value>
                                  <value name="TO">
                                    <block type="math_number">
                                      <field name="NUM">100</field>
                                    </block>
                                  </value>
                                </block>
                                <block type="math_random_float"></block>
                              </category>
                              <category name="Lists">
                                <block type="lists_create_empty"></block>
                                <block type="lists_create_with"></block>
                                <block type="lists_repeat">
                                  <value name="NUM">
                                    <block type="math_number">
                                      <field name="NUM">5</field>
                                    </block>
                                  </value>
                                </block>
                                <block type="lists_length"></block>
                                <block type="lists_isEmpty"></block>
                                <block type="lists_indexOf"></block>
                                <block type="lists_getIndex"></block>
                                <block type="lists_setIndex"></block>
                              </category>
                              <category name="Variables" custom="VARIABLE"></category>
                              <category name="Functions" custom="PROCEDURE"></category>
                              <hr>
                              <category name="Library">
                                <category name="Randomize">
                                  <block type="procedures_defnoreturn">
                                    <mutation>
                                      <arg name="list"></arg>
                                    </mutation>
                                    <field name="NAME">randomize</field>
                                    <statement name="STACK">
                                      <block type="controls_for" inline="true">
                                        <field name="VAR">x</field>
                                        <value name="FROM">
                                          <block type="math_number">
                                            <field name="NUM">1</field>
                                          </block>
                                        </value>
                                        <value name="TO">
                                          <block type="lists_length" inline="false">
                                            <value name="VALUE">
                                              <block type="variables_get">
                                                <field name="VAR">list</field>
                                              </block>
                                            </value>
                                          </block>
                                        </value>
                                        <value name="BY">
                                          <block type="math_number">
                                            <field name="NUM">1</field>
                                          </block>
                                        </value>
                                        <statement name="DO">
                                          <block type="variables_set" inline="false">
                                            <field name="VAR">y</field>
                                            <value name="VALUE">
                                              <block type="math_random_int" inline="true">
                                                <value name="FROM">
                                                  <block type="math_number">
                                                    <field name="NUM">1</field>
                                                  </block>
                                                </value>
                                                <value name="TO">
                                                  <block type="lists_length" inline="false">
                                                    <value name="VALUE">
                                                      <block type="variables_get">
                                                        <field name="VAR">list</field>
                                                      </block>
                                                    </value>
                                                  </block>
                                                </value>
                                              </block>
                                            </value>
                                            <next>
                                              <block type="variables_set" inline="false">
                                                <field name="VAR">temp</field>
                                                <value name="VALUE">
                                                  <block type="lists_getIndex" inline="true">
                                                    <mutation statement="false" at="true"></mutation>
                                                    <field name="MODE">GET</field>
                                                    <field name="WHERE">FROM_START</field>
                                                    <value name="AT">
                                                      <block type="variables_get">
                                                        <field name="VAR">y</field>
                                                      </block>
                                                    </value>
                                                    <value name="VALUE">
                                                      <block type="variables_get">
                                                        <field name="VAR">list</field>
                                                      </block>
                                                    </value>
                                                  </block>
                                                </value>
                                                <next>
                                                  <block type="lists_setIndex" inline="false">
                                                    <value name="AT">
                                                      <block type="variables_get">
                                                        <field name="VAR">y</field>
                                                      </block>
                                                    </value>
                                                    <value name="LIST">
                                                      <block type="variables_get">
                                                        <field name="VAR">list</field>
                                                      </block>
                                                    </value>
                                                    <value name="TO">
                                                      <block type="lists_getIndex" inline="true">
                                                        <mutation statement="false" at="true"></mutation>
                                                        <field name="MODE">GET</field>
                                                        <field name="WHERE">FROM_START</field>
                                                        <value name="AT">
                                                          <block type="variables_get">
                                                            <field name="VAR">x</field>
                                                          </block>
                                                        </value>
                                                        <value name="VALUE">
                                                          <block type="variables_get">
                                                            <field name="VAR">list</field>
                                                          </block>
                                                        </value>
                                                      </block>
                                                    </value>
                                                    <next>
                                                      <block type="lists_setIndex" inline="false">
                                                        <value name="AT">
                                                          <block type="variables_get">
                                                            <field name="VAR">x</field>
                                                          </block>
                                                        </value>
                                                        <value name="LIST">
                                                          <block type="variables_get">
                                                            <field name="VAR">list</field>
                                                          </block>
                                                        </value>
                                                        <value name="TO">
                                                          <block type="variables_get">
                                                            <field name="VAR">temp</field>
                                                          </block>
                                                        </value>
                                                      </block>
                                                    </next>
                                                  </block>
                                                </next>
                                              </block>
                                            </next>
                                          </block>
                                        </statement>
                                      </block>
                                    </statement>
                                  </block>
                                </category>
                                <category name="Jabberwocky">
                                  <block type="text_print">
                                    <value name="TEXT">
                                      <block type="text">
                                        <field name="TEXT">'Twas brillig, and the slithy toves</field>
                                      </block>
                                    </value>
                                    <next>
                                      <block type="text_print">
                                        <value name="TEXT">
                                          <block type="text">
                                            <field name="TEXT">  Did gyre and gimble in the wabe:</field>
                                          </block>
                                        </value>
                                        <next>
                                          <block type="text_print">
                                            <value name="TEXT">
                                              <block type="text">
                                                <field name="TEXT">All mimsy were the borogroves,</field>
                                              </block>
                                            </value>
                                            <next>
                                              <block type="text_print">
                                                <value name="TEXT">
                                                  <block type="text">
                                                    <field name="TEXT">  And the mome raths outgrabe.</field>
                                                  </block>
                                                </value>
                                              </block>
                                            </next>
                                          </block>
                                        </next>
                                      </block>
                                    </next>
                                  </block>
                                  <block type="text_print">
                                    <value name="TEXT">
                                      <block type="text">
                                        <field name="TEXT">"Beware the Jabberwock, my son!</field>
                                      </block>
                                    </value>
                                    <next>
                                      <block type="text_print">
                                        <value name="TEXT">
                                          <block type="text">
                                            <field name="TEXT">  The jaws that bite, the claws that catch!</field>
                                          </block>
                                        </value>
                                        <next>
                                          <block type="text_print">
                                            <value name="TEXT">
                                              <block type="text">
                                                <field name="TEXT">Beware the Jubjub bird, and shun</field>
                                              </block>
                                            </value>
                                            <next>
                                              <block type="text_print">
                                                <value name="TEXT">
                                                  <block type="text">
                                                    <field name="TEXT">  The frumious Bandersnatch!"</field>
                                                  </block>
                                                </value>
                                              </block>
                                            </next>
                                          </block>
                                        </next>
                                      </block>
                                    </next>
                                  </block>
                                </category>
                              </category></xml> via Logic None None -- item.py:__update:369
                          aber ich würd sagen walldi soll jetzt mal ganz in ruhe an seinem plugin arbeiten und dann probiere ichs nochmal wenns soweit ist. Ist ja nicht dringend.

                          Christian

                          Kommentar


                            #43
                            hi
                            wie bekommt man die dev version?
                            Danke

                            Kommentar


                              #44
                              im sh.py Verzeichnis:
                              git pull

                              Aber nur, wenn du weißt, was du tust. Vorher vielleicht ein Backup machen.

                              Gruß,
                              Hendrik

                              Kommentar


                                #45
                                bin zwar kein git profi, aber wenn man die stable version hat dann bekommt man durch einen pull doch nur wieder die stable oder? währe vorher nicht ein git checkout develop zum wechsel nach develop nötig?

                                aber wie gesagt auf jedenfall vorher ein backup machen

                                Kommentar

                                Lädt...
                                X