项目作者: fhem

项目描述 :
A FHEM complementary Docker image for Amazon alexa voice assistant, based on Debian Stretch.
高级语言: Shell
项目地址: git://github.com/fhem/alexa-fhem-docker.git
创建时间: 2019-01-05T11:43:53Z
项目社区:https://github.com/fhem/alexa-fhem-docker

开源协议:MIT License

下载


Docker image for alexa-fhem

A FHEM complementary Docker image for Amazon alexa voice assistant, based on

Installation

Pre-build images are available on Docker Hub and on Github Container Registry.

From Github container registry

Updated version, only with Version tags

  • NodeJS 22
  • Alexa-Fhem 0.5.65

    1. docker pull ghcr.io/fhem/alexa-fhem:5.1.0-beta5

To start your container right away:

docker run -d —name alexa-fhem ghcr.io/fhem/alexa-fhem:5.1.0-beta5

Permanent storage

Usually you want to keep your FHEM setup after a container was destroyed (or re-build) so it is a good idea to provide an external directory on your Docker host to keep that data:

  1. docker run -d --name alexa-fhem -v /some/host/directory:/alexa-fhem ghcr.io/fhem/alexa-fhem:5.1.0-beta5

Verify if container is runnung

After starting your container, you may check the web server availability:

  1. http://xxx.xxx.xxx.xxx:3000/

You may want to have a look to the alexa-fhem documentation or FHEM Connector documentation for further information.

Image flavors

This image provides different variants:

  • latest (default, can introduce breaking changes)
  • 2.0.7 ( latest released Version. Can be a prerelease version)
  • 5 ( latest stable release in Major v5)
  • dev (development tag, not updated anymore)

You can use one of those variants by adding them to the docker image name like this:

  1. docker pull ghcr.io/fhem/alexa-fhem:latest

docker pull ghcr.io/fhem/alexa-fhem:5
docker pull ghcr.io/fhem/alexa-fhem:5.1.0-beta5

If you do not specify any variant, latest will always be the default.

Supported platforms

This is a multi-platform image, providing support for the following platforms:

Linux:

  • x86-64/AMD64
  • ARM32v7, armhf
  • ARM64v8, arm64

Windows:

  • currently not supported

The main repository will allow you to install on any of these platforms.
In case you would like to specifically choose your platform, go to the platform-related section in the container repository.

The platform repositories will also allow you to choose more specific build tags beside the rolling tags latest or dev.

Customize your container configuration

Tweak container settings using environment variables

  • Change alexa-fhem system user ID:
    To set a different UID for the user ‘fhem’ (default is 6062):

    1. -e ALEXAFHEM_UID=6062
  • Change FHEM group ID:
    To set a different GID for the group ‘fhem’ (default is 6062):

    1. -e ALEXAFHEM_GID=6062
  • Set timezone:
    Set a specific timezone in POSIX format:

    1. -e TZ=Europe/Berlin

Use docker-compose.yaml

No problem at all. To connect alexa-fhem to your alexa container, you need a common network.
Named it fhem_net. You should connect your fhem container to the same network to support communication via alexa-fhem and fhem itself.

  1. version: '2.3'
  2. networks:
  3. fhem_net:
  4. driver: bridge
  5. ipam:
  6. driver: default
  7. config:
  8. - subnet: 172.27.0.0/28
  9. gateway: 172.27.0.1
  10. - subnet: fd00:0:0:0:27::/80
  11. gateway: fd00:0:0:0:27::1
  12. services:
  13. # Minimum example w/o any custom environment variables of fhem container
  14. fhem:
  15. image: ghcr.io/fhem/fhem-docker:3-bullseye
  16. restart: always
  17. networks:
  18. - fhem_net
  19. ports:
  20. - "8083:8083"
  21. volumes:
  22. - "./fhem/:/opt/fhem/"
  23. # Minimum example w/o any custom environment variables of alexa-fhem container
  24. alexa-fhem:
  25. image: ghcr.io/fhem/alexa-fhem:5.1.0-beta5
  26. restart: always
  27. networks:
  28. - fhem_net
  29. volumes:
  30. - "./alexa-fhem/:/alexa-fhem/"
  31. environment:
  32. ALEXAFHEM_UID: 6062
  33. ALEXAFHEM_GID: 6062
  34. TZ: Europe/Berlin

If you use another name for your fhem container fhem, or want to use another tcp port for fhemweb connections, then you have to change the alexa-fhem config file in the volume for your alea-fhem container ./alexa-fhem/alexa-fhem.json.

In the connections part, servername and port must match withhin fhem configuration:

  1. "connections": [
  2. {
  3. "name": "FHEM",
  4. "webname": "fhem",
  5. "filter": "alexaName=..*",
  6. "uid": "6062",
  7. "port": "8083",
  8. "server": "fhem"
  9. }
  10. ]

Within FHEM, you have to specify a alexa device and add attribute to identify the host. In this example, the container name is alexa-fhem, so this is also the hostname.

  1. define alexa alexa
  2. attr alexa alexaFHEM-host alexa-fhem

SSH and other attributes are not needed for running in a docker environment


Production Build and Test

Development Build and Test