[37_echodevice] Amazon Echo Modul (nicht Alexa)

Begonnen von michael.winkler, 12 Januar 2018, 18:20:12

Vorheriges Thema - Nächstes Thema

JudgeDredd

Zitat von: Hardy74 am 06 März 2026, 14:07:40Aber es klang so, als müßten die Dateien da bei jedem liegen!? Deswegen habe ich geschaut.
Du hattest doch geschrieben, das Du NPM an einer anderen Stelle installiert hast.
Was ist aus meinem Vorschlag mit dem Attribut geworden ?
Router: Eigenbau (pfSense)
FHEM: Proxmox (DELL R720) | Debian 12 (VM)

locodriver

Zitat von: JudgeDredd am 06 März 2026, 11:30:13
Zitat von: locodriver am 06 März 2026, 11:02:54Wo muss das Cookie abgelegt sein?
In /opt/fhem/cache/alexa-cookie müssten bei Dir 2 JavaScript Dateien sein.
Was liegen dort für Dateien ?

Sonst sehe ich gerade keinen Grund, warum das Modul die NPM Installation nicht findet

Bei mir sind in dem Ordner der Ordner "node_modules"und diese vier Dateien:

810create-cookie.js
810result.json
package.json
package-lock.json.

Also nur eine js-Datei. ::)

Der Besitzer ist immer fhem und die Rechte sind 0644.

Die Installation hatte ich mit beiden Methoden durchgeführt - jeweils mit dem gleichen Ergebnis.





fhem 6.0 auf Rpi3 Bookworm
HM-LAN-CFG (FW 0.965), HM-MOD-UART, 2x HM-TC-IT-WM-W-EU, 4x HM-Sec-RHS und 3x HM-CC-RT-DN, 6x HM-LC-Bl1-FM mit je 1x Somfy-Motor,
2x HM-LC-SW2-FM für Licht und Lüfter, 2x HM-PB-6-WM55, Alexa, Jeelinkcross, CUL, CUNO2, IR-Blaster

Hardy74

ZitatProbier mal das Attribut "fhem_home" aus. Ich weiß aber nicht, ob sich das NUR auf NPM bezieht.

Ich habe fhem-home auf /opt/alexa-cookie gesetzt. Es genau keinen Effekt, set NPM_login new führte zum selben Ergebnis: Modul alexa-cookie wird nicht gefunden.

Des Rätsels Lösung kam von der KI, das --no-bin-links:
sudo npm install --no-bin-links --prefix /opt/fhem/cache/alexa-cookie alexa-cookie2
Das Device funktioniert jetzt bei mir, alle Amazon Devices sind gefunden. Danke für die Hilfe!

JudgeDredd

@locodriver

wenn das alles so stimmt, was Du schreibst, dann sollte das passen.
Welche NodeJS/npm Version setzt Du ein ?

Vielleicht zeigst Du auch mal Dein alexa-cookie Verzeichnis.
Router: Eigenbau (pfSense)
FHEM: Proxmox (DELL R720) | Debian 12 (VM)

JudgeDredd

Zitat von: Hardy74 am 07 März 2026, 09:38:08Ich habe fhem-home auf /opt/alexa-cookie gesetzt. Es genau keinen Effekt
Lt. Modulcode musst Du es in /opt/cache/alexa-cookie installieren und danach das fhem_home auf /opt setzen

Aber wenn Du es mit dem Parameter gelöst hast, dann ist ja auch gut
Router: Eigenbau (pfSense)
FHEM: Proxmox (DELL R720) | Debian 12 (VM)

locodriver

#6395
Zitat von: JudgeDredd am 07 März 2026, 10:06:54@locodriver

wenn das alles so stimmt, was Du schreibst, dann sollte das passen.
Welche NodeJS/npm Version setzt Du ein ?

Vielleicht zeigst Du auch mal Dein alexa-cookie Verzeichnis.

Node ist : 18.20.4 und
npm ist: 9.2.0.

Anbei noch das Verzeichnis.


Interessant ist, dass immerhin alles das funzt, wenn Alexa nur mit "ok" antworten muss.
fhem 6.0 auf Rpi3 Bookworm
HM-LAN-CFG (FW 0.965), HM-MOD-UART, 2x HM-TC-IT-WM-W-EU, 4x HM-Sec-RHS und 3x HM-CC-RT-DN, 6x HM-LC-Bl1-FM mit je 1x Somfy-Motor,
2x HM-LC-SW2-FM für Licht und Lüfter, 2x HM-PB-6-WM55, Alexa, Jeelinkcross, CUL, CUNO2, IR-Blaster

JudgeDredd

Bei mir läuft zwar Node v20.20.1 aber für alexa-cookie2 sollte ja Node >=16 ausreichen.
und die alexa-cookie2 Sourcen sind auch tatsächlich vorhanden ? (node_modules/alexa-cookie2)
Router: Eigenbau (pfSense)
FHEM: Proxmox (DELL R720) | Debian 12 (VM)

locodriver

Zitat von: JudgeDredd am 08 März 2026, 13:06:06Bei mir läuft zwar Node v20.20.1 aber für alexa-cookie2 sollte ja Node >=16 ausreichen.
und die alexa-cookie2 Sourcen sind auch tatsächlich vorhanden ? (node_modules/alexa-cookie2)

Guten Morgen, ich hoffe, du meinst das hier:
fhem 6.0 auf Rpi3 Bookworm
HM-LAN-CFG (FW 0.965), HM-MOD-UART, 2x HM-TC-IT-WM-W-EU, 4x HM-Sec-RHS und 3x HM-CC-RT-DN, 6x HM-LC-Bl1-FM mit je 1x Somfy-Motor,
2x HM-LC-SW2-FM für Licht und Lüfter, 2x HM-PB-6-WM55, Alexa, Jeelinkcross, CUL, CUNO2, IR-Blaster

JudgeDredd

Also in diesem Verzeichnis fehlt definitiv die Datei "alexa-cookie.js".
Da muss bei der Installation etwas nicht geklappt haben.

Installiere das cookie Modul doch mal über sie shell, vielleicht bekommst Du da mehr Infos.
sudo npm install --prefix /opt/fhem/cache/alexa-cookie alexa-cookie2Dann schaust Du ob die Datei nun vorhanden ist und wenn ja, die Rechte noch anpassen
sudo chown -R fhem:  /opt/fhem/cache/alexa-cookieIm Anschluss sollte dann auch npm_login aus Fhem heraus funktionieren.
Router: Eigenbau (pfSense)
FHEM: Proxmox (DELL R720) | Debian 12 (VM)

locodriver

Die Datei taucht leider nicht auf. Die Ausgabe auf der Konsole sieht nach Befehlsausführung so aus:

pi@raspberrypi:~ $ sudo npm install --prefix /opt/fhem/cache/alexa-cookie alexa-cookie2

up to date, audited 103 packages in 7s

18 packages are looking for funding
  run `npm fund` for details

2 low severity vulnerabilities

To address all issues (including breaking changes), run:
  npm audit fix --force

Run `npm audit` for details.

Das Verzeichnis hat sich nicht verändert und die Änderungszeit der Ordner und Dateien ist weiterhin am 5.3.

npm fund gibt folgendes:

pi@raspberrypi:/opt/fhem/cache/alexa-cookie $ npm fund
alexa-cookie
├─┬ https://opencollective.com/express
│ │ └── express@4.22.1, http-errors@2.0.1
│ ├── https://github.com/sponsors/sindresorhus
│ │   └── merge-descriptors@1.0.3, is-plain-obj@3.0.0
│ ├── https://github.com/sponsors/ljharb
│ │   └── qs@6.14.2, side-channel@1.1.0, object-inspect@1.13.4, side-channel-list@1.0.0, side-channel-map@1.0.1, call-bound@1.0.4, function-bind@1.1.2, get-intrinsic@1.3.0, gopd@1.2.0, has-symbols@1.1.0, side-channel-weakmap@1.0.2
│ └── https://github.com/sponsors/feross
│     └── safe-buffer@5.2.1
├── https://github.com/sponsors/RubenVerborgh
│   └── follow-redirects@1.15.11
└── https://github.com/sponsors/jonschlinkert
    └── picomatch@2.3.1

sudo npm audit fix --force gibt das:

pi@raspberrypi:/opt/fhem/cache/alexa-cookie $ sudo npm audit fix --force
npm WARN using --force Recommended protections disabled.
npm WARN audit Updating alexa-cookie2 to 1.0.3, which is a SemVer major change.
npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated source-map-url@0.4.1: See https://github.com/lydell/source-map-url#deprecated
npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated source-map-resolve@0.5.3: See https://github.com/lydell/source-map-resolve#deprecated

added 96 packages, removed 6 packages, changed 7 packages, and audited 193 packages in 35s

17 packages are looking for funding
  run `npm fund` for details

# npm audit report

braces  <3.0.3
Severity: high
Uncontrolled resource consumption in braces - https://github.com/advisories/GHSA-grv7-fg5c-xmjg
fix available via `npm audit fix --force`
Will install alexa-cookie2@5.0.3, which is a breaking change
node_modules/braces
  micromatch  <=4.0.7
  Depends on vulnerable versions of braces
  node_modules/micromatch
    http-proxy-middleware  <=2.0.7-beta.1
    Depends on vulnerable versions of micromatch
    node_modules/http-proxy-middleware
      alexa-cookie2  <=3.4.3
      Depends on vulnerable versions of http-proxy-middleware
      node_modules/alexa-cookie2



4 high severity vulnerabilities

To address all issues (including breaking changes), run:
  npm audit fix --force
pi@raspberrypi:/opt/fhem/cache/alexa-cookie $

und beim 2. Mal:

pi@raspberrypi:/opt/fhem/cache/alexa-cookie $ sudo npm audit fix --force
npm WARN using --force Recommended protections disabled.
npm WARN audit Updating alexa-cookie2 to 5.0.3, which is a SemVer major change.

added 6 packages, removed 96 packages, changed 7 packages, and audited 103 packages in 17s

18 packages are looking for funding
  run `npm fund` for details

# npm audit report

cookie  <0.7.0
cookie accepts cookie name, path, and domain with out of bounds characters - https://github.com/advisories/GHSA-pxg6-pf52-xh8x
fix available via `npm audit fix --force`
Will install alexa-cookie2@1.0.3, which is a breaking change
node_modules/cookie
  alexa-cookie2  >=2.0.0
  Depends on vulnerable versions of cookie
  node_modules/alexa-cookie2

2 low severity vulnerabilities

To address all issues (including breaking changes), run:
  npm audit fix --force

Jetzt ist die "alexa-cookie.js" vorhanden.
Die Rechte habe ich auch angepasst.

Ein NPM login new bricht mit

Es ist ein Fehler aufgetreten!! Bitte das FHEM Log pruefen.

ab.
Im alexa log steht:

[10.3.2026, 10:44:11] refreshing token
[10.3.2026, 10:44:12] failed to refresh token: Error: connect ECONNREFUSED 2a01:4f8:221:1b5a::f2:443

und im fhem log nichts.

BTW: wie komme ich auf eine "höhere" Nodeversion? Mt dem normalen Update bleibt es bei Version 18.20.4.
fhem 6.0 auf Rpi3 Bookworm
HM-LAN-CFG (FW 0.965), HM-MOD-UART, 2x HM-TC-IT-WM-W-EU, 4x HM-Sec-RHS und 3x HM-CC-RT-DN, 6x HM-LC-Bl1-FM mit je 1x Somfy-Motor,
2x HM-LC-SW2-FM für Licht und Lüfter, 2x HM-PB-6-WM55, Alexa, Jeelinkcross, CUL, CUNO2, IR-Blaster

JudgeDredd

Du hast in Deinem Device ja die "npm_proxy" Attribute gesetzt, läuft FHEM bei Dir im Docker o.Ä. ?
Zitat von: locodriver am 10 März 2026, 10:48:07BTW: wie komme ich auf eine "höhere" Nodeversion? Mt dem normalen Update bleibt es bei Version 18.20.4.
Falls Du unbedingt ein Update willst, musst Du dazu die Paketquelle in apt anpassen.
NodeJS hat für jedes Major-Release ein eigenes Repository.
Router: Eigenbau (pfSense)
FHEM: Proxmox (DELL R720) | Debian 12 (VM)