Ankündigung

Einklappen
Keine Ankündigung bisher.

Interesse an HomeConnect Plugin?

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

    #31
    Im log steht nichts (die Infos oben sind aus dem DEBUG log)
    wie kann ich denn mehr debuggen ?

    Kommentar


      #32
      hilft das weiter ?

      Code:
      2021-05-18  15:59:55 ERROR    cherrypy.error.2815596656 [18/May/2021:15:59:55] HTTP
      > Traceback (most recent call last):
      >   File "/home/smarthome/.local/lib/python3.7/site-packages/cherrypy/_cprequest.py", line 638, in respond
      >     self._do_respond(path_info)
      >   File "/home/smarthome/.local/lib/python3.7/site-packages/cherrypy/_cprequest.py", line 697, in _do_respond
      >     response.body = self.handler()
      >   File "/home/smarthome/.local/lib/python3.7/site-packages/cherrypy/lib/encoding.py", line 219, in __call__
      >     self.body = self.oldhandler(*args, **kwargs)
      >   File "/home/smarthome/.local/lib/python3.7/site-packages/cherrypy/_cpdispatch.py", line 54, in __call__
      >     return self.callable(*self.args, **self.kwargs)
      >   File "/usr/local/smarthome/plugins/homeconnect/webif/__init__.py", line 89, in index
      >     tab2title="OAuth2 Data", tab3title="Appliances", token=token, token_expiry_date=datetime.fromtimestamp(token['expires_at']),
      > TypeError: 'NoneType' object is not subscriptable

      Kommentar


        #33
        Ich denke schon. Mal schauen, ob ich noch wo abfangen muss, ob das Token leer ist.

        Kommentar


          #34
          hab nen fix gepusht. teste bitte mal, ob das die einzige stelle war!

          Kommentar


            #35
            mit github stehe ich auch auf Kriegsfuß, wie hole ich mir dann einen fix, oder gar alle fixes ?
            ich habe jetzt handisch den code angepasst.
            und der nächste Fehler ist:
            Code:
            2021-05-18  16:33:01 ERROR    cherrypy.error.2815324368 [18/May/2021:16:33:01] HTTP
            > Traceback (most recent call last):
            >   File "/home/smarthome/.local/lib/python3.7/site-packages/cherrypy/_cprequest.py", line 638, in respond
            >     self._do_respond(path_info)
            >   File "/home/smarthome/.local/lib/python3.7/site-packages/cherrypy/_cprequest.py", line 697, in _do_respond
            >     response.body = self.handler()
            >   File "/home/smarthome/.local/lib/python3.7/site-packages/cherrypy/lib/encoding.py", line 219, in __call__
            >     self.body = self.oldhandler(*args, **kwargs)
            >   File "/home/smarthome/.local/lib/python3.7/site-packages/cherrypy/_cpdispatch.py", line 54, in __call__
            >     return self.callable(*self.args, **self.kwargs)
            >   File "/usr/local/smarthome/plugins/homeconnect/webif/__init__.py", line 93, in index
            >     p=self.plugin)
            >   File "/usr/lib/python3/dist-packages/jinja2/asyncsupport.py", line 76, in render
            >     return original_render(self, *args, **kwargs)
            >   File "/usr/lib/python3/dist-packages/jinja2/environment.py", line 1008, in render
            >     return self.environment.handle_exception(exc_info, True)
            >   File "/usr/lib/python3/dist-packages/jinja2/environment.py", line 780, in handle_exception
            >     reraise(exc_type, exc_value, tb)
            >   File "/usr/lib/python3/dist-packages/jinja2/_compat.py", line 37, in reraise
            >     raise value.with_traceback(tb)
            >   File "/usr/local/smarthome/plugins/homeconnect/webif/templates/index.html", line 5, in top-level template code
            >     {% if token %}{% set tabcount = 3 %}{% endif %}
            >   File "/usr/local/smarthome/modules/http/webif/gtemplates/base_plugin.html", line 183, in top-level template code
            >     {% if scroll_heading is not defined %}
            >   File "/usr/local/smarthome/modules/http/webif/gtemplates/base.html", line 1, in top-level template code
            >     {% block doc -%}
            >   File "/usr/local/smarthome/modules/http/webif/gtemplates/base.html", line 4, in block "doc"
            >     {%- block html %}
            >   File "/usr/local/smarthome/modules/http/webif/gtemplates/base.html", line 76, in block "html"
            >     {% block body -%}
            >   File "/usr/local/smarthome/modules/http/webif/gtemplates/base.html", line 79, in block "body"
            >     {% block content -%}
            >   File "/usr/local/smarthome/modules/http/webif/gtemplates/base_plugin.html", line 155, in block "content"
            >     {% block bodytab2 %}
            >   File "/usr/local/smarthome/plugins/homeconnect/webif/templates/index.html", line 92, in block "bodytab2"
            >     {% if p.get_hc().token_expired(token) %}
            >   File "/usr/local/smarthome/plugins/homeconnect/api.py", line 69, in token_expired
            >     return token["expires_at"] - now < 60
            > TypeError: 'NoneType' object is not subscriptable

            Kommentar


              #36
              so, hab mein token jetzt mal gelöscht und das auch noch behoben.. fix = pull aus dem develop. und wenn du das manuell gezogen hast, neu ziehen (komplett)

              Kommentar


                #37
                danke, jetzt kommen die Daten im webif.

                aber weiter geht es wohl noch nicht; oder ?

                kann ich noch etwas beitragen. Gerne helfe ich bei der Doku.
                oder schreibe einen GettingStartedGuide für das plugin.

                Kommentar


                  #38
                  aber weiter geht es wohl noch nicht; oder ?
                  Hast Du den OAuth Prozess erfolgreich durchlaufen udn siehst Appliances im WebIf?

                  Kommentar


                    #39
                    nein, da sehe ich nicht, wo ich da etwas machen kann:

                    homeconnect2.JPG

                    Kommentar


                      #40
                      auf den oauth2 data tab gehen und da den link klicken

                      Kommentar


                        #41
                        Ahhhh, gefunden;

                        ich muss da wohl auf OAuth2 Data klicken und mich anmelden.
                        wenn dann die reconnect URL richtig registriert ist, geht es weiter.
                        und jetzt sehe ich tatsächlich meine Spülmaschine.

                        Super

                        homeconnect3.JPG
                        Zuletzt geändert von whe; 18.05.2021, 16:47.

                        Kommentar


                          #42
                          genau. weiter geht es noch nicht. ich bastel gerade an nem item rum und hoffe, dass dann auch das token nach 24h erneuert. aktuell müsste man das oauth2 dann neu machen.. renewal geht aber definitiv. muss mich halt durch die sourcen von der eingebauten lib kämpfen

                          Kommentar


                            #43
                            ich sehe in meinem log aber schon eine Meldung, dass ein expired token refreshed wurde.

                            zudem habe ich aber noch einen anderen Fehler, der beim Polling auftaucht:

                            Code:
                            2021-05-18  17:26:52 DEBUG    plugins.homeconnect Starting update loop
                            2021-05-18  17:31:52 DEBUG    plugins.homeconnect Starting update loop
                            2021-05-18  17:36:52 DEBUG    plugins.homeconnect Starting update loop
                            2021-05-18  17:38:07 DEBUG    plugins.homeconnect WebIf found, callback is homeconnect
                            2021-05-18  17:38:07 DEBUG    plugins.homeconnect WebIf found, callback is homeconnect
                            2021-05-18  17:41:25 DEBUG    plugins.homeconnect WebIf found, callback is homeconnect
                            2021-05-18  17:41:25 DEBUG    plugins.homeconnect WebIf found, callback is homeconnect
                            2021-05-18  17:41:51 ERROR    plugins.homeconnect Token expired, refreshing!
                            2021-05-18  17:41:51 DEBUG    plugins.homeconnect WebIf found, callback is homeconnect
                            2021-05-18  17:41:51 DEBUG    plugins.homeconnect WebIf found, callback is homeconnect
                            2021-05-18  17:41:52 DEBUG    plugins.homeconnect Starting update loop
                            2021-05-18  17:41:52 ERROR    plugins.homeconnect.poll_data Method plugins.homeconnect.poll_data exception: 'SIEMENS-SX578S06TE-68A40E005455'
                            > Traceback (most recent call last):
                            >   File "/usr/local/smarthome/lib/scheduler.py", line 664, in _task
                            >     obj()
                            >   File "/usr/local/smarthome/plugins/homeconnect/__init__.py", line 71, in _update_loop
                            >     if self._items[appliance.haId]:
                            > KeyError: 'SIEMENS-SX578S06TE-68A40E005455'
                            2021-05-18  17:46:52 DEBUG    plugins.homeconnect Starting update loop
                            2021-05-18  17:46:52 ERROR    plugins.homeconnect.poll_data Method plugins.homeconnect.poll_data exception: 'SIEMENS-SX578S06TE-68A40E005455'
                            > Traceback (most recent call last):
                            >   File "/usr/local/smarthome/lib/scheduler.py", line 664, in _task
                            >     obj()
                            >   File "/usr/local/smarthome/plugins/homeconnect/__init__.py", line 71, in _update_loop
                            >     if self._items[appliance.haId]:
                            > KeyError: 'SIEMENS-SX578S06TE-68A40E005455'
                            oder liegt das daran, dass SHNG jetzt meinen Geschirrspüler kennt und es da nicht weiter geht.

                            Kommentar


                              #44
                              Hallo Rene,

                              ich weiß nicht, ob es hilft:
                              Ich nutze gerade die GooglePhotos Api. Hier werden die credentials als python-objekt gespeichert (mit pickle) und bei einem Neustart wieder eingelesen.
                              Das verhindert, dass man sich jedes mal durch das Google-Webinterface ("wollen Sie dieser App wirklich Zugriff auf die Fotos geben") kämpfen muss:
                              Code:
                               if os.path.exists(pickle_file):
                              with open(pickle_file, 'rb') as token:
                              cred = pickle.load(token)
                              
                              if not cred or not cred.valid:
                              if cred and cred.expired and cred.refresh_token:
                              cred.refresh(Request())
                              else:
                              flow = InstalledAppFlow.from_client_secrets_file(CLIENT_S ECRET_FILE, SCOPES)
                              cred = flow.run_local_server()
                              
                              with open(pickle_file, 'wb') as token:
                              pickle.dump(cred, token)
                              
                              try:
                              service = build(API_SERVICE_NAME, API_VERSION, credentials=cred,static_discovery=False)
                              Gruß,
                              Hendrik

                              Kommentar


                                #45
                                Zieh dir mal den neueren Code.. Refresh geht definitiv noch nicht.. aktuell baue ich den listener einer appliance ein und muss erstmal das mischmasch aus alten library code und neuem aufräumen.

                                über weitere fehler, die ich ggf auch tage nicht fixe, daher nicht wundern bitte! Ich mache das hier ja nicht hauptberuflich ;-)

                                Kommentar

                                Lädt...
                                X