Ankündigung

Einklappen
Keine Ankündigung bisher.

Plugin: Buderus

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

    Plugin: Buderus

    Für alle die es Interessiert, ich habe ein Plugin erstellt welches mit Buderus Logamatic web KM200 Gateway sprechen kann. Es sollte auch Kompatibel sein zu den KM300 oder KM50 Gateways von Buderus. Ich glaube dass andere Gateways aus dem Hause Bosch / Junkers auch damit funktionieren sollten.

    Zu finden unter https://github.com/rthill/buderus

    Ich habe bis jetzt nur erste funktionelle Tests gemacht auf meinem Dev-System welche sehr Positiv sind und benutze es derzeit noch nicht in Produktion. Eine Liste mit validen URLs (km_id) wurde der Dokumentation zugefügt.

    Liebe Grüße,
    Raoul
    Zuletzt geändert von knxmfbp; 26.02.2016, 15:57. Grund: Ergänzende Informationen

    #2
    Hallo Raoul,

    danke für deine Mühe hier ein Plugin zur Verfügung zu stellen. Genau so was suche ich aktuell.
    Leider bekomme ich es nicht ans laufen. Ich habe die integrierte Schnittstelle (KM50) von Buderus in der Therme.​

    Wunsch meinerseits ist es, die Informationen aus der Buderus Anlage in dem Homeserver darzustellen.
    1. In deinen Vorbemerkungen schreibst du:
    The following python packages need to be installed on your system:
    • urllib
    • crypto
    Sind diese Komponenten nicht Teil der Grundausstattung des smarthome.py Images? Wie kann ich herausfinden, ob diese Pakete auf dem System bereits laufen oder installiert sind?

    1. Zu meiner Konfiguration:

    Die plugin.conf ist angepasst, mit dem generierten Key.

    Bei der items.conf habe ich bei der Außentemperatur die KNX Befehle eingefügt:
    Ausschnitt:

    [[[outside]]]
    type = num
    km_id = "/system/sensors/temperatures/outdoor_t1"
    Influx = true
    knx_dpt = 9
    knx_send = 4/1/1
    knx_reply = 4/1/1
    GA ist entsprechend auf der KNX bzw. Homeserver Seite angelegt.

    Hier der Inhalt des Smarthome.log:

    2016-03-10 21:33:17 ERROR Main Plugin smarttv exception: 'module' object has no attribute 'SmartTv'
    Traceback (most recent call last):
    File "/usr/smarthome/lib/plugin.py", line 53, in __init__
    plugin_thread = Plugin(smarthome, plugin, classname, classpath, args)
    File "/usr/smarthome/lib/plugin.py", line 80, in __init__
    exec("self.plugin = {0}.{1}(smarthome{2})".format(classpath, classname, args))
    File "<string>", line 1, in <module>
    AttributeError: 'module' object has no attribute 'SmartTv'
    2016-03-10 21:33:17 ERROR Main Plugin buderus exception: invalid syntax (__init__.py, line 32)
    Traceback (most recent call last):
    File "/usr/smarthome/lib/plugin.py", line 53, in __init__
    plugin_thread = Plugin(smarthome, plugin, classname, classpath, args)
    File "/usr/smarthome/lib/plugin.py", line 79, in __init__
    exec("import {0}".format(classpath))
    File "<string>", line 1, in <module>
    File "/usr/smarthome/plugins/buderus/__init__.py", line 32
    INTERRUPT = u'\u0001'
    ^
    SyntaxError: invalid syntax
    Init SmartHome.py 1.0-45-g02cf972
    2016-03-10 22:14:14 INFO Main Start SmartHome.py 1.0-45-g02cf972
    2016-03-10 22:14:14 INFO Main Init Scheduler
    2016-03-10 22:14:14 INFO Main Init Plugins
    2016-03-10 22:14:15 ERROR Main Plugin smarttv exception: 'module' object has no attribute 'SmartTv'
    Traceback (most recent call last):
    File "/usr/smarthome/lib/plugin.py", line 53, in __init__
    plugin_thread = Plugin(smarthome, plugin, classname, classpath, args)
    File "/usr/smarthome/lib/plugin.py", line 80, in __init__
    exec("self.plugin = {0}.{1}(smarthome{2})".format(classpath, classname, args))
    File "<string>", line 1, in <module>
    AttributeError: 'module' object has no attribute 'SmartTv'
    2016-03-10 22:14:15 ERROR Main Plugin buderus exception: invalid syntax (__init__.py, line 32)
    Traceback (most recent call last):
    File "/usr/smarthome/lib/plugin.py", line 53, in __init__
    plugin_thread = Plugin(smarthome, plugin, classname, classpath, args)
    File "/usr/smarthome/lib/plugin.py", line 79, in __init__
    exec("import {0}".format(classpath))
    File "<string>", line 1, in <module>
    File "/usr/smarthome/plugins/buderus/__init__.py", line 32
    INTERRUPT = u'\u0001'
    ^
    SyntaxError: invalid syntax
    2016-03-10 22:14:15 INFO Main Init Items
    2016-03-10 22:14:15 INFO Main Start Plugins
    2016-03-10 22:14:16 INFO Main Start Logics
    2016-03-10 22:14:21 INFO hello Hello World!

    Kommentar


      #3
      Zitat von Larswgas Beitrag anzeigen
      Sind diese Komponenten nicht Teil der Grundausstattung des smarthome.py Images? Wie kann ich herausfinden, ob diese Pakete auf dem System bereits laufen oder installiert sind?
      Leider kenne ich das smarthome.py Image nicht, ich benutze seit jeher ein eingens installiertes System.

      Kannst du zuerst einmal die Python Version ausfindig machen mittels "python -V" und auch einmal das Plugin mittels "python /usr/smarthome/plugins/__init__.py" ausführen.

      Kommentar


        #4
        Es scheint sich um Python 2.7 zu handeln:
        Code:
        admin@smarthome:/usr/smarthome/plugins$ python -v
        # installing zipimport hook
        import zipimport # builtin
        # installed zipimport hook
        # /usr/lib/python2.7/site.pyc matches /usr/lib/python2.7/site.py
        import site # precompiled from /usr/lib/python2.7/site.pyc
        # /usr/lib/python2.7/os.pyc matches /usr/lib/python2.7/os.py
        import os # precompiled from /usr/lib/python2.7/os.pyc
        import errno # builtin
        import posix # builtin
        # /usr/lib/python2.7/posixpath.pyc matches /usr/lib/python2.7/posixpath.py
        import posixpath # precompiled from /usr/lib/python2.7/posixpath.pyc
        # /usr/lib/python2.7/stat.pyc matches /usr/lib/python2.7/stat.py
        import stat # precompiled from /usr/lib/python2.7/stat.pyc
        # /usr/lib/python2.7/genericpath.pyc matches /usr/lib/python2.7/genericpath.py
        import genericpath # precompiled from /usr/lib/python2.7/genericpath.pyc
        # /usr/lib/python2.7/warnings.pyc matches /usr/lib/python2.7/warnings.py
        import warnings # precompiled from /usr/lib/python2.7/warnings.pyc
        # /usr/lib/python2.7/linecache.pyc matches /usr/lib/python2.7/linecache.py
        import linecache # precompiled from /usr/lib/python2.7/linecache.pyc
        # /usr/lib/python2.7/types.pyc matches /usr/lib/python2.7/types.py
        import types # precompiled from /usr/lib/python2.7/types.pyc
        # /usr/lib/python2.7/UserDict.pyc matches /usr/lib/python2.7/UserDict.py
        import UserDict # precompiled from /usr/lib/python2.7/UserDict.pyc
        # /usr/lib/python2.7/_abcoll.pyc matches /usr/lib/python2.7/_abcoll.py
        import _abcoll # precompiled from /usr/lib/python2.7/_abcoll.pyc
        # /usr/lib/python2.7/abc.pyc matches /usr/lib/python2.7/abc.py
        import abc # precompiled from /usr/lib/python2.7/abc.pyc
        # /usr/lib/python2.7/_weakrefset.pyc matches /usr/lib/python2.7/_weakrefset.py
        import _weakrefset # precompiled from /usr/lib/python2.7/_weakrefset.pyc
        import _weakref # builtin
        # /usr/lib/python2.7/copy_reg.pyc matches /usr/lib/python2.7/copy_reg.py
        import copy_reg # precompiled from /usr/lib/python2.7/copy_reg.pyc
        # /usr/lib/python2.7/traceback.pyc matches /usr/lib/python2.7/traceback.py
        import traceback # precompiled from /usr/lib/python2.7/traceback.pyc
        # /usr/lib/python2.7/sysconfig.pyc matches /usr/lib/python2.7/sysconfig.py
        import sysconfig # precompiled from /usr/lib/python2.7/sysconfig.pyc
        # /usr/lib/python2.7/re.pyc matches /usr/lib/python2.7/re.py
        import re # precompiled from /usr/lib/python2.7/re.pyc
        # /usr/lib/python2.7/sre_compile.pyc matches /usr/lib/python2.7/sre_compile.py
        import sre_compile # precompiled from /usr/lib/python2.7/sre_compile.pyc
        import _sre # builtin
        # /usr/lib/python2.7/sre_parse.pyc matches /usr/lib/python2.7/sre_parse.py
        import sre_parse # precompiled from /usr/lib/python2.7/sre_parse.pyc
        # /usr/lib/python2.7/sre_constants.pyc matches /usr/lib/python2.7/sre_constants.                                                                             py
        import sre_constants # precompiled from /usr/lib/python2.7/sre_constants.pyc
        # /usr/lib/python2.7/_sysconfigdata.pyc matches /usr/lib/python2.7/_sysconfigdat                                                                             a.py
        import _sysconfigdata # precompiled from /usr/lib/python2.7/_sysconfigdata.pyc
        # /usr/lib/python2.7/_sysconfigdata_nd.pyc matches /usr/lib/python2.7/_sysconfig                                                                             data_nd.py
        import _sysconfigdata_nd # precompiled from /usr/lib/python2.7/_sysconfigdata_nd                                                                             .pyc
        # /usr/lib/python2.7/sitecustomize.pyc matches /usr/lib/python2.7/sitecustomize.                                                                             py
        import sitecustomize # precompiled from /usr/lib/python2.7/sitecustomize.pyc
        import encodings # directory /usr/lib/python2.7/encodings
        # /usr/lib/python2.7/encodings/__init__.pyc matches /usr/lib/python2.7/encodings                                                                             /__init__.py
        import encodings # precompiled from /usr/lib/python2.7/encodings/__init__.pyc
        # /usr/lib/python2.7/codecs.pyc matches /usr/lib/python2.7/codecs.py
        import codecs # precompiled from /usr/lib/python2.7/codecs.pyc
        import _codecs # builtin
        # /usr/lib/python2.7/encodings/aliases.pyc matches /usr/lib/python2.7/encodings/                                                                             aliases.py
        import encodings.aliases # precompiled from /usr/lib/python2.7/encodings/aliases                                                                             .pyc
        # /usr/lib/python2.7/encodings/utf_8.pyc matches /usr/lib/python2.7/encodings/ut                                                                             f_8.py
        import encodings.utf_8 # precompiled from /usr/lib/python2.7/encodings/utf_8.pyc
        Python 2.7.3 (default, Jan 13 2013, 11:20:46)
        [GCC 4.6.3] on linux2
        Type "help", "copyright", "credits" or "license" for more information.
        dlopen("/usr/lib/python2.7/lib-dynload/readline.so", 2);
        import readline # dynamically loaded from /usr/lib/python2.7/lib-dynload/readlin                                                                             e.so
        # /usr/lib/python2.7/rlcompleter.pyc matches /usr/lib/python2.7/rlcompleter.py
        import rlcompleter # precompiled from /usr/lib/python2.7/rlcompleter.pyc
        # /usr/lib/python2.7/atexit.pyc matches /usr/lib/python2.7/atexit.py
        import atexit # precompiled from /usr/lib/python2.7/atexit.pyc
        >>>
        Leider ist es für mich immer noch nicht zu erkennen, ob die erforderlichen Pakete hier bereits installiert sind oder wie ich diese installieren kann?

        Leider kenne ich das smarthome.py Image nicht, ich benutze seit jeher ein eingens installiertes System.
        Steht davon ggf. auch ein Image zu Verfügung was ich nutzen kann und an meine Bedürfnisse anzupassen?
        Oder wie wären die Schritte um hier ein System für KNX, One-Wire und den Buderus Bus aufzusetzen?

        Kommentar


          #5
          Ich habe ein Update auf Github gepusht welches deinen Fehler beheben sollte. Von meinem System gibt es kein Image. Schau dir das Debug Log an, wenn ein Paket fehlen sollte, einfach nachladen mittels apt-get install python-crypto bzw. python-urllib.

          Kommentar


            #6
            Hallo Raoul,

            ich habe die Pakete installiert. Die Meldung sah zu mindestens erfolgreich aus.
            Dann noch das Plugin gelöscht und neu installiert (wegen deiner Änderung im Code).
            Leider bekomme ich jetzt in der Log Datei die Meldung:

            PHP-Code:
              2016-03-28 00:23:55 ERROR    Main         Plugin buderus exceptionNo module named Crypto.Cipher
            Traceback 
            (most recent call last):
              
            File "/usr/smarthome/lib/plugin.py"line 53in __init__
                plugin_thread 
            Plugin(smarthomepluginclassnameclasspathargs)
              
            File "/usr/smarthome/lib/plugin.py"line 79in __init__
                exec
            ("import {0}".format(classpath))
              
            File "<string>"line 1in <module>
              
            File "/usr/smarthome/plugins/buderus/__init__.py"line 25in <module>
                
            from Crypto.Cipher import AES
            ImportError
            No module named Crypto.Cipher 

            Kommentar


              #7
              ... und was denkst Du sagt Dir Tante Google wenn Du das eingibst: "ImportError: No module named Crypto.Cipher"?

              Kommentar


                #8
                Versuch mal so:
                Code:
                 
                 [FONT=inherit]easy_install pycrypto [/FONT]
                vorher ggf das Paket mit apt-get deinstallieren

                Kommentar


                  #9
                  ... Installiere mal die crypto Module für python3:
                  Code:
                  sudo apt-get install python3-crypto[FONT=inherit][/FONT]


                  Kommentar


                    #10
                    Hallo Raoul,
                    würde gerne dein PlugIn verwenden. Bekomme aber leider folgende Fehlermeldung:
                    Code:
                    2016-06-08 20:46:48,926 ERROR    Main         Plugin buderus exception: 'str' does not support the buffer interface -- plugin.py:__init__:57
                    Traceback (most recent call last):
                      File "/usr/smarthome/lib/plugin.py", line 53, in __init__
                        plugin_thread = Plugin(smarthome, plugin, classname, classpath, args)
                      File "/usr/smarthome/lib/plugin.py", line 80, in __init__
                        exec("self.plugin = {0}.{1}(smarthome{2})".format(classpath, classname, args))
                      File "<string>", line 1, in <module>
                      File "/usr/smarthome/plugins/buderus/__init__.py", line 41, in __init__
                        self._key = binascii.unhexlify(key)
                    TypeError: 'str' does not support the buffer interface
                    Hab den Key direkt in die PlugIn.conf übernommen? Kann ich da was falsch machen?
                    Bitte, Danke...

                    Grüße,
                    Hannes

                    Kommentar


                      #11
                      Hallo Hannes,

                      ich vermute einen Syntax Fehler in der plugin.conf, korrekte Syntax wäre:
                      Code:
                      [buderus]
                          class_name = Buderus
                          class_path = plugins.buderus
                          host = 192.168.1.1
                          key = 0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef
                          cycle = 900
                      key ohne "" oder <> oder Leerzeichen am Ende...

                      Kommentar


                        #12
                        Hallo,
                        leider nicht, das hab ich auch schon versucht.
                        Hab was gelesen, dass es Unterschiede in der Syntax zwischen Python 2 und 3 für einen str gibt. Kann das ev. der Fehler sein? Bzw. welche Version nutzt ihr?

                        Grüße,
                        Hannes

                        Kommentar


                          #13
                          Hallo,
                          dürfte tatsächlich was mit den Versionen zu tun haben:
                          Damit funktioniert es:
                          Code:
                          self._key = binascii.unhexlify(key.encode('utf-8'))

                          Grüße,
                          Hannes
                          Zuletzt geändert von hannes123; 10.06.2016, 08:16.

                          Kommentar


                            #14
                            Hallo,

                            Ich versuch mit meine GB192i Heizung seine Konfiguration ueber dem KM200 Module zu aendern... bin aber bis jetzt unerfolgreich.

                            _get_data() funktioniert einwandfrei, d.H kann ich mindestens etwas vom System ablesen... und manche Werten sind Schreibgeschutzt natuerlich.

                            Vom iPhone App her sehe ich (mit der hilfe des _decrypt() funktion) dass der Zentrale macht einfach einen HTTP PUT nach /heatingCircuits/hc1/temporaryRoomSetpoint mit Daten liefert:

                            {"value": 21.0}

                            Aber wenn ich versuch selber, laesst sich der Werte nicht aenden. Es kommt doch einen HTTP/204 Antwort, dass sollte Korrekt sein, oder? Aber wenn ich temporaryRoomSetpoint wieder lese, kommt nie etwas zurueck was ich erwarte (und ich erwarte dass wenn ich 21.0 schreib, dann sollte ich wieder 21.0 lesen koennen)...

                            Wo koennte der Fehler liegen? Ich habe doch versucht alle Internetverkehr vom Heizung abzusperren, und es geht immer noch nicht. Einzige was ich bis jetzt nicht probiert habe, ist Internetzugang zu sperren und der Heizung neu zu starten...

                            Gruesse!
                            Al.

                            Kommentar


                              #15
                              Wie steht der Wert nach dem nächsten Lese-Zyklus, also Ablauf der Zeit in plugin.conf, Paramter cycle = xxx?

                              Kommentar

                              Lädt...
                              X