Ankündigung

Einklappen
Keine Ankündigung bisher.

Netatmo verbindung herstellen

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

    Netatmo verbindung herstellen

    Hallo zusammen,
    ich habe mich mal hier Registriert weil ich nicht mehr weiter komme und es hier doch sehr Aktiv ausschaut.
    Ich nutze openHAB 1.8.0 auf einem Windows 7 64 Bit system mit dem Java SKD 8U65.

    Philips TV+HUE und Yamaha AVR habe ich bereits erfolgreich eingebunden und funktioniert auch.
    Jetzt habe ich mir die Netatmo Wetter Station bestellt, aber bekomme diese nicht eingebunden.



    Meine Items sehen so aus:
    Code:
    /* Netatmo */
    Number Netatmo_Innen_Temperatur        "Netatmo Innen Temp. [%.1f °C]"                  {netatmo="00:00:00:00:00:00#Temperature"}
    00:00:00:00:00:00 habe ich ersetzt mit der Mac meines Innenraum Messers.

    Meine Sitemap dazu sieht so aus:
    Code:
            Text item=Netatmo_Innen_Temperatur valuecolor=[>30="red",>25="orange",>15="green",>5="black",<=5="blue"]
                    {
                        Frame label="Innenwerte"
                            {
                                Text item=Netatmo_Innen_Temperatur valuecolor=[>30="red",>25="orange",>15="green",>5="black",<=5="blue"]
                            }
                    }
    Meine openhab.cfg schaut so aus:
    Code:
    ################################ Netatmo Binding ######################################
    #
    # Refresh interval in milliseconds (optional, defaults to 300000)
    #netatmo:refresh=
    
    # The Netatmo client id (see http://dev.netatmo.com/dev/listapps)
    netatmo:clientid=XXXX
    
    # The Netatmo client secret (see http://dev.netatmo.com/dev/listapps)
    netatmo:clientsecret=YYYY
    
    # The Netatmo refresh token (see http://dev.netatmo.com/doc/authentication/usercred)
    netatmo:refreshtoken=AAAA
    
    # The Netatmo unit system where M=Metric system - celsius/meters/millimeters,
    #     US=US System - fahrenheit/feet/inches (optional, defaults to M)
    #netatmo:unitsystem=
    
    # The Netatmo pressure unit values: mbar, inHg, mmHg (optional, defaults to mbar)
    #netatmo:pressureunit=

    Da sehe ich auch keinen Fehler.
    Ich habe bereits auch einen refresh token bekommen via Curl.

    Aber wenn ich Openhab starte bekomme ich eine Fehlermeldung:
    Code:
    2015-11-27 20:37:44.352 [ERROR] [g.openhab.io.net.http.HttpUtil] - Fatal transport error: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
    2015-11-27 20:37:44.352 [ERROR] [.service.AbstractActiveService] - Error while executing background thread Netatmo Refresh Service
    org.openhab.binding.netatmo.internal.NetatmoException: Could not refresh access token! If you see 'Fatal transport error: javax.net.ssl.SSLHandshakeException' above. You need to install the StartCom CA certificate and restart openHAB. See https://github.com/openhab/openhab/wiki/Netatmo-Binding#missing-certificate-authority for more information.
            at org.openhab.binding.netatmo.internal.NetatmoBinding$OAuthCredentials.refreshAccessToken(NetatmoBinding.java:769) ~[na:na]
            at org.openhab.binding.netatmo.internal.NetatmoBinding.execute(NetatmoBinding.java:116) ~[na:na]
            at org.openhab.core.binding.AbstractActiveBinding$BindingActiveService.execute(AbstractActiveBinding.java:156) ~[na:na]
            at org.openhab.core.service.AbstractActiveService$RefreshThread.run(AbstractActiveService.java:173) ~[na:na]
    Darauf hin habe ich das Certificate von StartCom runtergeladen und eingebunden, meine ca.pem sieht so aus beim einbinden:
    Code:
    Eigentümer: CN=StartCom Certification Authority, OU=Secure Digital Certificate Signing, O=StartCom Ltd., C=IL
    Aussteller: CN=StartCom Certification Authority, OU=Secure Digital Certificate Signing, O=StartCom Ltd., C=IL
    Seriennummer: 1
    Gültig von: Sun Sep 17 21:46:36 CEST 2006 bis: Wed Sep 17 21:46:36 CEST 2036
    Zertifikat-Fingerprints:
             MD5:  22:4D:8F:8A:FC:F7:35:C2:BB:57:34:90:7B:8B:22:16
             SHA1: 3E:2B:F7:F2:03:1B:96:F3:8C:E6:C4:D8:A8:5D:3E:2D:58:47:6A:0F
             SHA256: C7:66:A9:BE:F2:D4:07:1C:86:3A:31:AA:49:20:E8:13:B2:D1:98:60:8C:B7:B7:CF:E2:11:43:B8:36:DF:09:EA
             Signaturalgorithmusname: SHA1withRSA
             Version: 3
    
    Erweiterungen:
    
    #1: ObjectId: 2.16.840.1.113730.1.13 Criticality=false
    0000: 16 29 53 74 61 72 74 43   6F 6D 20 46 72 65 65 20  .)StartCom Free
    0010: 53 53 4C 20 43 65 72 74   69 66 69 63 61 74 69 6F  SSL Certificatio
    0020: 6E 20 41 75 74 68 6F 72   69 74 79                 n Authority
    
    
    #2: ObjectId: 2.5.29.19 Criticality=false
    BasicConstraints:[
      CA:true
      PathLen:2147483647
    ]
    
    #3: ObjectId: 2.5.29.31 Criticality=false
    CRLDistributionPoints [
      [DistributionPoint:
         [URIName: http://cert.startcom.org/sfsca-crl.crl]
    , DistributionPoint:
         [URIName: http://crl.startcom.org/sfsca-crl.crl]
    ]]
    
    #4: ObjectId: 2.5.29.32 Criticality=false
    CertificatePolicies [
      [CertificatePolicyId: [1.3.6.1.4.1.23223.1.1.1]
    [PolicyQualifierInfo: [
      qualifierID: 1.3.6.1.5.5.7.2.1
      qualifier: 0000: 16 23 68 74 74 70 3A 2F   2F 63 65 72 74 2E 73 74  .#http://cert.st
    0010: 61 72 74 63 6F 6D 2E 6F   72 67 2F 70 6F 6C 69 63  artcom.org/polic
    0020: 79 2E 70 64 66                                     y.pdf
    
    ], PolicyQualifierInfo: [
      qualifierID: 1.3.6.1.5.5.7.2.1
      qualifier: 0000: 16 29 68 74 74 70 3A 2F   2F 63 65 72 74 2E 73 74  .)http://cert.st
    0010: 61 72 74 63 6F 6D 2E 6F   72 67 2F 69 6E 74 65 72  artcom.org/inter
    0020: 6D 65 64 69 61 74 65 2E   70 64 66                 mediate.pdf
    
    ], PolicyQualifierInfo: [
      qualifierID: 1.3.6.1.5.5.7.2.2
      qualifier: 0000: 30 81 C3 30 27 16 20 53   74 61 72 74 20 43 6F 6D  0..0'. Start Com
    0010: 6D 65 72 63 69 61 6C 20   28 53 74 61 72 74 43 6F  mercial (StartCo
    0020: 6D 29 20 4C 74 64 2E 30   03 02 01 01 1A 81 97 4C  m) Ltd.0.......L
    0030: 69 6D 69 74 65 64 20 4C   69 61 62 69 6C 69 74 79  imited Liability
    0040: 2C 20 72 65 61 64 20 74   68 65 20 73 65 63 74 69  , read the secti
    0050: 6F 6E 20 2A 4C 65 67 61   6C 20 4C 69 6D 69 74 61  on *Legal Limita
    0060: 74 69 6F 6E 73 2A 20 6F   66 20 74 68 65 20 53 74  tions* of the St
    0070: 61 72 74 43 6F 6D 20 43   65 72 74 69 66 69 63 61  artCom Certifica
    0080: 74 69 6F 6E 20 41 75 74   68 6F 72 69 74 79 20 50  tion Authority P
    0090: 6F 6C 69 63 79 20 61 76   61 69 6C 61 62 6C 65 20  olicy available
    00A0: 61 74 20 68 74 74 70 3A   2F 2F 63 65 72 74 2E 73  at http://cert.s
    00B0: 74 61 72 74 63 6F 6D 2E   6F 72 67 2F 70 6F 6C 69  tartcom.org/poli
    00C0: 63 79 2E 70 64 66                                  cy.pdf
    
    ]]  ]
    ]
    
    #5: ObjectId: 2.5.29.15 Criticality=false
    KeyUsage [
      DigitalSignature
      Key_Encipherment
      Key_Agreement
      Key_CertSign
      Crl_Sign
    ]
    
    #6: ObjectId: 2.16.840.1.113730.1.1 Criticality=false
    NetscapeCertType [
       SSL CA
       S/MIME CA
       Object Signing CA]
    
    #7: ObjectId: 2.5.29.14 Criticality=false
    SubjectKeyIdentifier [
    KeyIdentifier [
    0000: 4E 0B EF 1A A4 40 5B A5   17 69 87 30 CA 34 68 43  N....@[..i.0.4hC
    0010: D0 41 AE F2                                        .A..
    ]
    ]

    Das was ich noch ausprobieren wollte, was aber nicht funktionierte ist, das Zertifikat von https://api.netatmo.net zu ziehen. Das bekomme ich aber nicht hin.
    Kann mir einer weiterhelfen?? Sollten noch Informationen fehlen werde ich Sie sofort nachreichen.

    Grüße,
    Thomas
    Zuletzt geändert von Gummybaer; 28.11.2015, 14:06.

    #2
    Moin,

    ich konnte es jetzt doch selber lösen.

    Bei mir hat es nochmal geholfen alle Java Versionen zu deinstallieren und dann neu zu installieren.
    Und jeweils das Zertifikat reinladen.

    Kommentar


      #3
      das hatte mich auch mal gefoppt, dass das Zertifikat nach einem Java Update erneut eingespielt werden muss.
      In OH 1.8 gab es am netatmo binding einige Neuerungen, läuft das bei dir gut?

      Kommentar


        #4
        Bei mir funktioniert es jetzt eigentlich ganz gut. Ich kann alles auslesen was Netatmo zur verfügung stellt.
        Sogar Akku Stand, Verbindung usw..

        Kommentar


          #5
          Ich bekomme immer folgende Fehlermeldung:

          2015-12-17 14:52:34.927 [INFO ] [.o.b.n.internal.NetatmoBinding] - The following Netatmo measurements are not yet configured:
          XX:XX:XX:XX:XX:XX#Noise (Innenmodul)
          XX:XX:XX:XX:XX:XX#Temperature (Innenmodul)
          XX:XX:XX:XX:XX:XX#Humidity (Innenmodul)
          XX:XX:XX:XX:XX:XX#CO2 (Innenmodul)
          XX:XX:XX:XX:XX:XX#Pressure (Innenmodul)
          XX:XX:XX:XX:XX:XX#05:XX:XX:XX:XX:XX#Rain (Regenmodul)
          XX:XX:XX:XX:XX:XX#02:XX:XX:XX:XX:XX#Temperature (Außenmodul)
          XX:XX:XX:XX:XX:XX#02:XX:XX:XX:XX:XX#Humidity (Außenmodul)

          Wie bekomme ich es hin, dass ich die Werte auslesen kann?

          PS: :XX:XX:XX:XX:XX steht natürlich für die konkrete Mac Adresse
          Zuletzt geändert von Zippochonda; 17.12.2015, 15:03. Grund: missing parts

          Kommentar


            #6
            Code:
             [COLOR=#3933FF][FONT=Monaco][SIZE=11px][COLOR=#931a68]Number[/COLOR][COLOR=#000000]  strNetatmoInnenCO2             [/COLOR]"[U]Kohlendioxid[/U] [%d [U]ppm[/U]]"[COLOR=#000000]             {netatmo=[/COLOR]"XX:[U]XX[/U]:XX:XX:XX:XX#Co2"[COLOR=#000000]}[/COLOR][/SIZE][/FONT][/COLOR]
              [COLOR=#3933FF][FONT=Monaco][SIZE=11px][COLOR=#931a68]Number[/COLOR][COLOR=#000000]  strNetatmoInnenLuftfeuchte    [/COLOR]"[U]Luftfeuchtigkeit[/U] [%d %%]"[COLOR=#000000]             {netatmo=[/COLOR]"XX:[U]XX[/U]:XX:XX:XX:XX#Humidity"[COLOR=#000000]}[/COLOR][/SIZE][/FONT][/COLOR]
              [COLOR=#3933FF][FONT=Monaco][SIZE=11px][COLOR=#931a68]Number[/COLOR][COLOR=#000000]  strNetatmoInnenLuftdruck    [/COLOR]"[U]Luftdruck[/U] [%.2f [U]mbar[/U]]"[COLOR=#000000]             {netatmo=[/COLOR]"XX:[U]XX[/U]:XX:XX:XX:XX#Pressure"[COLOR=#000000]}[/COLOR][/SIZE][/FONT][/COLOR]
              [COLOR=#3933FF][FONT=Monaco][SIZE=11px][COLOR=#931a68]Number[/COLOR][COLOR=#000000]  strNetatmoInnenTemperatur    [/COLOR]"[U]Innentemperatur[/U] [%.1f °C]"[COLOR=#000000]            {netatmo=[/COLOR]"XX:[U]XX[/U]:XX:XX:XX:XX#Temperature"[COLOR=#000000]}[/COLOR][/SIZE][/FONT][/COLOR]
              [COLOR=#3933FF][FONT=Monaco][SIZE=11px][COLOR=#931a68]Number[/COLOR][COLOR=#000000]  strNetatmoInnenLautstaerke  [/COLOR]"[U]Lautstärke[/U] [%d [U]db[/U]]"[COLOR=#000000]                {netatmo=[/COLOR]"XX:[U]XX[/U]:XX:XX:XX:XX#Noise"[COLOR=#000000]}[/COLOR][/SIZE][/FONT][/COLOR]
              [COLOR=#3933FF][FONT=Monaco][SIZE=11px][COLOR=#931a68]Number[/COLOR][COLOR=#000000]  strNetatmoAussenTemperatur    [/COLOR]"[U]Aussentemperatur[/U] [%.1f °C]"[COLOR=#000000]        {netatmo=[/COLOR]"XX:[U]XX[/U]:XX:XX:XX:XX#XX:XX:XX:XX:XX:XX#Temperature"[COLOR=#000000]}[/COLOR][/SIZE][/FONT][/COLOR]
            Die Meldung ist bei mir verschwunden, nachdem ich die entsprechenden Items in der Sitemap angelegt hatte.

            Kommentar


              #7
              Danke, es lag an meiner Items Datei. Da war ein Kommentar nicht richtig gesetzt. Genau der richtige Hinweis

              Kommentar


                #8
                Nach dem Netatmo Biding brauche ich einen ClientID, Clientsecret und einen Refreshtoken.
                Die ClientID und das Secret habe ich. Doch wie komme ich zum Refreshtoken?
                Bin dem Englischen nicht so mächtig.
                Gruss Claude

                Kommentar


                  #9

                  Code:
                     
                   curl -d 'grant_type=password&client_id=123456789012345678901234&client_secret=ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHI&username=example@example.com&password=example&scope=read_station read_camera read_thermostat write_thermostat' 'https://api.netatmo.net/oauth2/token'
                  Musst du im Terminal eingeben und dann Enter

                  Kommentar

                  Lädt...
                  X