Coder Social home page Coder Social logo

fhem / alexa-fhem-docker Goto Github PK

View Code? Open in Web Editor NEW
6.0 3.0 4.0 225 KB

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

Home Page: https://fhem.de/

License: MIT License

Dockerfile 27.82% Shell 72.18%
fhem fhem-docker docker-fhem alexa-fhem fhem-alexa alexa home-automation home-automation-system

alexa-fhem-docker's Introduction

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 20

  • Alexa-Fhem 0.5.64

      docker pull ghcr.io/fhem/alexa-fhem:5.0.11
    

To start your container right away:

docker run -d --name alexa-fhem ghcr.io/fhem/alexa-fhem:5.0.11

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:

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

Verify if container is runnung

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

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:

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

docker pull ghcr.io/fhem/alexa-fhem:5 docker pull ghcr.io/fhem/alexa-fhem:5.0.11

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):

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

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

      -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.

version: '2.3'

networks:
  fhem_net:
    driver: bridge
    ipam:
      driver: default
      config:
        - subnet: 172.27.0.0/28
          gateway: 172.27.0.1
        - subnet: fd00:0:0:0:27::/80
          gateway: fd00:0:0:0:27::1


services:
  # Minimum example w/o any custom environment variables of fhem container
  fhem:
    image: ghcr.io/fhem/fhem-docker:3-bullseye
    restart: always
    networks:
      - fhem_net
    ports:
      - "8083:8083"
    volumes:
      - "./fhem/:/opt/fhem/"

 # Minimum example w/o any custom environment variables of alexa-fhem container
 alexa-fhem:
    image: ghcr.io/fhem/alexa-fhem:5.0.11
    restart: always
    networks:
     - fhem_net
    volumes:
      - "./alexa-fhem/:/alexa-fhem/"
    environment:
      ALEXAFHEM_UID: 6062
      ALEXAFHEM_GID: 6062
      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:

"connections": [
    {
      "name": "FHEM",
      "webname": "fhem",
      "filter": "alexaName=..*",
      "uid": "6062",
      "port": "8083",
      "server": "fhem"
    }
  ]

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.

define alexa alexa
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

alexa-fhem-docker's People

Contributors

actions-user avatar cooltuxnet avatar dependabot[bot] avatar f-zappa avatar jpawlowski avatar pantastisch avatar renovate[bot] avatar sidey79 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

alexa-fhem-docker's Issues

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

This repository currently has no open or pending branches.

Detected dependencies

docker-compose
docker-compose.yml
  • ghcr.io/fhem/alexa-fhem 5
dockerfile
Dockerfile
  • node 20.14.0-bullseye-slim
github-actions
.github/actions/integrationtest/action.yml
  • docker/setup-buildx-action v3
  • docker/metadata-action v5
  • docker/build-push-action v5
.github/workflows/build.yml
  • actions/checkout v4
  • actions/checkout v4
  • docker/setup-buildx-action v3
  • docker/setup-qemu-action v3.0.0
  • docker/login-action v3.2.0
  • docker/login-action v3.2.0
  • docker/metadata-action v5.5.1
  • docker/build-push-action v5.3.0
  • sigstore/cosign-installer v3.5.0
  • CasperWA/push-protected v2
npm
src/package.json
  • alexa-fhem ^0.5.64

  • Check this box to trigger a request for Renovate to run again on this repository

Bullseye als baseimage

Hallo
Danke für die images!

Könnte man ein Image auf der Basis von bullseye bereitstellen?

add depends_on to docker-compose.yml example

I noticed that fhem is often slower than alexa-fhem, which leads to errors in the log, adding depends_on to the alexa-fhem part in the compose would mitigate this:

version: '2.3'

networks:
  fhem_net:
    driver: bridge
    ipam:
      driver: default
      config:
        - subnet: 172.27.0.0/28
          gateway: 172.27.0.1
        - subnet: fd00:0:0:0:27::/80
          gateway: fd00:0:0:0:27::1


services:
  # Minimum example w/o any custom environment variables of fhem container
  fhem:
    image: ghcr.io/fhem/fhem/fhem-docker:bullseye
    restart: always
    networks:
      - fhem_net
    ports:
      - "8083:8083"
    volumes:
      - "./fhem/:/opt/fhem/"

 # Minimum example w/o any custom environment variables of alexa-fhem container
 alexa-fhem:
    image: ghcr.io/fhem/fhem/alexa-fhem:v4.0.3
    restart: always
    depends_on: # <--- wait for fhem to start and return a good healthcheck
      - fhem
    networks:
     - fhem_net
    ports:
      - "3000:3000"
    volumes:
      - "./alexa-fhem/:/alexa-fhem/"
    environment:
      ALEXAFHEM_UID: 6062
      ALEXAFHEM_GID: 6062
      TZ: Europe/Berlin

Example for alexa definition

I haven't found any examples how to configure the Alexa definition inside Fhem to work with this container.

Can you provide some?
I think i need the alexa module to get the needed registration key.

sshautoconf error during container startup (home dir. permission error)

Hello all,

when I try to spin up a container using the image fhem/alexa-fhem:latest or dev (08th Spet. 2019) with a configuration section for proxy connection (i.e. to use FhemConnector Alexa Skill) I get the following error in the docker log:

`...[9/8/2019, 1:50:36 PM] sshautoconf: *** Error: Your Homedirectory is writable by group/other. This will not work with SSH

[9/8/2019, 1:50:36 PM] sshautoconf: aborted with user homedir writable by group/other ('chmod 755 /alexa-fhem' required)

[9/8/2019, 1:50:36 PM] *** SSH: proxy configuration failed: user homedir writable by group/other ('chmod 755 /alexa-fhem' required)...`

From what I can see, the FHEM instance in another container is successfully connected and some devices are found, however the proxy configuration fails.

Does anyone else experience this problem?

Thank you for your help!

Regards Sascha

For reference my config.json:

`{ "sshproxy" : {

  "description" : "FHEM Connector",

  "ssh" : "/usr/bin/ssh"

},

"connections": [

{

  "name": "FHEM",

  "filter": "alexaName=..*",

  "port": "******",

  "server": "*******",

  "auth": {"**********"}

}

]

}`

Support of custom skill

Recently i tried to move away from local installation towards docker deployment. Everything worked fine despite the connection to my custom skill like reported here.

The question is if custom skill is supported? Theoretically it should while its just another section in the config.json. But it might
doesn't connect to the fhemIntents attribute over at fhem where the custom skill functions are listed.

Errors are:
ERROR: InvalidAccessTokenError from ::ffff:34.245.84.101
and
clientID amzn1.application-oa2-client.xxxxxxxxxxxxxxxxxxxxxxxxxxx not authorized

Any suggestion?
Cheers,
Sebastian

Option for an environment variable to listen on different ip

Hello,

while integrating this service, I see following error in my log:

[5/3/2019, 10:27:44 PM] [FHEM] trying longpoll to listen for fhem events
[5/3/2019, 10:27:44 PM] [FHEM] starting longpoll: http://fhem:8083/fhem?XHR=1&inform=type=status;addglobal=1;filter=.*;since=null;fmt=JSON&timestamp=1556915264419
[5/3/2019, 10:27:44 PM] [FHEM] longpoll error: Error: getaddrinfo ENOTFOUND fhem fhem:8083, retry in: 30000msec
*** FHEM: connection failed: Error: getaddrinfo ENOTFOUND fhem fhem:8083

Due to my fhem is not reacheable at http://fhem:8083 this error is occuring.

An environment option for setting the FHEM server and maybe its port would be a nice feature.

User/password fhem webgui

Can you please add an Option to define user/password for webgui in config.json?

"connections": [
{
"name": "FHEM",
"webname": "fhem",
"filter": "alexaName=..*",
"uid": "6062",
"port": "8083",
"server": "fhem",
"auth": {"user": "fhemuser", "pass": "fhempass"}
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.