Ankündigung

Einklappen
Keine Ankündigung bisher.

Amazon Alexa Plugin

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

    Psilo, wenn sich kein anderer hier rührt, wirds schon gefixt sein, ist ja schon fast ein Jahr her.

    Wenn du´s im Dezember gefixt hast, hab ich im Februar einfach noch nicht geupdatet gehabt.

    Nachdem sich keiner gemeldet hatte, wollt ich nur den Hinweis geben, nicht dass es mehreren mit der HABridge so geht wie mir.

    Gruß Wolfi

    Kommentar


      Hallo Alexa Gemeinde,
      ich plane auch Alexa mal in meinen Haus einzusetzen, scheitere jetzt schon an der Aufsetzung von ngnix. Alexa Skill habe ich schon in meiner Skill Übersicht, aber testen kann ich da ja nix da ich kein ngnix fertig habe.
      Normalerweise hatte ich apache2 am laufen um z.B. Smartvisu zu nutzen. So wie ich das verstehe wird dann apache2 gestoppt und dafür ngnix genutzt.
      Habe mich an der Anleitung von https://github.com/smarthomeNG/smart...s-ReverseProxy an das Thema herangetraut.
      Installation klappte ohne Probleme.


      Wenn ich mir jedoch jetzt per:
      Code:
      sudo certbot certonly --rsa-key-size 4096 --webroot -w /var/www -d mydomain.com -d alexa.mydomain.com
      ein Zertifikat erstellen will steigt er mit Fehler aus:
      Code:
      smarthome@smarthome:~$ sudo certbot certonly --webroot -w /var/www -d mydomain.com -d alexa.mydomain.com
      [sudo] password for smarthome:
      Saving debug log to /var/log/letsencrypt/letsencrypt.log
      Starting new HTTPS connection (1): acme-v01.api.letsencrypt.org
      Obtaining a new certificate
      Performing the following challenges:
      http-01 challenge for mydomain.com
      http-01 challenge for alexa.mydomain.com
      Using the webroot path /var/www for all unmatched domains.
      Waiting for verification...
      Cleaning up challenges
      Failed authorization procedure. mydomain.com (http-01): urn:acme:error:unauthorized :: The client lacks sufficient authorization :: Invalid response from http://mydomain.com/.well-known/acme-challenge/CSUGRfeOrrlkyGe0IKMe3PSFxOvB4QLADvPUga-_i-E: "<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
      <html><head>
      <title>404 Not Found</title>
      </head><body>
      <h1>Not Found</h1>
      <p", alexa.mydomain.com (http-01): urn:acme:error:unknownHost :: The server could not resolve a domain name :: No valid IP addresses found for alexa.mydomain.com
      
      IMPORTANT NOTES:
       - The following errors were reported by the server:
      
         Domain: alexa.mydomain.com
         Type:   unknownHost
         Detail: No valid IP addresses found for alexa.pol3cat.com
      
         To fix these errors, please make sure that your domain name was
         entered correctly and the DNS A record(s) for that domain
         contain(s) the right IP address.
       - The following errors were reported by the server:
      
         Domain: mydomain.com
         Type:   unauthorized
         Detail: Invalid response from
         http://mydomain.com/.well-known/acme-challenge/CSUGRfeOrrlkyGe0IKMe3PSFxOvB4QLADvPUga-_i-E:
         "<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
         <html><head>
         <title>404 Not Found</title>
         </head><body>
         <h1>Not Found</h1>
         <p"
      
         To fix these errors, please make sure that your domain name was
         entered correctly and the DNS A record(s) for that domain
         contain(s) the right IP address.
      mydomain.com steht für meine Domaine.
      Habe diese bei Strato liegen und per DynDNS an meine FritzBox gekoppelt.
      Zum Test habe ich auf der Fritz einen Exposed Host auf auf meinen Smarthome gelegt. Später wollte ich dann gezielte Ports öffnen.


      Verzeichnisse liegen auch alle in /var/www/
      .wellknown sowie das acme unterverzeichnis

      im acme Unterverzeichnis ist aber keine Datei vorhanden?!



      Hatte das jemand auch mal und weiß jemand rat?

      Danke.
      Gruß
      Christian

      Kommentar


        Code:
         
          alexa.mydomain.com (http-01): urn:acme:error:unknownHost :: The server could not resolve a domain name :: No valid IP addresses found for alexa.mydomain.com  IMPORTANT NOTES:  - The following errors were reported by the server:     Domain: alexa.mydomain.com    Type:   unknownHost    Detail: No valid IP addresses found for alexa.pol3cat.com

        Kommentar


          Hast Du einen öffentlichen DNS A-record für alexa.mydomain.com gesetzt?
          ggf. wenn keine IP Adresse mehr dafür hast einen CNAME im DNS konfigurieren.
          Zuletzt geändert von yachti; 09.12.2017, 15:52.
          Meine Installation: VM Debian Buster SH NG 1.8.1, SmartVISU 3.0, KNX, DMX, 1-wire, Fortigate 30E IPS, VMware vSphere 6.7

          Kommentar


            Kann man nen DNS a-Record auf nen dyndns legen bei Strato?
            Die fritz ist nur mit ‚mydomain.com’ verknüpft.
            Die sub ‚alexa.mydomain.com‘ wüsste ja dann nicht wohin, oder?
            Gruß
            Christian

            Kommentar


              Zitat von Polecat Beitrag anzeigen
              Die fritz ist nur mit ‚mydomain.com’ verknüpft.
              dann leg den CNAME für alexa auf die mydomain.com bei Strato. Wie das bei Strato geht kann ich dir leider nicht sagen.

              Beispiel DNS
              Host ->alexa Typ->CNAME Destination -> mydomain.com
              Zuletzt geändert von yachti; 09.12.2017, 16:37. Grund: Beispiel eingefügt
              Meine Installation: VM Debian Buster SH NG 1.8.1, SmartVISU 3.0, KNX, DMX, 1-wire, Fortigate 30E IPS, VMware vSphere 6.7

              Kommentar


                Prima hat funktioniert mit CNAME auf mydomain.com.

                Danke dir

                dann kann ich mal versuchen ob ich das nginx mit pfade ans laufen bekomm
                Gruß
                Christian

                Kommentar


                  So, nun hänge ich daran, dass ich nicht mehr meine Smartvisu ansehen kann per Webaufruf.

                  Habe Port 443 per TCP in der Fritz weitergeleitet.


                  Meine Config sieht wie folgt aus:

                  mydomain.com.conf
                  Code:
                  server {
                      server_tokens off;
                  
                      ## Blocken, wenn Zugriff aus einem nicht erlaubten Land erfolgt ##
                      ## if ($allowed_country = no) {
                      ##    return 403;
                      ## }    
                  
                      # https://www.cyberciti.biz/tips/linux-unix-bsd-nginx-webserver-security.html
                      ## Block download agents ##
                      ##if ($http_user_agent ~* LWP::Simple|BBBike|wget) {
                      ##    return 403;
                      ##}
                  
                      ## Block some robots ##
                      ##if ($http_user_agent ~* msnbot|scrapbot) {
                      ##    return 403;
                      ##}
                  
                      ## Deny certain Referers ##
                      ##if ( $http_referer ~* (babes|forsale|girl|jewelry|love|nudit|organic|poker|porn|sex|teen) )
                      ##{
                      ##    return 403;
                      ##}
                  
                      listen 443 ssl default_server;
                      server_name mydomain.com;
                  
                      ##
                      # SSL
                      ##
                  
                      ## Activate SSL, setze SERVER Zertifikat Informationen ## 
                      # Generiert via Let's Encrypt! 
                      ssl on;
                      ssl_certificate /etc/letsencrypt/live/mydomain.com/fullchain.pem;
                      ssl_certificate_key /etc/letsencrypt/live/mydomain.com/privkey.pem;
                      ssl_session_cache builtin:1000 shared:SSL:10m;
                      ssl_prefer_server_ciphers on;
                      # unsichere SSL Ciphers deaktivieren!
                      ssl_ciphers    HIGH:!aNULL:!eNULL:!LOW:!3DES:!MD5:!RC4;
                  
                      ##
                      # HSTS
                      ##
                  
                      add_header Strict-Transport-Security "max-age=31536000; includeSubDomains";
                  
                      ##
                      # global
                      ##
                  
                      root /var/www/mydomain.com;
                      #root /var/www;
                      index index.php index.htm index.html;
                  
                      # Weiterleitung zu SmartHomeNG (Websocket Schnittstelle) mit Basic Auth
                      location / {
                          auth_basic "Restricted Area: smartVISU";
                          auth_basic_user_file /etc/nginx/.smartvisu;
                  
                          # Zugreifendes Land erlaubt?
                          ##if ($allowed_country = no) {
                          ##        return 403;
                          ##}
                  
                          # Nur Websocket Verbindungen gegen "/" durchlassen!
                          if ($http_upgrade = websocket) {
                                  proxy_pass http://192.168.178.27:2424;
                          }
                          if ($http_upgrade != websocket) {
                                  return 403;
                          }
                      }
                  
                      # Zugriff auf die SmartVISU mit Basic Auth
                      location /smartVISU {      
                          auth_basic "Restricted Area: smartVISU";
                          auth_basic_user_file /etc/nginx/.smartvisu;
                  
                          # Zugreifendes Land erlaubt? 
                          ##if ($allowed_country = no)  {
                          ##        return 403;
                          ##}
                  
                          proxy_pass http://192.168.178.27/smartVISU;
                          proxy_set_header Host $host;
                          proxy_set_header X-Real-IP $remote_addr;
                          proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                          proxy_set_header X-Forwarded-Proto $scheme;
                      }
                  
                      # Alexa Plugin Weiterleitung
                      location /alexa {
                          auth_basic "Restricted Area: Alexa";
                          auth_basic_user_file /etc/nginx/.alexa;
                  
                          # Zugreifendes Land erlaubt?
                          ##if ($allowed_country = no) {
                          ##        return 403;
                          ##}
                  
                          proxy_pass http://192.168.178.27:9000/;
                          proxy_set_header Host $host;
                          proxy_set_header X-Real-IP $remote_addr;
                          proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                          proxy_set_header X-Forwarded-Proto $scheme;
                      }
                  
                      # Network Plugin Weiterleitung
                      location /shng {
                          auth_basic "Restricted Area: SmartHomeNG";
                          auth_basic_user_file /etc/nginx/.shng;
                  
                          ##if ($allowed_country = no) {
                           ##       return 403;
                          ##        break;
                          ##}
                          proxy_pass http://192.168.178.27:8383/;
                          proxy_set_header Host $host;
                          proxy_set_header X-Real-IP $remote_addr;
                          proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                          proxy_set_header X-Forwarded-Proto $scheme;
                      }
                  }
                  default
                  Code:
                  # Default server configuration
                  #
                  
                  
                  
                  server {
                      listen 80 default_server;
                      listen [::]:80 default_server;
                      include /etc/nginx/snippets/letsencrypt.conf;
                  
                      # SSL configuration
                      #
                      # listen 443 ssl default_server;
                      # listen [::]:443 ssl default_server;
                      #
                      # Self signed certs generated by the ssl-cert package
                      # Don't use them in a production server!
                      #
                      # include snippets/snakeoil.conf;
                  
                      root /var/www/html;
                      #root /var/www;
                  
                      # Add index.php to the list if you are using PHP
                      index index.html index.htm index.nginx-debian.html;
                  
                      server_name _;
                  
                      location / {
                          # First attempt to serve request as file, then
                          # as directory, then fall back to displaying a 404.
                          try_files $uri $uri/ =404;
                      }
                  
                  
                  }
                  Smartvisu liegt in /var/www/smartVISU

                  Wenn ich "http://192.168.178.27/smartVISU" öffne kommt gleich von nginx 404
                  Wenn ich "mydomain.com" öffne wird in https geändert und 403 erscheint.

                  Passwörter habe ich angelegt per:
                  Code:
                   sudo htpasswd -c /etc/nginx/.smartvisu <username> sudo htpasswd -c /etc/nginx/.alexa <username> sudo htpasswd -c /etc/nginx/.shng <username> [FONT=Arial][/FONT]

                  Solang der SmartVISU Aufruf nicht funktioniert wird bestimmt auch Alexa nicht sauber funktionieren...

                  Gruß
                  Christian

                  Kommentar


                    sicher, dass dein upstream für smartvisu korrekt konfiguriert ist?
                    das muss die location sein, wo smartvisua wirklich hosted wird und nginx forwarded einfach dorthin:
                    Code:
                     
                     location /smartVISU {                proxy_pass http://192.168.178.27/smartVISU;
                    Code:
                    192.168.178.27
                    ist doch dein nginx selbst und nicht der smartvisu host oder?

                    Kommentar


                      wenn ich das so lese, denke dass ich irgendwie nene grundsätzliches problem habe.

                      kann es sein das nginx nicht auf den gleichen system laufen darf wie smarthome.py + smartvisu?

                      bei mir läuft alles auf einen bananian.pi, also die 192.168.178.27



                      Gruß
                      Christian

                      Kommentar


                        Kann mir bitte jemand helfen. Ich komme mit den Zertifikaten nicht weiter. Die Tipps von SvStefan (Seite 6) habe ich auch befolgt.

                        Mein System: Synology NAS
                        Da läuft Smartvisu und SmarthomeNG einwandfrei drauf.

                        Meine aktuelle Lambda Fehlermeldung:

                        Code:
                         
                         {   "errorMessage": "unable to verify the first certificate",   "errorType": "Error",   "stackTrace": [     "Error (native)",     "TLSSocket.<anonymous> (_tls_wrap.js:1016:38)",     "emitNone (events.js:67:13)",     "TLSSocket.emit (events.js:166:7)",     "TLSSocket._finishInit (_tls_wrap.js:585:8)"   ] }
                        Meine NGINX Configuration (/etc/nginx/app.d/server.ReverseProxy.conf)
                        Code:
                          server {     listen 8090 ssl;     listen [::]:8090;      server_name XXX.SERVERNAME.XXX;      access_log /var/log/nginx/alexa.log combined;     error_log /var/log/nginx/alexa.err debug;     auth_basic "alexa";     auth_basic_user_file /etc/nginx/.htpasswd;      location / {         proxy_set_header        Host                $http_host;         proxy_set_header        X-Real-IP           $remote_addr;         proxy_set_header        X-Forwarded-For     $proxy_add_x_forwarded_for;         proxy_set_header        X-Forwarded-Proto   $scheme;         proxy_intercept_errors  on;         proxy_http_version      1.1;          proxy_pass http://192.168.178.40:8090;      }  }

                        Kommentar


                          Hallo Salf ,

                          bist du dir sicher, dass du die richtige Config auf dem Synology bearbeitest? Ich habe meine Config für den nginx hier liegen: /etc/nginx/sites-enabled/your-home .

                          Ansonsten sehe ich in deiner Config nicht wirklich, wo du denn die Zertifikate aufführst?! Das sollte ja eigentlich ungefähr so aussehen:
                          Code:
                           
                           ssl_certificate /etc/letsencrypt/live/mydomain.com/fullchain.pem;     ssl_certificate_key /etc/letsencrypt/live/mydomain.com/privkey.pem;
                          Beste Grüße,
                          Malte

                          Kommentar


                            nach langem hin und her habe ich nun endlich alles mit nginx hinbekommen und Alexa scheint per AWS erreichbar zu sein.
                            Per AWS Test bekomme ich mein Test Discovery Objekt zu sehen
                            Code:
                            {
                              "header": {
                                "payloadVersion": "3",
                                "namespace": "Alexa.ConnectedHome.Discovery",
                                "name": "DiscoverAppliancesRequest",
                                "messageId": "F8752B11-69BB-4246-B923-3BFB27C06C7D"
                              },
                              "payload": {
                                "accessToken": "1"
                              }
                            }

                            Result:
                            Code:
                             {   "payload": {     "discoveredAppliances": [       {         "manufacturerName": "smarthomeNG.alexa",         "actions": [           "turnOn",           "turnOff"         ],         "friendlyDescription": "Arbeitzimmer Licht",         "isReachable": true,         "additionalApplianceDetails": {           "item1": "EG.Arbeiten.Licht"         },         "modelName": "smarthomeNG.alexa-device",         "version": "1.3.0.9.0",         "friendlyName": "Arbeitszimmer",         "applianceId": "ew_light_arbeitszimmer-alias1"       },       {         "manufacturerName": "smarthomeNG.alexa",         "actions": [           "turnOn",           "turnOff"         ],         "friendlyDescription": "Arbeitzimmer Licht",         "isReachable": true,         "additionalApplianceDetails": {           "item1": "EG.Arbeiten.Licht"         },         "modelName": "smarthomeNG.alexa-device",         "version": "1.3.0.9.0",         "friendlyName": "Licht",         "applianceId": "ew_light_arbeitszimmer"       }     ]   },   "header": {     "name": "DiscoverAppliancesResponse",     "namespace": "Alexa.ConnectedHome.Discovery",     "payloadVersion": "2",     "messageId": "f399992783dd409bac52c2b32d3c914d"   } }
                            Nun frage ich mich wieso ich nix bei der Alexa app unter Gerätesuche sehe...

                            Item.config in smartvisu
                            Code:
                            [EG]
                                [[Arbeiten]]    
                            
                                    [[[Licht]]]
                                        type = bool
                                        knx_dpt = 1
                                        knx_cache = 1/3/1     #    Status
                                        knx_send = 1/3/0    #     Schalten
                                        alexa_device = ew_light_arbeitszimmer
                                        alexa_name = "Licht"
                                        alexa_alias = "Arbeitszimmer"
                                        alexa_description = "Arbeitzimmer Licht"
                                        alexa_actions = "turnOn turnOff"
                            Jemand ne idee.

                            Besten Dank.

                            EDIT: Gefunden. der Trigger muss ja noch aktiviert werden. Grrr
                            Zuletzt geändert von Polecat; 11.12.2017, 19:31.
                            Gruß
                            Christian

                            Kommentar


                              Hallo malte ,

                              danke für den Hinweis mit den SSL Zertifikaten. Ich hab nun ein wenig geforscht, wo den diese auf der NAS liegen und entsprechend ergänzt. Ich bekomme nun eine andere Fehlermeldung.

                              Irgendwie stehe ich bei dem Thema noch etwas im Dunkeln. Hier mal die aktuelle Fehlermeldung.
                              Code:
                                 
                               {   "errorMessage": "RequestId: 6c1d05f3-dea9-11e7-b45f-7fcada1d5242 Process exited before completing request" }
                              Code:
                                 
                               START RequestId: 6c1d05f3-dea9-11e7-b45f-7fcada1d5242 Version: $LATEST 2017-12-11T19:28:10.328Z	6c1d05f3-dea9-11e7-b45f-7fcada1d5242	requesting {"header":{"payloadVersion":"2","namespace":"Alexa.ConnectedHome.Discovery","name":"DiscoverAppliancesRequest","messageId":"F8752B11-69BB-4246-B923-3BFB27C06C7D"},"payload":{"accessToken":"1"}} 2017-12-11T19:28:12.885Z	6c1d05f3-dea9-11e7-b45f-7fcada1d5242	HTTP 400 2017-12-11T19:28:12.908Z	6c1d05f3-dea9-11e7-b45f-7fcada1d5242	raw response: <html>  <head><title>400 Request Header Or Cookie Too Large</title></head>  <body bgcolor="white">  <center><h1>400 Bad Request</h1></center>  <center>Request Header Or Cookie Too Large</center>  <hr><center>nginx</center>  </body>  </html>   2017-12-11T19:28:12.909Z	6c1d05f3-dea9-11e7-b45f-7fcada1d5242	SyntaxError: Unexpected token <     at Object.parse (native)     at IncomingMessage.<anonymous> (/var/task/index.js:40:24)     at emitNone (events.js:72:20)     at IncomingMessage.emit (events.js:166:7)     at endReadableNT (_stream_readable.js:905:12)     at nextTickCallbackWith2Args (node.js:437:9)     at process._tickDomainCallback (node.js:392:17) END RequestId: 6c1d05f3-dea9-11e7-b45f-7fcada1d5242 REPORT RequestId: 6c1d05f3-dea9-11e7-b45f-7fcada1d5242	Duration: 2631.27 ms	Billed Duration: 2700 ms 	Memory Size: 128 MB	Max Memory Used: 25 MB	 RequestId: 6c1d05f3-dea9-11e7-b45f-7fcada1d5242 Process exited before completing request
                              Die Nginx Einstellungen legt Synology bei der Einrichtung über DSM automatisch in den Ordner "app.d". Der Nachteil ist aber, dass diese bei jedem Neustart überschrieben werden. Daher schreibe ich später noch ein autostart script. Welche Vorteile hat "/etc/nginx/sites-enabled/your-home"

                              Kommentar


                                Wieder einen Schritt weiter. Keine Ahnung was ich gemacht habe, aber AWS bringt jetzt keine Fehlermeldung. Die App findet aber keine Geräte.

                                Code:
                                 {   "payload": {     "discoveredAppliances": [       {         "actions": [           "turnOff",           "turnOn"         ],         "manufacturerName": "smarthomeNG.alexa",         "modelName": "smarthomeNG.alexa-device",         "isReachable": true,         "applianceId": "wohnzimmer-lampe",         "additionalApplianceDetails": {           "item1": "EG.Wohnzimmer.Licht"         },         "version": "1.3.0.9.0",         "friendlyDescription": "Wohnzimmer Lampe",         "friendlyName": "Wohnzimmer Lampe"       }     ]   },   "header": {     "namespace": "Alexa.ConnectedHome.Discovery",     "name": "DiscoverAppliancesResponse",     "payloadVersion": "2",     "messageId": "3e097bd79dfc44d2899d264690854138"   } }
                                EDIT:

                                Gelöst, geil, geil geil. Danke für eure Unterstützung.
                                Die Lösung für dieses Problem war die Payload auf v2 zu ändern.
                                Zuletzt geändert von Salf; 12.12.2017, 09:20.

                                Kommentar

                                Lädt...
                                X