<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <p>Sieht eigentlich gut:</p>
    <p><i>pi@raspberrypi:~ $ pyhs100<br>
        No IP given, trying discovery..<br>
        Discovering devices for 3 seconds<br>
        == My Smart Plug - HS110(EU) ==<br>
        Device state: ON<br>
        IP address: 192.168.5.37<br>
        LED state: True<br>
        On since: 2018-04-28 14:58:17.255214<br>
        == Generic information ==<br>
        Time:         2018-04-29 11:50:43<br>
        Hardware:     1.0<br>
        Software:     1.1.4 Build 170417 Rel.145118<br>
        MAC (rssi):   50:C7:BF:BD:97:AD (-65)<br>
        Location:     {'latitude': 50.689903, 'longitude': 6.16974}<br>
        == Emeter ==<br>
        Current state: {'total': 0.283, 'power': 35.477544, 'current':
        0.316984, 'voltage': 232.620877}</i><br>
    </p>
    <br>
    <div class="moz-cite-prefix">On 29.04.2018 11:37, Thorsten Johannsen
      wrote:<br>
    </div>
    <blockquote type="cite"
      cite="mid:2ebd4e6c-60fa-ed04-51ba-f8c1f22f2201@gmx.net">On
      29.04.2018 11:05, Bernd Kisters wrote:
      <br>
      <blockquote type="cite">Hi Thorsten,
        <br>
        <br>
        Skript-Aufruf mit debug=true liefert das folgende:
        <br>
        /pi@raspberrypi:~ $ ./hs110-vz-bridge.py
        <br>
        Traceback (most recent call last):
        <br>
           File
        "/usr/local/lib/python3.4/dist-packages/pyHS100/smartdevice.py",
        line 77, in _query_helper
        <br>
             request={target: {cmd: arg}}
        <br>
           File
        "/usr/local/lib/python3.4/dist-packages/pyHS100/protocol.py",
        line 47, in query
        <br>
             sock.connect((host, port))
        <br>
        socket.timeout: timed out
        <br>
      </blockquote>
      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      <br>
      <br>
      Die Verbindung zu dem HS110 funktioniert nicht. Ist das Gerät im
      WLAN richtig angemeldet?
      <br>
      <br>
      Nutze mal das binary, welches mit installiert worden ist, als Du
      <br>
      sudo pip3 install pyhs100
      <br>
      ausgeführt hast.
      <br>
      <br>
      Bei mir sieht das Ergebnis so aus (gekürzt).
      <br>
      <br>
      <br>
      heRPI02:~ $ pyhs100
      <br>
      No IP given, trying discovery..
      <br>
      Discovering devices for 3 seconds
      <br>
      == heECT02 - HS110(EU) ==
      <br>
      Device state: ON
      <br>
      IP address: 192.168.0.102
      <br>
      LED state: True
      <br>
      On since: 2018-04-10 20:39:35.595441
      <br>
      == Generic information ==
      <br>
      Time:         1970-01-19 15:49:42
      <br>
      Hardware:     1.0
      <br>
      Software:     1.2.5 Build 171213 Rel.101523
      <br>
      MAC (rssi):   B0:4E:26:6B:9A:7D (-49)
      <br>
      Location:     {'latitude': 0, 'longitude': 0}
      <br>
      == Emeter ==
      <br>
      Current state: {'voltage': 226.251278, 'total': 11.158, 'power':
      35.340312, 'current': 0.262542}
      <br>
      <br>
      == heECT03 - HS110(EU) ==
      <br>
      [...]
      <br>
      <br>
      <br>
      Wenn Du eine ähnliche Anzeige bekommst, prüfe bitte, ob die die
      IP,
      <br>
      die beim discovery angezeigt wird, auch im script verwendest.
      <br>
      <br>
      <br>
      Falls Du keine bzw. eine "Fehler-Anzeige" bekommst, solltest Du
      das Gerät nochmal neu einrichten. Dazu zunächst:
      <br>
      <br>
      "Press and hold until the Wi-Fi LED
      <br>
      blinks amber quickly (about 10 seconds) to
      <br>
      reset the Smart Plug to factory defaults."
      <br>
      <br>
      <a class="moz-txt-link-freetext" href="https://static.tp-link.com/res/down/doc/HS100(EU)_V1_QIG.pdf">https://static.tp-link.com/res/down/doc/HS100(EU)_V1_QIG.pdf</a>
      <br>
      <br>
      Gruß
      <br>
      Thorsten
      <br>
      <br>
      <br>
      <br>
      <blockquote type="cite">
        <br>
        The above exception was the direct cause of the following
        exception:
        <br>
        <br>
        Traceback (most recent call last):
        <br>
           File "./hs110-vz-bridge.py", line 199, in <module>
        <br>
             retrieveMeterData()
        <br>
           File "./hs110-vz-bridge.py", line 128, in retrieveMeterData
        <br>
             dict_plugMeterData = smartPlugObj.get_emeter_realtime()
        <br>
           File
        "/usr/local/lib/python3.4/dist-packages/pyHS100/smartdevice.py",
        line 381, in get_emeter_realtime
        <br>
             if not self.has_emeter:
        <br>
           File
        "/usr/local/lib/python3.4/dist-packages/pyHS100/smartplug.py",
        line 90, in has_emeter
        <br>
             features = self.sys_info['feature'].split(':')
        <br>
           File
        "/usr/local/lib/python3.4/dist-packages/pyHS100/smartdevice.py",
        line 143, in sys_info
        <br>
             return defaultdict(lambda: None, self.get_sysinfo())
        <br>
           File
        "/usr/local/lib/python3.4/dist-packages/pyHS100/smartdevice.py",
        line 153, in get_sysinfo
        <br>
             return self._query_helper("system", "get_sysinfo")
        <br>
           File
        "/usr/local/lib/python3.4/dist-packages/pyHS100/smartdevice.py",
        line 80, in _query_helper
        <br>
             raise SmartDeviceException('Communication error') from ex
        <br>
        pyHS100.smartdevice.SmartDeviceException: Communication error
        <br>
        <br>
        /Gruß Bernd/
        <br>
        /
        <br>
        Am 29.04.2018 um 10:10 schrieb Thorsten Johannsen:
        <br>
        <blockquote type="cite">On 28.04.2018 22:22, Bernd Kisters
          wrote:
          <br>
          <br>
          Moin Bernd,
          <br>
          <br>
          <blockquote type="cite"> solangsam taste ich mich ran - der
            nächste Fehler:
            <br>
            <br>
            /[FATAL]: Unable to transmit data to middleware host
            192.168.5.88: ('get() takes 1 positional argument but 2 were
            given',)
            <br>
            [FATAL] Reached [10] communication errors -- terminating!
            <br>
            /
            <br>
          </blockquote>
          <br>
          setz mal bitte im Script die Variable
          <br>
          <br>
          <br>
          debug =False
          <br>
          <br>
          auf
          <br>
          <br>
          debug =True
          <br>
          <br>
          starte das Script dann nochmal und poste hier den Output.
          <br>
          <br>
          <br>
          PS: Schau bitte auch mal, dass Du an die Liste zurück
          antwortest... nicht nur an mich persönlich :-)
          <br>
          <br>
          Gruß
          <br>
          Thorsten
          <br>
          <br>
          <br>
          <br>
          <blockquote type="cite">
            <br>
            Am 28.04.2018 um 19:07 schrieb Thorsten Johannsen:
            <br>
            <blockquote type="cite">On 28.04.2018 19:01, Bernd Kisters
              wrote:
              <br>
              <blockquote type="cite">Hey, das ging ja schnell. Ich hab
                leider kein pip3 und finde auf die
                <br>
                Schnelle auch keine Quelle hierfür.
                <br>
              </blockquote>
              pip3 ist in den Raspbian repositories:
              <br>
              <br>
              versuch mal:
              <br>
              <br>
              sudo apt-get install python3-pip
              <br>
              <br>
              Gruß
              <br>
              Thorsten
              <br>
              <br>
              <br>
              <br>
              <blockquote type="cite">Am 28.04.2018 um 18:18 schrieb
                Thorsten Johannsen:
                <br>
                <blockquote type="cite">Moin Bernd,
                  <br>
                  <br>
                  <blockquote type="cite">"/usr/local/lib/python2.7/dist-packages/pyHS100/smartdevice.py",
                    <br>
                  </blockquote>
                  line 43//
                  <br>
                  <br>
                  ^^^ zunächst einmal musst Du python3 verwenden. Nicht
                  2.7.
                  <br>
                  <br>
                  rufe das script bitte mit "python3 hs110-vz-bridge.py"
                  <br>
                  <br>
                  vllt musst Du python3 noch installieren?
                  <br>
                  <br>
                  sudo apt-get install python3
                  <br>
                  <br>
                  <br>
                  bedenke bitte auch, dass Du zum installieren der
                  pyHS100 library
                  <br>
                  "pip3" verwendest, und nicht "pip"
                  <br>
                  <br>
                  Ach ja.. beim "säubern" des scriptes vor dem hochladen
                  ist noch ein
                  <br>
                  Typ in die Konfig gekommen.
                  <br>
                  <br>
                  Beim "heECT03" heißt die Variable natürlich auch
                  "meterData" und nicht
                  <br>
                  "me-terData" :-)
                  <br>
                  <br>
                  <br>
                  <br>
                         "Type": "HS110",
                  <br>
                           "host": "heECT02",
                  <br>
                           "vz-UUID":
                  "98c688c0-3459-11e8-b5ef-41ceabe54097",
                  <br>
                           "object": None,
                  <br>
                           "meterData": None
                  <br>
                       },
                  <br>
                       {
                  <br>
                           "Type": "HS110",
                  <br>
                           "host": "heECT03",
                  <br>
                           "vz-UUID":
                  "09d7b9c0-34d6-11e8-9153-9bd0bc957514",
                  <br>
                           "object": None,
                  <br>
                           "me-terData": None
                  <br>
                       },
                  <br>
                  <br>
                  <br>
                  <br>
                  Hoffe, das hilft!
                  <br>
                  <br>
                  Gruß
                  <br>
                  Thorsten
                  <br>
                  <br>
                  <br>
                  <br>
                  On 28.04.2018 17:52, Bernd Kisters wrote:
                  <br>
                  <blockquote type="cite">Thorsten,
                    <br>
                    <br>
                    erstmal danke für das script. Hab das mal versucht
                    zu verwenden,
                    <br>
                    bleib dann bei der Ausführung des Skripts hängen:
                    <br>
                    /pi@raspberrypi:~ $ ./hs110-vz-bridge.py//
                    <br>
                    //Traceback (most recent call last)://
                    <br>
                    //  File "./hs110-vz-bridge.py", line 10, in
                    <module>//
                    <br>
                    //    from pyHS100 import SmartPlug, Discover//
                    <br>
                    //  File
                    <br>
"/usr/local/lib/python2.7/dist-packages/pyHS100/__init__.py", line
                    <br>
                    16, in <module>//
                    <br>
                    //    from .smartdevice import SmartDevice,
                    SmartDeviceException//
                    <br>
                    //  File
                    <br>
"/usr/local/lib/python2.7/dist-packages/pyHS100/smartdevice.py", line
                    <br>
                    43//
                    <br>
                    //    ip_address: str,//
                    <br>
                    //              ^//
                    <br>
                    //SyntaxError: invalid syntax//
                    <br>
                    /
                    <br>
                    Im Skript selber hab ich nur die IP des HS110 und
                    die vom middleware
                    <br>
                    host sowie die UUID eingetragen.
                    <br>
                    <br>
                    Gruß Bernd
                    <br>
                    <br>
                    Am 27.04.2018 um 15:47 schrieb Thorsten Johannsen:
                    <br>
                    <blockquote type="cite">On 27.04.2018 14:46, Bernd
                      Kisters wrote:
                      <br>
                      <blockquote type="cite">Hallo Thorsten,
                        <br>
                        <br>
                      </blockquote>
                      Moin Bernd,
                      <br>
                      <br>
                      <blockquote type="cite">könnstet du bitte mal dein
                        Skript hier posten, mit dem man die
                        <br>
                        Daten von einem HS110 an den Volkszaehler
                        überträgt.
                        <br>
                        <br>
                      </blockquote>
                      hab ich schon:
                      <br>
                      <br>
                      -------- Forwarded Message --------
                      <br>
                      Subject: [vz-users] Fwd: Re:  Tp-Link HS110 WAR:
                      S0 Impulse
                      <br>
                      (Stromzähler) via Raspberry PI ohne zusätzliche HW
                      auslesen
                      <br>
                      Date: Wed, 4 Apr 2018 17:16:03 +0200
                      <br>
                      From: Thorsten
                      Johannsen<a class="moz-txt-link-rfc2396E" href="mailto:thorsten-johannsen@gmx.net"><thorsten-johannsen@gmx.net></a>
                      <br>
                      Reply-To: volkszaehler.org - users
                      <br>
                      <a class="moz-txt-link-rfc2396E" href="mailto:volkszaehler-users@demo.volkszaehler.org"><volkszaehler-users@demo.volkszaehler.org></a>
                      <br>
                      <a class="moz-txt-link-abbreviated" href="mailto:To:volkszaehler-users@demo.volkszaehler.org">To:volkszaehler-users@demo.volkszaehler.org</a> 
                      >> Volkszähler-users
                      <br>
                      Mailing
                      List<a class="moz-txt-link-rfc2396E" href="mailto:volkszaehler-users@demo.volkszaehler.org"><volkszaehler-users@demo.volkszaehler.org></a>
                      <br>
                      <br>
                      <br>
                      <br>
                      macht aber nix, hier im Anhang nochmal.
                      <br>
                      <br>
                      Das Script ist aber nicht zur Veröffentlichung
                      gedacht!
                      <br>
                      <br>
                      -> Nicht dass ich etwas dagegen habe, es zu
                      teilen -- es ist nur
                      <br>
                      ausschließlich für meinen Bedarf geschrieben,
                      daher ist es nicht
                      <br>
                      sehr "fehlertolerant".
                      <br>
                      <br>
                      Wenn etwas unvorhergesehenes passiert, bricht das
                      Script einfach ab
                      <br>
                      - und wird bei mir via systemd so lange neu
                      gestartet, bis es
                      <br>
                      entweder von selbst wieder fehlerfrei läuft, oder
                      ich den Fehler
                      <br>
                      beseitigt hab :-)
                      <br>
                      <br>
                      <br>
                      Ach ja: Zum "Programmieren" (starkes Wort für das
                      kleine Script *g*)
                      <br>
                      habe ich Microsoft Visual Studio Code für mich
                      entdeckt. Für Windows
                      <br>
                      und Linux, Open Source, mit fantastischen Plugins
                      (auch für Python)
                      <br>
                      <br>
                      <br>
                      So... nun viel Erfolg !
                      <br>
                      <br>
                      PS: Über eine Rückmeldung bzgl. des Erfolges würde
                      ich mich freuen!
                      <br>
                      <br>
                      Thorsten
                      <br>
                      <br>
                      <br>
                      <br>
                      <br>
                      <blockquote type="cite">Gruß
                        <br>
                        Bernd
                        <br>
                        <br>
                        <br>
                        On 26.04.2018 20:40, Thorsten Johannsen wrote:
                        <br>
                        <blockquote type="cite">-------- Forwarded
                          Message --------
                          <br>
                          Subject: Re: [vz-users] WLAN-Steckdose mit
                          Strommessfunktion und
                          <br>
                          API zum
                          <br>
                          Auslesen für Volkszaehler
                          <br>
                          Date: Thu, 26 Apr 2018 14:33:11 +0200
                          <br>
                          From: Thorsten
                          Johannsen<a class="moz-txt-link-rfc2396E" href="mailto:thorsten-johannsen@gmx.net"><thorsten-johannsen@gmx.net></a>
                          <br>
                          To: Markus Reiß<a class="moz-txt-link-rfc2396E" href="mailto:reiss.ma@web.de"><reiss.ma@web.de></a>
                          <br>
                          <br>
                          <br>
                          Moin zusammen,
                          <br>
                          <br>
                          <br>
                          On 25.04.2018 22:45, "Markus Reiß" wrote:
                          <br>
                          <blockquote type="cite">Hallo Frank,
                            <br>
                            Tasmota und dann bischen noch selber was
                            anpassen
                            <br>
                            Per http in den volkszähler :-)
                            <br>
                          </blockquote>
                          [...]
                          <br>
                          <br>
                          <blockquote type="cite">      Am 25. April
                            2018 um 19:35 schrieb "Markus Reiß"
                            <br>
                            <<a class="moz-txt-link-abbreviated" href="mailto:reiss.ma@web.de">reiss.ma@web.de</a>
                            <br>
                            <a class="moz-txt-link-rfc2396E" href="mailto:reiss.ma@web.de"><mailto:reiss.ma@web.de></a>>:
                            <br>
                            <br>
                                      Hallo
                            <br>
                                      ich habe mir diese
                            <br>
<a class="moz-txt-link-freetext" href="https://www.ebay.de/i/332577142664?chn=ps&var=541677608755&dispItem=1">https://www.ebay.de/i/332577142664?chn=ps&var=541677608755&dispItem=1</a>
                            <br>
                            <br>
<a class="moz-txt-link-rfc2396E" href="https://www.ebay.de/i/332577142664?chn=ps&var=541677608755&dispItem=1"><https://www.ebay.de/i/332577142664?chn=ps&var=541677608755&dispItem=1></a>
                            <br>
                            <br>
                                      besorgt (SOnOff Pow).
                            <br>
                                      ist alles drinn was man braucht
                            und günstig :-)
                            <br>
                                      MfG makro
                            <br>
                            <br>
                            <br>
                          </blockquote>
                          klingt sehr interessant. Vor allem preislich
                          :-)
                          <br>
                          <br>
                          <br>
                          Mein persönlicher Vergleich SonOff gegen
                          TP-Link HS-110
                          <br>
(<a class="moz-txt-link-freetext" href="https://geizhals.de/tp-link-hs110-hs110eu-a1409026.html">https://geizhals.de/tp-link-hs110-hs110eu-a1409026.html</a>)
                          <br>
                          <br>
                          <br>
                          Vorteile SonOff:
                          <br>
                          ----------------
                          <br>
                          <br>
                          + Super günstig !!
                          <br>
                          + lässt sich ggf. hinter / unter / in / .../ 
                          Möbel, Hohlschicht
                          <br>
                          verstecken
                          <br>
                          <br>
                          <br>
                          Vorteile HS-110
                          <br>
                          ---------------
                          <br>
                          <br>
                          + Plug&Play: Zwischenstecker, daher kein
                          Schrauben von
                          <br>
                          Anschlussleitungen nötig
                          <br>
                          <br>
                          + Plug&Play: keine Änderung der Firmware
                          nötig.
                          <br>
                          <br>
                          + Werte können per HTTP aus dem HS-110
                          ausgelesen werden (und per
                          <br>
                          http
                          <br>
                          in die Middleware geschrieben werden)
                          <br>
                          <br>
                          <br>
                          <br>
                          <br>
                          Gruß
                          <br>
                          Thorsten
                          <br>
                          <br>
                        </blockquote>
                      </blockquote>
                    </blockquote>
                  </blockquote>
                </blockquote>
              </blockquote>
            </blockquote>
            <br>
          </blockquote>
          <br>
        </blockquote>
        <br>
      </blockquote>
      <br>
    </blockquote>
    <br>
  </body>
</html>