Ankündigung

Einklappen
Keine Ankündigung bisher.

Support Thread - "DatabaseAddOn" Plugin

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

    #61
    ooUrmeloo

    Das ist nur das Info-Log.
    Stelle bitte den Log-Level mal auf Debug.

    Dann siehst du auch, welches Item mit dem Plugins verknüpft wird und welches Datenbank-Item dazu genutzt wird.

    Kommentar


      #62
      Sorry! ... neuer Versuch. Hier mal das, was ich denke, was helfen könnte:

      Code:
      2024-04-07  22:19:45 DEBUG    plugins.db_addon    parse item: temperatur.aussen.min1d due to 'db_addon_fct'
      2024-04-07  22:19:45 DEBUG    plugins.db_addon    minmax_tag_min: item_attribute_dict={'cat': 'wertehistorie', 'on': 'change', 'sub_cat': 'onchange', 'item_type': 'num', 'calc': 'daily', 'params': False, 'description': 'Minimalwert seit Tagesbeginn'}
      2024-04-07  22:19:45 DEBUG    plugins.db_addon    Attribut 'db_addon_database_item' for item='temperatur.aussen.min1d' has been found 0 level above item at 'temperatur.aussen.min1d'.
      2024-04-07  22:19:45 DEBUG    plugins.db_addon    _database_item_path='paradigma.Aussentemperatur', temperatur.aussen.min1d
      2024-04-07  22:19:45 DEBUG    plugins.db_addon    database_item='paradigma.Aussentemperatur', db_addon_startup=None, db_addon_ignore_value_list=None, db_addon_ignore_value=None
      2024-04-07  22:19:45 DEBUG    plugins.db_addon    Item=temperatur.aussen.min1d added with db_addon_fct=minmax_tag_min and database_item=paradigma.Aussentemperatur
      2024-04-07  22:19:45 DEBUG    plugins.db_addon    Item 'temperatur.aussen.min1d' added to be run daily.
      
      
      2024-04-07  22:19:45 DEBUG    plugins.db_addon    parse item: temperatur.aussen.max1d due to 'db_addon_fct'
      2024-04-07  22:19:45 DEBUG    plugins.db_addon    minmax_tag_max: item_attribute_dict={'cat': 'wertehistorie', 'on': 'change', 'sub_cat': 'onchange', 'item_type': 'num', 'calc': 'daily', 'params': False, 'description': 'Maximalwert seit Tagesbeginn'}
      2024-04-07  22:19:45 DEBUG    plugins.db_addon    Attribut 'db_addon_database_item' for item='temperatur.aussen.max1d' has been found 0 level above item at 'temperatur.aussen.max1d'.
      2024-04-07  22:19:45 DEBUG    plugins.db_addon    _database_item_path='paradigma.Aussentemperatur', temperatur.aussen.max1d
      2024-04-07  22:19:45 DEBUG    plugins.db_addon    database_item='paradigma.Aussentemperatur', db_addon_startup=None, db_addon_ignore_value_list=None, db_addon_ignore_value=None
      2024-04-07  22:19:45 DEBUG    plugins.db_addon    Item=temperatur.aussen.max1d added with db_addon_fct=minmax_tag_max and database_item=paradigma.Aussentemperatur
      2024-04-07  22:19:45 DEBUG    plugins.db_addon    Item 'temperatur.aussen.max1d' added to be run daily.
      
      
      2024-04-07  22:19:44 DEBUG    plugins.db_addon    verbrauch_tag: item_attribute_dict={'cat': 'verbrauch', 'on': 'change', 'sub_cat': 'onchange', 'item_type': 'num', 'calc': 'daily', 'params': False, 'description': 'Verbrauch am heutigen Tag (Differenz zwischen aktuellem Wert und den Wert am Ende des vorherigen Tages)'}
      2024-04-07  22:19:44 DEBUG    plugins.db_addon    Attribut 'db_addon_database_item' for item='paradigma.Betriebsstunden_Tag_bisher' has been found 0 level above item at 'paradigma.Betriebsstunden_Tag_bisher'.
      2024-04-07  22:19:44 DEBUG    plugins.db_addon    _database_item_path='paradigma.Betriebsstunden', paradigma.Betriebsstunden_Tag_bisher
      2024-04-07  22:19:44 DEBUG    plugins.db_addon    database_item='paradigma.Betriebsstunden', db_addon_startup=None, db_addon_ignore_value_list=None, db_addon_ignore_value=None
      2024-04-07  22:19:44 DEBUG    plugins.db_addon    Item=paradigma.Betriebsstunden_Tag_bisher added with db_addon_fct=verbrauch_tag and database_item=paradigma.Betriebsstunden
      2024-04-07  22:19:44 DEBUG    plugins.db_addon    Item 'paradigma.Betriebsstunden_Tag_bisher' added to be run daily.​

      bei manuellem Trigger:

      Code:
      2024-04-07  22:24:02 INFO     plugins.db_addon    # 1 item(s) to do. || 'on-demand' item=temperatur.aussen.max1d will be processed.
      2024-04-07  22:24:02 DEBUG    plugins.db_addon    Item=temperatur.aussen.max1d with item_config={'db_addon': 'function', 'db_addon_fct': 'minmax_tag_max', 'database_item': Item: paradigma.Aussentemperatur, 'query_params': {'func': 'max', 'timeframe': 'day', 'start': 0, 'end': 0}, 'suspended': False, 'database_item_path': True, 'on': 'change', 'cycle': 'daily', 'startup': False}
      2024-04-07  22:24:02 DEBUG    plugins.db_addon    db_addon_fct='minmax_tag_max' will _query_item with params={'func': 'max', 'timeframe': 'day', 'start': 0, 'end': 0, 'database_item': Item: paradigma.Aussentemperatur}.
      2024-04-07  22:24:02 DEBUG    plugins.db_addon      called with func='max', item=paradigma.Aussentemperatur, timeframe='day', start=0, end=0, group='', group2='', ignore_value_list=None, use_oldest_entry=False
      2024-04-07  22:24:02 DEBUG    plugins.db_addon    Called with query="SELECT id, name, time, val_str, val_num, val_bool, changed FROM item WHERE name = 'paradigma.Aussentemperatur'", params={}, cur=None
      2024-04-07  22:24:02 DEBUG    plugins.db_addon    Connect to database.
      2024-04-07  22:24:02 DEBUG    plugins.db_addon    Result of query=SELECT id, name, time, val_str, val_num, val_bool, changed FROM item WHERE name = 'paradigma.Aussentemperatur': (19, 'paradigma.Aussentemperatur', 1712521293540, None, 16.7, 1, 1712521294563)
      2024-04-07  22:24:02 DEBUG    plugins.db_addon    Called with query='SELECT min(time) FROM log WHERE item_id = :item_id;', params={'item_id': 19}, cur=None
      2024-04-07  22:24:02 DEBUG    plugins.db_addon    Result of query=SELECT min(time) FROM log WHERE item_id = 19;: [(1712261852021,)]
      2024-04-07  22:24:02 DEBUG    plugins.db_addon    _get_oldest_log for item=paradigma.Aussentemperatur = 1712261852021
      2024-04-07  22:24:02 DEBUG    plugins.db_addon      Requested timeframe='day' with start=0 and end=0 resulted in start being timestamp=1712440800000/2024-04-07 00:00:00 and end being timestamp=1712527200000/2024-04-08 00:00:00
      2024-04-07  22:24:02 DEBUG    plugins.db_addon    Called with func='max', item_id=19, ts_start=1712440800000, ts_end=1712527200000, group='', group2='', ignore_value_list=None
      2024-04-07  22:24:02 DEBUG    plugins.db_addon    query='SELECT time, MAX(val_num) as value FROM log WHERE item_id = :item_id AND time BETWEEN :ts_start AND :ts_end AND val_bool = 1', params={'item_id': 19, 'ts_start': 1712440800000, 'ts_end': 1712527200000}
      2024-04-07  22:24:02 DEBUG    plugins.db_addon    Called with query='SELECT time, MAX(val_num) as value FROM log WHERE item_id = :item_id AND time BETWEEN :ts_start AND :ts_end AND val_bool = 1', params={'item_id': 19, 'ts_start': 1712440800000, 'ts_end': 1712527200000}, cur=None
      2024-04-07  22:24:02 DEBUG    plugins.db_addon    Result of query=SELECT time, MAX(val_num) as value FROM log WHERE item_id = 19 AND time BETWEEN 1712440800000 AND 1712527200000 AND val_bool = 1: [(1712493392368, 25.1)]
      2024-04-07  22:24:02 DEBUG    plugins.db_addon      result of '_query_log_timestamp' query_result=[(1712493392368, 25.1)]
      2024-04-07  22:24:02 DEBUG    plugins.db_addon      value for item=paradigma.Aussentemperatur with query_params={'func': 'max', 'item_id': 19, 'ts_start': 1712440800000, 'ts_end': 1712527200000, 'group': '', 'group2': '', 'ignore_value_list': None}: [[1712493392368, 25.1]]
      2024-04-07  22:24:02 DEBUG    plugins.db_addon    result is 25.1 for item 'temperatur.aussen.max1d' with 'db_addon_fct='minmax_tag_max''
      2024-04-07  22:24:02 INFO     plugins.db_addon      Item value for 'temperatur.aussen.max1d' will be set to 25.1​
      Warum steht denn da überall 'added to be run daily' wenn es on-change sein sollte?

      Kommentar


        #63
        Moin, ich mache gerade erste Gehversuche mit der neuesten smarthomeng Version. Ich nutze das fertige Image auf dem Raspberry. Jetzt ist smarthomeng in einer Endlosschleife wenn ich das db_addon aktiviere.
        Wie bekommt man den sqlvalidator nachinstalliert wenn es nicht automatisch funktioniert?




        HTML-Code:
        2024-04-26  22:09:07 NOTICE   lib.smarthome       --------------------   SmartHomeNG restarting, initiated by SmartHomeNG (Python package installation)   --------------------
        2024-04-26  22:09:08 NOTICE   lib.smarthome       --------------------   Init SmartHomeNG v1.10.0-master (4b25822a0)   --------------------
        2024-04-26  22:09:08 NOTICE   lib.smarthome       Running in Python interpreter 'v3.10.13 final' in virtual environment, from directory /usr/local/smarthome
        2024-04-26  22:09:08 NOTICE   lib.smarthome        - operating system 'Debian GNU/Linux 12 (bookworm)' (pid=3300)
        2024-04-26  22:09:08 NOTICE   lib.smarthome        - on 'Raspberry Pi (Rev. b03114)'
        2024-04-26  22:09:10 WARNING  lib.shpypi          test_requirements: 'sqlvalidator' not installed, any version needed
        2024-04-26  22:09:10 NOTICE   lib.shpypi          Installing plugin requirements for the current user, please wait...
        2024-04-26  22:09:10 WARNING  lib.shpypi          PIP command read from smarthome.yaml: 'python3 -m pip'
        2024-04-26  22:09:10 NOTICE   lib.shpypi          Using auto-determined PIP: 'python3 -m pip'
        2024-04-26  22:09:13 NOTICE   lib.shpypi          plugin requirements installed
        2024-04-26  22:09:13 NOTICE   lib.smarthome       --------------------   SmartHomeNG restarting, initiated by SmartHomeNG (Python package installation)   --------------------
        2024-04-26  22:09:15 NOTICE   lib.smarthome       --------------------   Init SmartHomeNG v1.10.0-master (4b25822a0)   --------------------
        2024-04-26  22:09:15 NOTICE   lib.smarthome       Running in Python interpreter 'v3.10.13 final' in virtual environment, from directory /usr/local/smarthome
        2024-04-26  22:09:15 NOTICE   lib.smarthome        - operating system 'Debian GNU/Linux 12 (bookworm)' (pid=3342)
        2024-04-26  22:09:15 NOTICE   lib.smarthome        - on 'Raspberry Pi (Rev. b03114)'
        2024-04-26  22:09:17 WARNING  lib.shpypi          test_requirements: 'sqlvalidator' not installed, any version needed
        2024-04-26  22:09:17 NOTICE   lib.shpypi          Installing plugin requirements for the current user, please wait...
        2024-04-26  22:09:17 WARNING  lib.shpypi          PIP command read from smarthome.yaml: 'python3 -m pip'
        2024-04-26  22:09:17 NOTICE   lib.shpypi          Using auto-determined PIP: 'python3 -m pip'
        2024-04-26  22:09:20 NOTICE   lib.shpypi          plugin requirements installed
        2024-04-26  22:09:20 NOTICE   lib.smarthome       --------------------   SmartHomeNG restarting, initiated by SmartHomeNG (Python package installation)   --------------------
        
        ​
        Zapft ihr Narren der König hat Durst

        Kommentar


          #64
          Wenn du als smarthome user eingeloggt bist, solltest du eigtl. eh das virtual env aktiv haben - sagt er auch in der Konsole. Dann musst du nur pip3 install sqlvalidator angeben.

          Kommentar


            #65
            Zitat von Onkelandy Beitrag anzeigen
            Dann musst du nur pip3 install sqlvalidator angeben.
            Und schon gehts. Oh man. Vielen Dank
            Zapft ihr Narren der König hat Durst

            Kommentar


              #66
              War das dein erster Start von shng? Oder der erste, der ein Requirement installieren musste?
              Ich hab bei mir auch immer wieder mal das Problem, dass die Install beim Start von shng nicht klappt. Dann aber doch wieder, bin daher nicht sicher, woran es genau liegt. Könntest du bei Gelegenheit mal ein Plugin aktivieren, das noch ein Modul braucht und neustarten und beobachten ob es klappt?

              Kommentar


                #67
                Hallo Onkelandy,

                ich habe ein seltsames Verhalten bei der Berechnung von Jahreswerten. Der Wert der im Standard berechnet wird, scheint der Rolling-Wert zu sein (genau habe ich es noch nicht nachollzogen). Wenn ich nun eine Neuberechnung im WebIF des Plugins triggere, ist der Wert korrekt, wird aber kurz danach durch den Background-Job wieder auf den falschen Wert geändert Der Fehler tritt seit dem Upgrde auf 1.10 auf. Vorher war alles korrekt

                Hier die Screenshots dazu:
                dataurl524149.png

                dataurl531467.png

                dataurl538289.png

                Any Ideas?

                Viele Grüße
                Gunnar

                Kommentar


                  #68
                  Da kann ich auf die Schnelle nichts dazu sagen, vielleicht Sisamiwe

                  Kommentar


                    #69
                    Zitat von Onkelandy Beitrag anzeigen
                    War das dein erster Start von shng? Oder der erste, der ein Requirement installieren musste?
                    Nein. Ich hatte shng mehrfach gestartet-> hat nicht geholfen. Ich habe jetzt ein paar plugins aktiviert. Sonst ist mir nichts aufgefallen. Hast du einen Vorschlag welches Plugin ich testen könnte?


                    grafik.png


                    Das AVM plugin tut auch nicht aber ich vermute das hat andere Gründe
                    Code:
                    2024-04-29  21:08:35 NOTICE   lib.smarthome       --------------------   SmartHomeNG restarting, initiated by SmartHomeNG (Python package installation)   --------------------
                    2024-04-29  21:08:36 NOTICE   lib.smarthome       --------------------   Init SmartHomeNG v1.10.0-master (4b25822a0)   --------------------
                    2024-04-29  21:08:36 NOTICE   lib.smarthome       Running in Python interpreter 'v3.10.13 final' in virtual environment, from directory /usr/local/smarthome
                    2024-04-29  21:08:36 NOTICE   lib.smarthome        - operating system 'Debian GNU/Linux 12 (bookworm)' (pid=2654)
                    2024-04-29  21:08:36 NOTICE   lib.smarthome        - on 'Raspberry Pi (Rev. b03114)'
                    2024-04-29  21:08:39 WARNING  lib.shpypi          test_requirements: 'lxml' v5.2.1 too new. Maximum v4.9.4 needed
                    2024-04-29  21:08:39 NOTICE   lib.shpypi          Installing plugin requirements for the current user, please wait...
                    2024-04-29  21:08:39 WARNING  lib.shpypi          PIP command read from smarthome.yaml: 'python3 -m pip'
                    2024-04-29  21:08:39 NOTICE   lib.shpypi          Using auto-determined PIP: 'python3 -m pip'
                    2024-04-29  21:08:42 NOTICE   lib.shpypi          plugin requirements installed​
                    Zapft ihr Narren der König hat Durst

                    Kommentar


                      #70
                      Was passiert nach dem "plugin requirements installed"? Sieht doch soweit gut aus.
                      Dass SHNG mehrfach neu gestartet wurde, ist mir klar. Mir ging's darum, ob es jemals sauber gestartet ist oder eh von vornherein hängen blieb... Jetzt beim avm Plugin scheint es ja nicht mehr zu hängen, oder? Würde meine Vermutung untermauern, dass nur beim ersten Mal, wenn ein req installiert werden muss, Probleme auftreten und dann nicht mehr.

                      Kommentar


                        #71
                        no, shng hängt in einer Endlosschleife fest

                        Code:
                        2024-05-01  17:04:37 NOTICE   lib.smarthome       --------------------   SmartHomeNG restarting, initiated by SmartHomeNG (Python package installation)   --------------------
                        2024-05-01  17:04:38 NOTICE   lib.smarthome       --------------------   Init SmartHomeNG v1.10.0-master (4b25822a0)   --------------------
                        2024-05-01  17:04:38 NOTICE   lib.smarthome       Running in Python interpreter 'v3.10.13 final' in virtual environment, from directory /usr/local/smarthome
                        2024-05-01  17:04:38 NOTICE   lib.smarthome        - operating system 'Debian GNU/Linux 12 (bookworm)' (pid=3222)
                        2024-05-01  17:04:38 NOTICE   lib.smarthome        - on 'Raspberry Pi (Rev. b03114)'
                        2024-05-01  17:04:41 WARNING  lib.shpypi          test_requirements: 'lxml' v5.2.1 too new. Maximum v4.9.4 needed
                        2024-05-01  17:04:41 NOTICE   lib.shpypi          Installing plugin requirements for the current user, please wait...
                        2024-05-01  17:04:41 NOTICE   lib.shpypi          Using auto-determined PIP: '/usr/local/smarthome/venvs/py_310/bin/pip3'
                        2024-05-01  17:04:42 NOTICE   lib.shpypi          Running in a virtualenv environment - installing plugin requirements only to current virtual environment, please wait...
                        2024-05-01  17:04:46 NOTICE   lib.shpypi          plugin requirements installed
                        2024-05-01  17:04:46 NOTICE   lib.smarthome       --------------------   SmartHomeNG restarting, initiated by SmartHomeNG (Python package installation)   --------------------
                        2024-05-01  17:04:47 NOTICE   lib.smarthome       --------------------   Init SmartHomeNG v1.10.0-master (4b25822a0)   --------------------
                        2024-05-01  17:04:47 NOTICE   lib.smarthome       Running in Python interpreter 'v3.10.13 final' in virtual environment, from directory /usr/local/smarthome
                        2024-05-01  17:04:47 NOTICE   lib.smarthome        - operating system 'Debian GNU/Linux 12 (bookworm)' (pid=3286)
                        2024-05-01  17:04:47 NOTICE   lib.smarthome        - on 'Raspberry Pi (Rev. b03114)'
                        2024-05-01  17:04:50 WARNING  lib.shpypi          test_requirements: 'lxml' v5.2.1 too new. Maximum v4.9.4 needed
                        2024-05-01  17:04:50 NOTICE   lib.shpypi          Installing plugin requirements for the current user, please wait...
                        2024-05-01  17:04:50 NOTICE   lib.shpypi          Using auto-determined PIP: '/usr/local/smarthome/venvs/py_310/bin/pip3'
                        2024-05-01  17:04:51 NOTICE   lib.shpypi          Running in a virtualenv environment - installing plugin requirements only to current virtual environment, please wait...
                        2024-05-01  17:04:54 NOTICE   lib.shpypi          plugin requirements installed
                        2024-05-01  17:04:54 NOTICE   lib.smarthome       --------------------   SmartHomeNG restarting, initiated by SmartHomeNG (Python package installation)   --------------------
                        2024-05-01  17:04:56 NOTICE   lib.smarthome       --------------------   Init SmartHomeNG v1.10.0-master (4b25822a0)   --------------------
                        2024-05-01  17:04:56 NOTICE   lib.smarthome       Running in Python interpreter 'v3.10.13 final' in virtual environment, from directory /usr/local/smarthome
                        2024-05-01  17:04:56 NOTICE   lib.smarthome        - operating system 'Debian GNU/Linux 12 (bookworm)' (pid=3348)
                        2024-05-01  17:04:56 NOTICE   lib.smarthome        - on 'Raspberry Pi (Rev. b03114)'
                        2024-05-01  17:04:58 WARNING  lib.shpypi          test_requirements: 'lxml' v5.2.1 too new. Maximum v4.9.4 needed
                        2024-05-01  17:04:58 NOTICE   lib.shpypi          Installing plugin requirements for the current user, please wait...
                        2024-05-01  17:04:58 NOTICE   lib.shpypi          Using auto-determined PIP: '/usr/local/smarthome/venvs/py_310/bin/pip3'
                        2024-05-01  17:05:00 NOTICE   lib.shpypi          Running in a virtualenv environment - installing plugin requirements only to current virtual environment, please wait...
                        2024-05-01  17:05:03 NOTICE   lib.shpypi          plugin requirements installed
                        2024-05-01  17:05:03 NOTICE   lib.smarthome       --------------------   SmartHomeNG restarting, initiated by SmartHomeNG (Python package installation)   --------------------
                        2024-05-01  17:05:05 NOTICE   lib.smarthome       --------------------   Init SmartHomeNG v1.10.0-master (4b25822a0)   --------------------​
                        Zapft ihr Narren der König hat Durst

                        Kommentar


                          #72
                          Guten Morgen,

                          ich hänge mich mal rein, in der Hoffnung keine Quatsch zu erzählen.

                          Muss das nicht noch behoben sein, damit er nicht immer wieder versucht das auf die passende Version zu bringen?
                          test_requirements: 'lxml' v5.2.1 too new. Maximum v4.9.4 needed
                          Also einmal von Hand ins venv gehen, abhängig von Deiner Umgebung - sudo smarthome; source bin/activate

                          pip3 uninstall lxml
                          pip3 install lxml==4..9.4

                          und dann mal von Hand smarthome starten.

                          Viele Grüße
                          Gunnar

                          Kommentar


                            #73
                            Hm, vielleicht ist die Dauerschleife auch deshalb, weil eben ein bereits bestehendes Paket überschrieben werden muss, evtl. klappt es drum nicht ganz. Sollte zwar nicht sein, könnte aber eine Erklärung sein, warum es teils klappt, teils nicht (zumindest bei mir). Die Logzeile besagt, dass eigentlich genau die 2 Zeilen von shng automatisch ausgeführt werden. Aber manuell klappt es auf jeden Fall..

                            .. nur - wir kommen hier grad massiv vom Thema ab. Die Requirements-Problematik sollten wir wenn denn in einen anderen Thread auslagern und uns hier auf dbaddon konzentrieren, falls es da noch Probleme gibt.

                            Kommentar


                              #74
                              Moin, das von Hand installieren hat funktioniert Aber ja das ist mittlerweile OT und bei dem Thema bin ich glaube ich keine große Hilfe...
                              Zapft ihr Narren der König hat Durst

                              Kommentar


                                #75
                                Hallo zusammen,

                                ich hole mein Issue nochmal hoch, da es vermutlich zwischen dem Startproblem untergegangen ist. Vlt. hat ja jemand eine Idee.

                                Danke
                                Gunnar

                                Zitat von gklein Beitrag anzeigen
                                Hallo Onkelandy,

                                ich habe ein seltsames Verhalten bei der Berechnung von Jahreswerten. Der Wert der im Standard berechnet wird, scheint der Rolling-Wert zu sein (genau habe ich es noch nicht nachollzogen). Wenn ich nun eine Neuberechnung im WebIF des Plugins triggere, ist der Wert korrekt, wird aber kurz danach durch den Background-Job wieder auf den falschen Wert geändert Der Fehler tritt seit dem Upgrde auf 1.10 auf. Vorher war alles korrekt

                                Hier die Screenshots dazu:
                                dataurl524149.png

                                dataurl531467.png

                                dataurl538289.png

                                Any Ideas?

                                Viele Grüße
                                Gunnar

                                Kommentar

                                Lädt...
                                X