alexa-fhem: amazon alexa smart home skill für fhem

Begonnen von justme1968, 05 November 2016, 23:21:32

Vorheriges Thema - Nächstes Thema

amenomade

Komisch, der fehlt direkt in den Fehler, der kommt schon nicht bis zum "Using xxxxx/config.json"
Pi 3B, Alexa, CUL868+Selbstbau 1/2λ-Dipol-Antenne, USB Optolink / Vitotronic, Debmatic und HM / HmIP Komponenten, Rademacher Duofern Jalousien, Fritz!Dect Thermostaten, Proteus

amenomade

#3031
Mach mal ein "ls -lar /opt/fhem/alexa-fhem" bitte und das gleiche für home: "ls -lar /home/pi/.alexa"

Und lösche "EnvironmentFile=/etc/default/alexa"
Pi 3B, Alexa, CUL868+Selbstbau 1/2λ-Dipol-Antenne, USB Optolink / Vitotronic, Debmatic und HM / HmIP Komponenten, Rademacher Duofern Jalousien, Fritz!Dect Thermostaten, Proteus

Byllyy

OK, Danke das Du hartnäckig dran bleibst ( Ich habe schon mehrmals aufgegeben)

pi@raspberrypi:~ $ ls -lar /opt/fhem/alexa-fhem
total 128
-rw-rw-r--  1 fhem dialout  1597 Mar 13 08:38 TODO
-rw-r--r--  1 root root     5330 Aug 27 15:44 sudo shutdown -r now
-rw-rw-r--  1 fhem dialout  2830 Nov  8  2016 README.md
-rw-r--r--  1 root root    58859 Sep  1 12:15 pberrypi systemd[1]: Starting Node.js Alexa Server...
-rw-rw-r--  1 fhem dialout   373 Apr 26 08:39 package.json
-rw-rw-r--  1 fhem dialout    33 Nov  5  2016 .npmignore
drwxr-xr-x 70 fhem dialout  4096 Aug 23 16:54 node_modules
drwxr-xr-x  2 fhem dialout  4096 Aug 23 16:53 lib
-rw-rw-r--  1 fhem dialout  1183 Dec 23  2016 lambda.js
-rw-r--r--  1 fhem dialout  1675 Aug 23 16:58 key.pem
-rwxrwxr-x  1 fhem dialout   150 Nov  5  2016 createKey.sh
-rw-r--r--  1 fhem dialout   573 Feb 19  2017 config-sample.json
-rw-r--r--  1 fhem dialout   573 Feb 19  2017 config.json
-rw-r--r--  1 fhem dialout  1208 Aug 23 16:58 cert.pem
drwxr-xr-x  2 fhem dialout  4096 Aug 23 16:53 bin
drwxr-xr-x 14 fhem dialout  4096 Aug 23 16:54 ..
drwxr-xr-x  5 fhem dialout  4096 Sep  1 12:15 .

amenomade

Sorry, ich meinte
ls -laR /opt/fhem/alexa-fhem
ls -laR /home/pi/.alexa

Pi 3B, Alexa, CUL868+Selbstbau 1/2λ-Dipol-Antenne, USB Optolink / Vitotronic, Debmatic und HM / HmIP Komponenten, Rademacher Duofern Jalousien, Fritz!Dect Thermostaten, Proteus

Byllyy

#3034
OK, die erste ist groß:

ls -laR /opt/fhem/alexa-fhem
/opt/fhem/alexa-fhem:
total 128
drwxr-xr-x  5 fhem dialout  4096 Sep  1 12:15 .
drwxr-xr-x 14 fhem dialout  4096 Aug 23 16:54 ..
-rw-rw-r--  1 fhem dialout    33 Nov  5  2016 .npmignore
-rw-rw-r--  1 fhem dialout  2830 Nov  8  2016 README.md
-rw-rw-r--  1 fhem dialout  1597 Mar 13 08:38 TODO
drwxr-xr-x  2 fhem dialout  4096 Aug 23 16:53 bin
-rw-r--r--  1 fhem dialout  1208 Aug 23 16:58 cert.pem
-rw-r--r--  1 fhem dialout   573 Feb 19  2017 config-sample.json
-rw-r--r--  1 fhem dialout   573 Feb 19  2017 config.json
-rwxrwxr-x  1 fhem dialout   150 Nov  5  2016 createKey.sh
-rw-r--r--  1 fhem dialout  1675 Aug 23 16:58 key.pem
-rw-rw-r--  1 fhem dialout  1183 Dec 23  2016 lambda.js
drwxr-xr-x  2 fhem dialout  4096 Aug 23 16:53 lib
drwxr-xr-x 70 fhem dialout  4096 Aug 23 16:54 node_modules
-rw-rw-r--  1 fhem dialout   373 Apr 26 08:39 package.json
-rw-r--r--  1 root root    58859 Sep  1 12:15 pberrypi systemd[1]: Starting Node.js Alexa Server...
-rw-r--r--  1 root root     5330 Aug 27 15:44 sudo shutdown -r now



/opt/fhem/alexa-fhem/node_modules/json-schema/draft-00:
total 24
drwxr-xr-x 2 fhem dialout 4096 Aug 23 16:54 .
drwxr-xr-x 9 fhem dialout 4096 Aug 23 16:54 ..
-rw-r--r-- 1 fhem dialou

amenomade

Zu gross (sorry, hatte nicht mehr an allen node-js modules gedacht), aber ich habe schon gesehen, was ich wollte. Sieht gut aus.

Bitte den Post editieren, und kürzen (alle /node-module/* entfenrnen), damit das /code am Ende noch passt.

Und dann das zweite "ls"
Pi 3B, Alexa, CUL868+Selbstbau 1/2λ-Dipol-Antenne, USB Optolink / Vitotronic, Debmatic und HM / HmIP Komponenten, Rademacher Duofern Jalousien, Fritz!Dect Thermostaten, Proteus

amenomade

Nächste Schritt wäre, wenn die Berechtigungen in /home/pi/.alexa auch stimmern, systemd loglevel zu erhöhen:

In /etc/systemd/system.conf editieren
LogLevel=debug
LogTarget=syslog-or-kmsg


dann daemon-reload

Und dann wieder in journalctl schauen
Pi 3B, Alexa, CUL868+Selbstbau 1/2λ-Dipol-Antenne, USB Optolink / Vitotronic, Debmatic und HM / HmIP Komponenten, Rademacher Duofern Jalousien, Fritz!Dect Thermostaten, Proteus

Amenophis86

Und gerade bei solchen Postings Codetags nutzen, ganz wichtig :)
Aktuell dabei unser neues Haus mit KNX am einrichten. Im nächsten Schritt dann KNX mit FHEM verbinden. Allein zwei Dinge sind dabei selten: Zeit und Geld...

Byllyy

Das war wirklich zu lang ;)
Hier das zweite ls:


pi@raspberrypi:~ $ ls -laR /home/pi/.alexa
/home/pi/.alexa:
total 24
drwxr-xr-x 2 pi pi  4096 Aug 23 09:31 .
drwxr-xr-x 6 pi pi  4096 Sep  1 13:31 ..
-rw-r--r-- 1 pi pi   519 Aug 25 08:43 config.json
-rw-r--r-- 1 pi pi 12288 Aug 23 09:33 .config.json.swp
pi@raspberrypi:~ $


Danke

Byllyy

Das sagt das Journal nach der Änderung des Loglevel


pi@raspberrypi:~ $ sudo journalctl -u alexa
-- Logs begin at Fri 2017-09-01 15:44:32 CEST, end at Fri 2017-09-01 15:45:25 CE
Sep 01 15:44:44 raspberrypi systemd[1]: Starting Node.js Alexa Server...
Sep 01 15:44:44 raspberrypi systemd[1]: Started Node.js Alexa Server.
Sep 01 15:44:44 raspberrypi systemd[1]: alexa.service: main process exited, code
Sep 01 15:44:44 raspberrypi systemd[1]: Unit alexa.service entered failed state.
Sep 01 15:45:01 raspberrypi systemd[1]: alexa.service holdoff time over, schedul
Sep 01 15:45:01 raspberrypi systemd[1]: Stopping Node.js Alexa Server...
Sep 01 15:45:01 raspberrypi systemd[1]: Starting Node.js Alexa Server...
Sep 01 15:45:01 raspberrypi systemd[1]: Started Node.js Alexa Server.
Sep 01 15:45:01 raspberrypi systemd[1]: alexa.service: main process exited, code
Sep 01 15:45:01 raspberrypi systemd[1]: Unit alexa.service entered failed state.
Sep 01 15:45:11 raspberrypi systemd[1]: alexa.service holdoff time over, schedul
Sep 01 15:45:11 raspberrypi systemd[1]: Stopping Node.js Alexa Server...
Sep 01 15:45:11 raspberrypi systemd[1]: Starting Node.js Alexa Server...
Sep 01 15:45:11 raspberrypi systemd[1]: Started Node.js Alexa Server.
Sep 01 15:45:11 raspberrypi systemd[1]: alexa.service: main process exited, code
Sep 01 15:45:11 raspberrypi systemd[1]: Unit alexa.service entered failed state.
Sep 01 15:45:21 raspberrypi systemd[1]: alexa.service holdoff time over, schedul
Sep 01 15:45:21 raspberrypi systemd[1]: Stopping Node.js Alexa Server...
Sep 01 15:45:21 raspberrypi systemd[1]: Starting Node.js Alexa Server...
Sep 01 15:45:21 raspberrypi systemd[1]: Started Node.js Alexa Server.
Sep 01 15:45:21 raspberrypi systemd[1]: alexa.service: main process exited, code
Sep 01 15:45:21 raspberrypi systemd[1]: Unit alexa.service entered failed state.
lines 1-23
-- Logs begin at Fri 2017-09-01 15:44:32 CEST, end at Fri 2017-09-01 15:45:25 CEST. --
Sep 01 15:44:44 raspberrypi systemd[1]: Starting Node.js Alexa Server...
Sep 01 15:44:44 raspberrypi systemd[1]: Started Node.js Alexa Server.
Sep 01 15:44:44 raspberrypi systemd[1]: alexa.service: main process exited, code=exited, status
Sep 01 15:44:44 raspberrypi systemd[1]: Unit alexa.service entered failed state.
Sep 01 15:45:01 raspberrypi systemd[1]: alexa.service holdoff time over, scheduling restart.
Sep 01 15:45:01 raspberrypi systemd[1]: Stopping Node.js Alexa Server...
Sep 01 15:45:01 raspberrypi systemd[1]: Starting Node.js Alexa Server...
Sep 01 15:45:01 raspberrypi systemd[1]: Started Node.js Alexa Server.
Sep 01 15:45:01 raspberrypi systemd[1]: alexa.service: main process exited, code=exited, status
Sep 01 15:45:01 raspberrypi systemd[1]: Unit alexa.service entered failed state.
Sep 01 15:45:11 raspberrypi systemd[1]: alexa.service holdoff time over, scheduling restart.
Sep 01 15:45:11 raspberrypi systemd[1]: Stopping Node.js Alexa Server...
Sep 01 15:45:11 raspberrypi systemd[1]: Starting Node.js Alexa Server...
Sep 01 15:45:11 raspberrypi systemd[1]: Started Node.js Alexa Server.
Sep 01 15:45:11 raspberrypi systemd[1]: alexa.service: main process exited, code=exited, status
Sep 01 15:45:11 raspberrypi systemd[1]: Unit alexa.service entered failed state.
Sep 01 15:45:21 raspberrypi systemd[1]: alexa.service holdoff time over, scheduling restart.
Sep 01 15:45:21 raspberrypi systemd[1]: Stopping Node.js Alexa Server...
Sep 01 15:45:21 raspberrypi systemd[1]: Starting Node.js Alexa Server...
Sep 01 15:45:21 raspberrypi systemd[1]: Started Node.js Alexa Server.
Sep 01 15:45:21 raspberrypi systemd[1]: alexa.service: main process exited, code=exited, status
Sep 01 15:45:21 raspberrypi systemd[1]: Unit alexa.service entered failed state.
lines 1-23...skipping...
-- Logs begin at Fri 2017-09-01 15:44:32 CEST, end at Fri 2017-09-01 15:45:25 CEST. --
Sep 01 15:44:44 raspberrypi systemd[1]: Starting Node.js Alexa Server...
Sep 01 15:44:44 raspberrypi systemd[1]: Started Node.js Alexa Server.
Sep 01 15:44:44 raspberrypi systemd[1]: alexa.service: main process exited, code=exited, status=217/USER
Sep 01 15:44:44 raspberrypi systemd[1]: Unit alexa.service entered failed state.
Sep 01 15:45:01 raspberrypi systemd[1]: alexa.service holdoff time over, scheduling restart.
Sep 01 15:45:01 raspberrypi systemd[1]: Stopping Node.js Alexa Server...
Sep 01 15:45:01 raspberrypi systemd[1]: Starting Node.js Alexa Server...
Sep 01 15:45:01 raspberrypi systemd[1]: Started Node.js Alexa Server.
Sep 01 15:45:01 raspberrypi systemd[1]: alexa.service: main process exited, code=exited, status=217/USER
Sep 01 15:45:01 raspberrypi systemd[1]: Unit alexa.service entered failed state.
Sep 01 15:45:11 raspberrypi systemd[1]: alexa.service holdoff time over, scheduling restart.
Sep 01 15:45:11 raspberrypi systemd[1]: Stopping Node.js Alexa Server...
Sep 01 15:45:11 raspberrypi systemd[1]: Starting Node.js Alexa Server...
Sep 01 15:45:11 raspberrypi systemd[1]: Started Node.js Alexa Server.
Sep 01 15:45:11 raspberrypi systemd[1]: alexa.service: main process exited, code=exited, status=217/USER
Sep 01 15:45:11 raspberrypi systemd[1]: Unit alexa.service entered failed state.
Sep 01 15:45:21 raspberrypi systemd[1]: alexa.service holdoff time over, scheduling restart.
Sep 01 15:45:21 raspberrypi systemd[1]: Stopping Node.js Alexa Server...
Sep 01 15:45:21 raspberrypi systemd[1]: Starting Node.js Alexa Server...
Sep 01 15:45:21 raspberrypi systemd[1]: Started Node.js Alexa Server.
Sep 01 15:45:21 raspberrypi systemd[1]: alexa.service: main process exited, code=exited, status=217/USER
Sep 01 15:45:21 raspberrypi systemd[1]: Unit alexa.service entered failed state.

amenomade

Mach aber diesmal ohne mit alexa zu filtern, und auch mit rechtem Teil, vielleicht werden wir mehr sehen:

sudo journalctl --since "2017-09-01 15:44:32" --until "2017-09-01 15:45:25" | more



Pi 3B, Alexa, CUL868+Selbstbau 1/2λ-Dipol-Antenne, USB Optolink / Vitotronic, Debmatic und HM / HmIP Komponenten, Rademacher Duofern Jalousien, Fritz!Dect Thermostaten, Proteus

Reinhart


diese Art der Probleme hatte ich auch schon einmal, der Service kann offensichtlich nicht ins Verzeichnis /home/pi/.alexa zugreifen weil ihm Rechte ins fremde Home Verzeichnis fehlen!

alexa.service: main process exited, code=exited, status=217/USER

Versuch doch einfach das .alexa in /opt/fhem/.alexa anzulegen, dann klappt das. Siehe auch im Wiki!


LG
FHEM auf Raspy4 mit Bullseye + SSD, Homematic, ESP8266, ESP32, Sonoff, eBus, NanoCUL, MapleCUL, , MQTT2, Alexa

Byllyy

habe ich sofort ausprobiert und geändert.
leider bleibt der Fehler genau gleich.

Danke für deine Hilfe,
Byllyy

Reinhart

#3043
hast du /etc/default/alexa auch mit geändert?

ALEXA_OPTS=-U /opt/fhem/.alexa


und natürlich auch die alexa.service in /etc/systemd/system

LG
FHEM auf Raspy4 mit Bullseye + SSD, Homematic, ESP8266, ESP32, Sonoff, eBus, NanoCUL, MapleCUL, , MQTT2, Alexa

amenomade

@Reinhart: ich könnte mich nicht vorstellen, wie der User pi kein Zugriff auf /home/pi/.alexa, insb. wenn die Rechte so aussehen (siehe oben)
pi@raspberrypi:~ $ ls -laR /home/pi/.alexa
/home/pi/.alexa:
total 24
drwxr-xr-x 2 pi pi  4096 Aug 23 09:31 .
drwxr-xr-x 6 pi pi  4096 Sep  1 13:31 ..
-rw-r--r-- 1 pi pi   519 Aug 25 08:43 config.json
-rw-r--r-- 1 pi pi 12288 Aug 23 09:33 .config.json.swp


Und wenn man in alexa.service $ALEXA_OPTS nicht nutzt, dann braucht man nicht ALEXA_OPTS in /etc/default/alexa zu setzen. Siehe wiederum oben, was schon gemacht worden ist.

@Byllyy: kannst Du bitte wieder zeigen, wie dein config.json aussieht (Zugangsdaten anonymisieren), und wie die jetzige Version von alexa.service aussieht?
Und noch das journalctl wie oben geschrieben

Pi 3B, Alexa, CUL868+Selbstbau 1/2λ-Dipol-Antenne, USB Optolink / Vitotronic, Debmatic und HM / HmIP Komponenten, Rademacher Duofern Jalousien, Fritz!Dect Thermostaten, Proteus