Moin, habe mich auch versucht meine aktuelle FHEM Installation in einen Docker-Container zu ziehen.
Das hat bisher sehr gut funktioniert. Im Moment hänge ich bei alexa-fhem fest.
Erster Versuch war es das Package per npm im Container zu installieren. Grundsätzlich ging das.
Das ganze per Environment-Variable automatisch zu installieren hat dann aber nicht mehr funktioniert.
Also bin ich über den Hinweis hier im Thread auf den alexa-fhem Container übergegangen.
Leider funktioniert das bei mir bisher nicht so ohne Probleme. Wäre dankbar für Hinweise wo das Problem steckt.
--------------------------------------------------------------------------------------------------
Alternativ die Frage, warum ich "alexa-fhem" nicht per environment in docker-compose mit NPM_PKGS="alexa-fhem" installiert bekomme?
Zumindest quittiert das Device nach einem Recreate des Containers mit "alexa-fhem not installed. install with 'sudo npm install -g alexa-fhem'".
EDIT: Die Option über die Umgebungsvariable NPM_PKGS funktioniert mittlerweile. Von daher hätte ich eine funktionierende Option.
Aber grundsätzlich habe ich eigentlich Interesse daran alexa-fhem in einem eigenen Container laufen zu lassen.
--------------------------------------------------------------------------------------------------
Aktueller Stand. Hier ein Define und List vom Device:
define Alexa alexa
attr Alexa alexaFHEM-config ./alexa-fhem.cfg
attr Alexa alexaFHEM-host alexa-fhem [ALTERNATIV die ip, gleicher Fehler]
attr Alexa alexaFHEM-log %L/alexa-%Y-%m-%d.log
attr Alexa alexaMapping #Characteristic=<name>=<value>,...\
attr Alexa alexaTypes #Type=<alias>[,<alias2>[,...]]\
attr Alexa devStateIcon stopped:control_home@red:start stopping:control_on_off@orange running.*:control_on_off@green:stop
attr Alexa echoRooms #<deviceId>=<room>\
attr Alexa fhemIntents #IntentName=<sample utterance>\
attr Alexa persons #<personId>=<name>\
attr Alexa stateFormat alexaFHEM
Internals:
FUUID 627e2c34-aaaa-bbbb-0cc6-f4b4e506e5205769
FVERSION 39_alexa.pm:0.238200/2021-02-24
LAST_START 2022-05-13 13:29:46
LAST_STOP 2022-05-13 13:29:46
NAME Alexa
NOTIFYDEV global,global:npmjs.*alexa-fhem.*
NR 311
NTFY_ORDER 50-Alexa
PARTIAL
STARTS 2
STATE stopped
TYPE alexa
active 0
alexa-fhem version 0.5.61
logfile %L/alexa-%Y-%m-%d.log
CoProcess:
cmdFn alexa_getCMD
name alexaFHEM
state stopped
READINGS:
2022-05-13 13:29:46 alexaFHEM stopped
2022-05-13 12:00:20 alexaFHEM.bearerToken crypt:7b7374....01070d5556
2022-05-13 12:00:20 alexaFHEM.skillRegKey crypt:7a0370240f0e205e1....57708737650780d555f0653
helper:
Attributes:
alexaFHEM-config ./alexa-fhem.cfg
alexaFHEM-host 172.29.0.2
alexaFHEM-log %L/alexa-%Y-%m-%d.log
Hier der Ausschnit des FHEM-Logfiles:
2022.05.13 12:39:39.019 3: Alexa: using ssh cmd /usr/bin/ssh 172.29.0.2
ssh: connect to host 172.29.0.2 port 22: Connection refused
ssh: connect to host 172.29.0.2 port 22: Connection refused
2022.05.13 12:39:39.073 2: Alexa: starting alexa-fhem: /usr/bin/ssh 172.29.0.2 -c /tmp/alexa-fhem.cfg
2022.05.13 12:39:39.080 3: Alexa: starting
2022.05.13 12:39:39.090 3: Alexa: using logfile: /opt/fhem/log/alexa-2022-05-13.log
2022.05.13 12:39:39.108 3: Alexa: read: end of file reached while sysread
2022.05.13 12:39:39.109 3: Alexa: stopped
Und hier das Alexa-Logfile. Den Fehler mit dem Cipher findet man 1-2 mal hier im Thread/Forum aber leider keine für mich ersichtliche Lösung.
(Die ganzen Devices habe ich mal weggelassen)
[13/05/2022, 11.06.24] using config from ./alexa-fhem.cfg
*** CONFIG: parsed completely
[13/05/2022, 11.06.24] os.homedir()=/opt/fhem
[13/05/2022, 11.06.24] this is alexa-fhem 0.5.62
[13/05/2022, 11.06.24] connecting to FHEM ...
[13/05/2022, 11.06.24] [FHEM] defaults to: will not send proactive events
[13/05/2022, 11.06.24] [FHEM] trying longpoll to listen for fhem events
[13/05/2022, 11.06.24] [FHEM] starting longpoll: http://127.0.0.1:8083/fhem?XHR=1&inform=type=status;addglobal=1;filter=.*;since=null;fmt=JSON×tamp=1652432784525
[13/05/2022, 11.06.24] [FHEM] got csrfToken: qBZXcla2WrxRAYM5Gf
[13/05/2022, 11.06.24] [FHEM] Checking devices and attributes...
[13/05/2022, 11.06.24] [FHEM] executing: http://127.0.0.1:8083/fhem?cmd=%7BAttrVal(%22global%22%2C%22userattr%22%2C%22%22)%7D&fwcsrf=qBZXcla2WrxRAYM5Gf&XHR=1
[13/05/2022, 11.06.24] [FHEM] executing: http://127.0.0.1:8083/fhem?cmd=jsonlist2%20TYPE%3Dalexa&fwcsrf=qBZXcla2WrxRAYM5Gf&XHR=1
[13/05/2022, 11.06.24] [FHEM] waiting for events ...
[13/05/2022, 11.06.24] [FHEM] Fetching FHEM devices...
[13/05/2022, 11.06.24] [FHEM] fetching: http://127.0.0.1:8083/fhem?cmd=jsonlist2%20alexaName%3D..*&fwcsrf=qBZXcla2WrxRAYM5Gf&XHR=1
[13/05/2022, 11.06.24] [FHEM] alexa device is Alexa
[13/05/2022, 11.06.24] [FHEM] mappings for Alexa: {}
[13/05/2022, 11.06.24] [FHEM] Alexa will not send proactive events
[13/05/2022, 11.06.24] [FHEM] Alexa uses ID: 62769401-f33f-xxxx-xxxx-bcebc6b5f872947c
[13/05/2022, 11.06.24] Server listening on: http://127.0.0.1:41595 for proxy connections
[13/05/2022, 11.06.24] *** SSH: checking proxy configuration
[13/05/2022, 11.06.24] sshautoconf: home=/opt/fhem, spath=/opt/fhem/.alexa, cpath=./alexa-fhem.cfg, sshpath=/opt/fhem/.ssh
[13/05/2022, 11.06.24] Passed config: {
sshproxy: {
description: 'FHEM Connector',
ssh: '/usr/bin/ssh',
options: [ '-i', '/opt/fhem/.ssh/id_rsa', '-p', 58824, 'fhem-va.fhem.de' ],
'bind-ip': '127.0.0.1',
server: Server {
maxHeaderSize: undefined,
insecureHTTPParser: undefined,
_events: [Object: null prototype],
_eventsCount: 3,
_maxListeners: undefined,
_connections: 0,
_handle: [TCP],
_usingWorkers: false,
_workers: [],
_unref: false,
allowHalfOpen: true,
pauseOnConnect: false,
httpAllowHalfOpen: false,
timeout: 0,
keepAliveTimeout: 5000,
maxHeadersCount: null,
headersTimeout: 60000,
requestTimeout: 0,
_connectionKey: '4:127.0.0.1:0',
[Symbol(IncomingMessage)]: [Function: IncomingMessage],
[Symbol(ServerResponse)]: [Function: ServerResponse],
[Symbol(kCapture)]: false,
[Symbol(async_id_symbol)]: 90
}
},
connections: [
{
port: 8083,
server: '127.0.0.1',
filter: 'alexaName=..*',
webname: 'fhem',
uid: 6061,
name: 'FHEM'
}
]
}
[13/05/2022, 11.06.24] sshautoconf: SSH key seems to exist
[13/05/2022, 11.06.25] sshautoconf: Our SSH key is known at the reverse proxy, good!
[13/05/2022, 11.06.25] [FHEM] executing: http://127.0.0.1:8083/fhem?cmd=%7B%24defs%7B%22Alexa%22%7D-%3E%7B%22active%22%7D%20%3D%201%3B%3Bundef%7D%3Bjsonlist2%20Alexa%3B%7B%24defs%7B%22Alexa%22%7D-%3E%7B%22active%22%7D%20%3D%200%3B%3Bundef%7D&fwcsrf=qBZXcla2WrxRAYM5Gf&XHR=1
[13/05/2022, 11.06.25] BearerToken '...44977' read from Alexa
[13/05/2022, 11.06.25] 39_alexa.pm is new version: true
[13/05/2022, 11.06.25] sshautoconf: completed successfully
[13/05/2022, 11.06.25] *** SSH: proxy configuration set up done
[13/05/2022, 11.06.25] Reading alexaFHEM.ProxyConnection set to starting;; starting SSH
[13/05/2022, 11.06.25] [FHEM] executing: http://127.0.0.1:8083/fhem?cmd=%7B%24defs%7B%22Alexa%22%7D-%3E%7B%22active%22%7D%20%3D%201%3B%3Bundef%7D%3Bsetreading%20Alexa%20alexaFHEM.ProxyConnection%20starting%3B%3B%20starting%20SSH%3B%7B%24defs%7B%22Alexa%22%7D-%3E%7B%22active%22%7D%20%3D%200%3B%3Bundef%7D&fwcsrf=qBZXcla2WrxRAYM5Gf&XHR=1
[13/05/2022, 11.06.25] Starting SSH with -R 1234:127.0.0.1:41595 -oServerAliveInterval=90 -i /opt/fhem/.ssh/id_rsa -p 58824 fhem-va.fhem.de
*** FHEM: connected
[13/05/2022, 11.06.25] [FHEM] got: 26 results
[13/05/2022, 11.06.25] [FHEM] Structure.Tischlampen is scene
[13/05/2022, 11.06.25] [FHEM] Structure.Tischlampen has
[13/05/2022, 11.06.25] [FHEM] On [state;on,off]
[13/05/2022, 11.06.25] [FHEM] Structure.Tischlampen will not send proactive events
[13/05/2022, 11.06.25] [FHEM] Structure.Tischlampen uses ID: 6278ac15-f33f-f519-a25c-169ff81c57986934
2022-05-13 11:06:25 caching: Structure.Tischlampen-state: off
[13/05/2022, 11.06.26] Reading alexaFHEM.ProxyConnection set to running;; SSH connected
[13/05/2022, 11.06.26] [FHEM] executing: http://127.0.0.1:8083/fhem?cmd=%7B%24defs%7B%22Alexa%22%7D-%3E%7B%22active%22%7D%20%3D%201%3B%3Bundef%7D%3Bsetreading%20Alexa%20alexaFHEM.ProxyConnection%20running%3B%3B%20SSH%20connected%3B%7B%24defs%7B%22Alexa%22%7D-%3E%7B%22active%22%7D%20%3D%200%3B%3Bundef%7D&fwcsrf=qBZXcla2WrxRAYM5Gf&XHR=1
[13/05/2022, 11.06.26] *** SSH: proxy connection established
[13/05/2022, 11.06.26] SSH: Welcome at the reverse proxy! This pseudoshell does not react to any input - do not get irritated.
Unknown cipher type '/tmp/alexa-fhem.cfg'