Installationsfehler FHEM Connector

Begonnen von Apollon, 23 April 2019, 11:50:16

Vorheriges Thema - Nächstes Thema

Apollon

Hallo,

ich habe mir einen Echo Dot 3 zugelegt, um damit FHEM zu steuern.
Zur Installation habe ich mich an folgende Anleitung gehalten: https://wiki.fhem.de/wiki/FHEM_Connector_f%C3%BCr_Amazon_Alexa

Leider scheitert die Installation nach dem define von alexa. Hier erhalte ich nur diese Fehlermeldung: stopped; failed to connect to fhem: 401: Authorization Required
Liegt es ggf. daran, dass die Berechtigungen der Datei /usr/local/bin/alexa-fhem auf Gruppe:staff Eigentümer: root  stehen?

In den Logs steht folgendes:
2019.04.23 11:25:26 2: Alexa: created default configfile: ./alexa-fhem.cfg
2019.04.23 11:25:26 2: Alexa: starting alexa-fhem: /usr/local/bin/alexa-fhem -c ./alexa-fhem.cfg
2019.04.23 11:25:26 3: Alexa: starting
2019.04.23 11:25:26 3: Alexa: using logfile: ./log/alexa-2019-04-23.log
2019.04.23 11:25:30 3: Alexa: read: end of file reached while sysread
2019.04.23 11:25:30 3: Alexa: stopped


[23.4.2019, 11:25:29] using config from ./alexa-fhem.cfg
*** CONFIG: parsed completely
[23.4.2019, 11:25:29] os.homedir()=/opt/fhem
[23.4.2019, 11:25:29] this is alexa-fhem 0.5.26
[23.4.2019, 11:25:29] connecting to FHEM ...
[23.4.2019, 11:25:30] [FHEM] trying longpoll to listen for fhem events
[23.4.2019, 11:25:30] [FHEM] starting longpoll: http://127.0.0.1:8083/fhem?XHR=1&inform=type=status;addglobal=1;filter=.*;since=null;fmt=JSON&timestamp=1556011530050
[23.4.2019, 11:25:30] [FHEM] got csrfToken:
[23.4.2019, 11:25:30] [FHEM] Checking devices and attributes...
[23.4.2019, 11:25:30] [FHEM]   executing: http://127.0.0.1:8083/fhem?cmd=%7BAttrVal(%22global%22%2C%22userattr%22%2C%22%22)%7D&XHR=1
[23.4.2019, 11:25:30] [FHEM]   executing: http://127.0.0.1:8083/fhem?cmd=jsonlist2%20TYPE%3Dalexa&XHR=1
[23.4.2019, 11:25:30] [FHEM] waiting for events ...
[23.4.2019, 11:25:30] [FHEM] Fetching FHEM devices...
[23.4.2019, 11:25:30] [FHEM] fetching: http://127.0.0.1:8083/fhem?cmd=jsonlist2%20alexaName=..*&XHR=1
[23.4.2019, 11:25:30] [FHEM] longpoll ended, reconnect in: 200msec
[23.4.2019, 11:25:30] [FHEM] There was a problem connecting to FHEM (http://127.0.0.1:8083/fhem?cmd=%7BAttrVal(%22global%22%2C%22userattr%22%2C%22%22)%7D&XHR=1).
[23.4.2019, 11:25:30] [FHEM]   401: Authorization Required
[23.4.2019, 11:25:30] [FHEM] There was a problem connecting to FHEM
[23.4.2019, 11:25:30] [FHEM]   401: Authorization Required
*** FHEM: connection failed: 401: Authorization Required
[23.4.2019, 11:25:30] [FHEM] There was a problem connecting to FHEM (http://127.0.0.1:8083/fhem?cmd=jsonlist2%20TYPE%3Dalexa&XHR=1).
[23.4.2019, 11:25:30] [FHEM]   401: Authorization Required
[23.4.2019, 11:25:30] Got SIGTERM, shutting down alexa-fhem...
[23.4.2019, 11:25:30] Reading alexaFHEM.ProxyConnection set to stopping;; alexa-fhem terminating


Ich bitte um Hilfe.

Gruß
Apollon

justme1968

hue, tradfri, alexa-fhem, homebridge-fhem, LightScene, readingsGroup, ...

https://github.com/sponsors/justme-1968

MadMax-FHEM

Zitat von: Apollon am 23 April 2019, 11:50:16
Liegt es ggf. daran, dass die Berechtigungen der Datei /usr/local/bin/alexa-fhem auf Gruppe:staff Eigentümer: root  stehen?

Nein.



Zitat von: Apollon am 23 April 2019, 11:50:16
failed to connect to fhem: 401: Authorization Required

Steht doch da was das Problem zu sein scheint...

Hast du ein allowed-Device mit User/Passwort für FHEM-Web erstellt?
Also kurz: User/Passwort Zugang für fhem "aktiviert"!?

Dann das entsprechend setzen: alexaFHEM-auth

EDIT: langsamer und ausführlich(er) aber zumindest gleiche(r) Lösung(svorschlag) ;)

Gruß, Joachim
FHEM PI3B+ Bullseye: HM-CFG-USB, 40x HM, ZWave-USB, 13x ZWave, EnOcean-PI, 15x EnOcean, HUE/deCONZ, CO2, ESP-Multisensor, Shelly, alexa-fhem, ...
FHEM PI2 Buster: HM-CFG-USB, 25x HM, ZWave-USB, 4x ZWave, EnOcean-PI, 3x EnOcean, Shelly, ha-bridge, ...
FHEM PI3 Buster (Test)

Apollon

#3
Vielen Dank für die schnellen Antworten. Nach Setzen von user und PWD läuft das alexa-device.

Edit: Ich hätte in der Anleitung nur weiter lesen müssen, dann wäre ich auch auf alexaFHEM-auth gestoßen. Da ich aber vorher schon einen Fehler hatte, habe ich auch nicht weiter gelesen.