Ankündigung

Einklappen
Keine Ankündigung bisher.

Support-Thread für das Backend-Plugin

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

    Moin,

    in diesem Sinne habe ich mir Blockly mal angesehen.
    Ich schreibe dazu im Blockly Thread mal.

    Gruß,
    Hendrik

    Kommentar


      henfri siehe meinen Kommentar dort

      Kommentar


        Hallo,

        ich habe jetzt mal das Plugin ausprobiert. Ich vermisse die Funktion die einzelnen Dienste wie z.B. smarthome.py neu starten zu können. Gibt es das nicht oder habe ich es nicht gefunden?

        Gtruß

        Sebastian

        Kommentar


          Sprocky im developer mode (siehe https://github.com/smarthomeNG/smart...end#pluginconf) gibts das für knxd via systemd. von mir aber noch nie getestet weil das mein synology nicht kann.. smarthome.py neu starten ist suboptimal, weil dann das plugin abraucht

          dafür kannst du logiken neu laden, um an denen zu arbeiten, musst du also nicht alles neu starten

          Kommentar


            Servus

            FYI:
            Die Beschreibung in der plugin.conf und im Wiki, developer_mode = on, ist falsch. "on" geht nicht, "True" geht.

            Gruß, Martin

            Kommentar


              doch richtig., dass die aussage oben falsch ist.. das backend verwendet die to_bool aus der lib/utils.py

              Code:
                  def to_bool(value, default='exception'):
                      """
                      Converts a value to boolean.
                      Raises exception if value is a string and can't be converted and if no default value is given
                      Case is ignored. These string values are allowed
                         True: 'True', "1", "true", "yes", "y", "t", "on"
                         False: "", "0", "faLse", "no", "n", "f", "off"
                      Non-string values are passed to bool constructor.
                      :param value : value to convert
                      :param default: optional, value to return if value can not be parsed,
                      if default is not set this method throws an exception
                      :type value: str, object, int, ...
                      :return: True if cant be converted and is true, False otherwise.
                      :rtype: bool
              
                      """
                      if type(value) == type(''):
                          if value.lower() in ("yes", "y", "true",  "t", "1","on"):
                              return True
                          if value.lower() in ("no",  "n", "false", "f", "0", "off", ""):
                              return False
                          if default=='exception':
                              raise Exception('Invalid value for boolean conversion: ' + value)
                          else:
                              return default
                      return bool(value)
              Im backend:
              Code:
                  def my_to_bool(self, value, attr='', default=False):
                      try:
                          result = self.to_bool(value) #das backend erbt vom smartplugin, das von der utils erbt!
                      except:
                          result = default
                          self.logger.error("BackendServer: Invalid value '"+str(value)+"' configured for attribute "+attr+" in plugin.conf, using '"+str(result)+"' instead")
                      return result
              [...]
              self.developer_mode =  self.my_to_bool(developer_mode, 'developer_mode', False)
              Zuletzt geändert von psilo; 22.02.2017, 16:08.

              Kommentar


                Kann ich in der /etc/logging.yaml den cherrypy.access und cherrypy.error umbiegen? Und wenn ja, wie?

                Hab schon einiges versucht aber aus dem smarthome.log bekomme ich die Servermeldungen nicht raus.

                Code:
                2017-03-09  15:37:30 INFO     cherrypy.access.140031804390256 192.168.1.11 - - [09/Mar/2017:15:37:30] "GET /item_detail_json.html?item_path=zentral.verbrauchsdaten.energiewert.klaeranlage.verbrauch.stuendlich HTTP/1.1" 200 1099 "http://192.168.1.152:8383/items.html" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36"
                2017-03-09  15:37:41 INFO     cherrypy.access.140031804390256 192.168.1.11 - - [09/Mar/2017:15:37:41] "GET /item_detail_json.html?item_path=zentral.verbrauchsdaten.energiewert.klaeranlage HTTP/1.1" 200 932 "http://192.168.1.152:8383/items.html" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36"
                2017-03-09  15:37:44 INFO     cherrypy.access.140031804390256 192.168.1.11 - - [09/Mar/2017:15:37:44] "GET /item_detail_json.html?item_path=zentral.verbrauchsdaten.energiewert.klaeranlage.verbrauch HTTP/1.1" 200 696 "http://192.168.1.152:8383/items.html" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36"
                Danke

                Kommentar


                  Ich kann auf das Backend nicht zugreifen mit Port 8383
                  Fehler: Verbindung fehlgeschlagen

                  habe folgendes installiert:
                  sudo pip3 install cherrypy sudo pip3 install jinja2
                  Code:
                  [BackendServer]    
                  class_name = BackendServer    
                  class_path = plugins.backend    
                  #ip = xxx.xxx.xxx.xxx    
                  #port = 8383    
                  #updates_allowed = True    
                  #threads = 8    
                  #user = admin    
                  #password = very_secure_password    
                  #hashed_password = 1245a9633edf47b7091f37c4d294b5be5a9936c81c5359b16d1c4833729965663f1943ef240959c53803fedef7ac19bd59c66ad7e7092d7dbf155ce45884607d    
                  #language = en    
                  #developer_mode = on    
                  #pypi_timeout = 5
                  fehlt sonst noch etwas?
                  schreiben über groupswrite funktioniert

                  auf SmartVISU kann ich zugreifen

                  Kommentar


                    Wie hast Du denn versucht auf das Backend zuzugreifen? Mit '<smarthomeng-IP>:8383' im Webbrowser?

                    Und welche Meldungen erscheinen während der Zugriffsversuches im Debuglog?
                    Zuletzt geändert von bmx; 05.04.2017, 12:41.

                    Kommentar


                      Hab die Error und Warnings rauskopiert
                      HTML-Code:
                      smarthome@sh:/usr/local/smarthome/bin$ python3 ./smarthome.py -d
                      2017-04-05 13:48:27 WARNING  smarthome    Main         --------------------   In                                                                             it smarthomeNG 1.2.0.man   -------------------- -- smarthome.py:__init__:195
                      2017-04-05 13:48:28 WARNING  __init__     Main          -- __init__.py:__init__:                                                                             70
                      2017-04-05 13:48:28 WARNING  __init__     Main         +========================                                                                             ====================================================+ -- __init__.py:__init__:71
                      2017-04-05 13:48:28 WARNING  __init__     Main         ! The VISU plugin is depr                                                                             ecated                                              ! -- __init__.py:__init__:72
                      2017-04-05 13:48:28 WARNING  __init__     Main         ! - Please switch to the                                                                              VISU_WEBSOCKET and VISU_SMARTVISU plugins           ! -- __init__.py:__init__:73
                      2017-04-05 13:48:28 WARNING  __init__     Main         ! - The old VISU plugin w                                                                             ill be removed in the upcoming smarthomeNG v1.3     ! -- __init__.py:__init__:74
                      2017-04-05 13:48:28 WARNING  __init__     Main         !                                                                                                                                                         ! -- __init__.py:__init__:75
                      2017-04-05 13:48:28 WARNING  __init__     Main         ! Please read:                                                                                                                                            ! -- __init__.py:__init__:76
                      2017-04-05 13:48:28 WARNING  __init__     Main         !   https://github.com/sm                                                                             arthomeNG/smarthome/wiki/Visu_Unterstützung_in_v1.2 ! -- __init__.py:__init__:77
                      2017-04-05 13:48:28 WARNING  __init__     Main         +========================                                                                             ====================================================+ -- __init__.py:__init__:78
                      2017-04-05 13:48:28 WARNING  __init__     Main          -- __init__.py:__init__:                                                                             79
                      2017-04-05 13:48:30 WARNING  item         system.datum_uhrzeit.sonne.position It                                                                             em system.datum_uhrzeit.sonne.position: value (3.404276132583618, 0.826763987541                                                                             1987) does not match type num. Via Init None -- item.py:__update:358
                      2017-04-05 13:48:30 WARNING  item         Novelan.temperatur.aussen.max Item Nov                                                                             elan.temperatur.aussen.max: problem evaluating sh.Novlean.temperatur.aussen.db('                                                                             max', '24h'): 'SmartHome' object has no attribute 'Novlean' -- item.py:__run_eva                                                                             l:342
                      2017-04-05 13:48:30 WARNING  logic        Main         Garage_Lueften: Could not                                                                              access logic file (/usr/local/smarthome/logics/garage_lueften.py) => ignoring.                                                                              -- logic.py:generate_bytecode:114
                      2017-04-05 13:48:30 ERROR    logic        Main         Exception: inconsistent u                                                                             se of tabs and spaces in indentation (haustuer_lauten.py, line 8) -- logic.py:ge                                                                             nerate_bytecode:121
                      Traceback (most recent call last):
                        File "/usr/local/smarthome/lib/logic.py", line 119, in generate_bytecode
                          self.bytecode = compile(code, self.filename, 'exec')
                        File "/usr/local/smarthome/logics/haustuer_lauten.py", line 8
                          if sh.enigma2.vusolo2.e2instandby() == 0:
                                                                  ^
                      TabError: inconsistent use of tabs and spaces in indentation
                      2017-04-05 13:48:30 WARNING  logic        Main         Balkon_rechts_Tuer_Sperre                                                                             : Could not access logic file (/usr/local/smarthome/logics/balkon-tuer_rechts.py                                                                             ) => ignoring. -- logic.py:generate_bytecode:114
                      2017-04-05 13:48:30 WARNING  logic        Main         Kueche_Tuer_Sperre: Could                                                                              not access logic file (/usr/local/smarthome/logics/kueche-tuer.py) => ignoring.                                                                              -- logic.py:generate_bytecode:114
                      2017-04-05 13:48:30 WARNING  logic        Main         TagNacht_GangOG: Could no                                                                             t access logic file (/usr/local/smarthome/logics/dimmen_TagNacht_Gang_OG.py) =>                                                                              ignoring. -- logic.py:generate_bytecode:114
                      2017-04-05 13:48:30 WARNING  logic        Main         Balkon_links_Tuer_Sperre:                                                                              Could not access logic file (/usr/local/smarthome/logics/balkon-tuer_links.py)                                                                              => ignoring. -- logic.py:generate_bytecode:114
                      2017-04-05 13:48:30 WARNING  logic        Main         WZ_Tuer_Sperre: Could not                                                                              access logic file (/usr/local/smarthome/logics/wz-tuer.py) => ignoring. -- logi                                                                             c.py:generate_bytecode:114
                      2017-04-05 13:48:30 WARNING  logic        Main         WZ_TVSAT_EinAus: Could no                                                                             t access logic file (/usr/local/smarthome/logics/tv_und_sat_ein.py) => ignoring.                                                                              -- logic.py:generate_bytecode:114
                      2017-04-05 13:48:30 WARNING  logic        Main         Schrankraum_Tuer_Sperre:                                                                              Could not access logic file (/usr/local/smarthome/logics/schrankraum-tuer.py) =>                                                                              ignoring. -- logic.py:generate_bytecode:114
                      2017-04-05 13:48:30 WARNING  logic        Main         Alarm_ausloesen: Could no                                                                             t access logic file (/usr/local/smarthome/logics/alarmanlage.py) => ignoring. --                                                                              logic.py:generate_bytecode:114
                      2017-04-05 13:48:30 WARNING  logic        Main         WZ_Licht_bei_TV: Could no                                                                             t access logic file (/usr/local/smarthome/logics/tv_licht-rollo.py) => ignoring.                                                                              -- logic.py:generate_bytecode:114
                      2017-04-05 13:48:30 WARNING  logic        Main         EZ_Tuer_Sperre: Could not                                                                              access logic file (/usr/local/smarthome/logics/ez-tuer.py) => ignoring. -- logi                                                                             c.py:generate_bytecode:114
                      2017-04-05 13:48:30 WARNING  logic        Main         Terrasse_Licht_BWM_AlarmO                                                                             ffOn: Could not access logic file (/usr/local/smarthome/logics/bwm-terrasse_terr                                                                             assenlicht.py) => ignoring. -- logic.py:generate_bytecode:114
                      2017-04-05 13:48:30 WARNING  logic        Main         TagNacht_WCOG: Could not                                                                              access logic file (/usr/local/smarthome/logics/dimmen_TagNacht_WC_OG.py) => igno                                                                             ring. -- logic.py:generate_bytecode:114
                      [05/Apr/2017:13:48:30] ENGINE Bus STARTING
                      2017-04-05 13:48:30 INFO     _cplogging   BackendServer [05/Apr/2017:13:48:30] E                                                                             NGINE Bus STARTING -- _cplogging.py:error:219
                      CherryPy Checker:
                      dir is an absolute path, even though a root is provided.
                      section: [/static]
                      root: '/usr/local/smarthome/plugins/backend'
                      dir: '/usr/local/smarthome/plugins/backend/static'
                      Sind einige Plugin und Item Fehler, kommt daher weil eine alte Installation zerschossen habe und ich nur wenige Dateien gesichert hab.

                      Kommentar


                        Interessant wird es da, wo Dein Log aufhört ... Was passiert im Log, wenn Du versuchst auf's Backend via Webbrowser zuzugreifen?

                        Kommentar


                          Zerschiesst der Fehler in seiner Logik nicht vielleicht generell was? Ich würde die erstmal korrigieren oder auskommentieren...

                          Kommentar


                            so hab alle Logiken auskommentiert und siehe da, ich komme ins Backend.
                            Es funktioniert aber das schalten nicht:
                            HTML-Code:
                            2017-04-05 18:37:20 DEBUG    item         Main         Item EG.deckenlicht_buero = False via Visu 10.0.0.10:56757 None -- item.py:__update:374
                            HTML-Code:
                            10.0.0.10 - - [05/Apr/2017:18:38:07] "GET /item_change_value.html?item_path=EG.deckenlicht_buero&value=false HTTP/1.1" 200 - "http://10.0.0.6:8383/items.html" "Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Firefox/52.0"
                            2017-04-05 18:38:07 INFO     _cplogging   CP Server Thread-8 10.0.0.10 - - [05/Apr/2017:18:38:07] "GET /item_change_value.html?item_path=EG.deckenlicht_buero&value=false HTTP/1.1" 200 - "http://10.0.0.6:8383/items.html" "Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Firefox/52.0" -- _cplogging.py:access:285
                            10.0.0.10 - - [05/Apr/2017:18:38:07] "GET /item_detail_json.html?item_path=EG.deckenlicht_buero HTTP/1.1" 200 776 "http://10.0.0.6:8383/items.html" "Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Firefox/52.0"
                            2017-04-05 18:38:07 INFO     _cplogging   CP Server Thread-8 10.0.0.10 - - [05/Apr/2017:18:38:07] "GET /item_detail_json.html?item_path=EG.deckenlicht_buero HTTP/1.1" 200 776 "http://10.0.0.6:8383/items.html" "Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Firefox/52.0" -- _cplogging.py:access:285

                            Kommentar


                              Inwiefern funktioniert das Schalten nicht? auch von der Visu nicht? dann hat es nichts mit dem backend zu tun?!

                              Kommentar


                                es funktioniert jetzt, war wahrscheinlich wieder ein reboot die Lösung

                                Kommentar

                                Lädt...
                                X