Echo Speaks Local Cookie Authorization Server

If you use the Echo Speaks smart application in Hubitat Elevation to drive your Alexa devices for customized speech, be aware that the Heroku cloud application server will begin charging per month for their service on November 28th. Echo Speaks uses a Heroku routine in order to maintain a valid login cookie to the Alexa service.

Tony Fleisher, the author of Echo Speaks has developed a local Echo Speaks authorization server that removes this need for Heroku and runs on your local network.

There are two ways to install this local authorization server. Both methods require a Linux server that can be a Raspberry Pi, a Virtual Machine, or a LXC/LXD container.

The first way to install the container is in Docker.

To install Docker and docker-compose, if it is not installed:

curl -sSL https://get.docker.com | sh
sudo apt install docker-compose

Then, download and unzip the project:

sudo apt install unzip
wget https://github.com/TonyFleisher/echo-speaks-server/archive/refs/heads/docker-enablement.zip
unzip docker-enablement.zip

Move into the docker folder for the project:

cd echo-speaks-server-docker-enablement/docker

Become the root user:

sudo su

Execute the command to build the container.

docker-compose build

To start the project, find out the address of your docker host:

ip a

Start the Echo speaks server using the address of your docker server from above (my address is 172.16.1.78):

IPADDRESS=172.16.1.78 ./start.sh

The startup operation should look like this:
image

Test to see if it is running, visit the Web page (with your address at port 8091)
In my case: http://172.16.1.78:8091

image

Go back to the Echo-speaks app in the Hubitat and clear your server setup. Then initiate the setup being sure to turn off the “Deploy to Heroku” switch. That’s it!

ALTERNATE INSTALLATION OF ECHO SPEAKS AUTHORIZATION SERVER WITHOUT DOCKER

On your target server, install the dependencies:

sudo apt install nodejs
sudo apt install npm

Now get and install the Echo Speaks Server application.

npm i https://github.com/tonesto7/echo-speaks-server
sudo npm install -g pm2
cd node_modules/echo-speaks-server
sudo pm2 start index.js
sudo pm2 list
sudo pm2 save
sudo pm2 startup
sudo pm2 save

Test to see that it is running by visiting the Web page (with the address of your server at port 8091)
In my case: http://172.16.1.78:8091

That’s it!

Hello:
I seem to get the following error when doing the docker-compose build:
image

Any suggestions?

The file in question:
image

I had to edit the docker-compose.yaml file and add to the top line: version: “2”

version: “2”
services:
echo-speaks-server:
image: echo-speaks-server:2.7.2
build:
context: …/
container_name: echo-speaks-server
restart: always

ports:
  - "8091:8091"
env_file:
  - './env.echo-speaks-server'
volumes:
  # Data persistency
  - ./data:/mnt/es-data

@PhiltorX I can see some servers requiring that. Mine didn’t.

@jtmpush18 try adding a line to declare the docker version at the top of the docker-compose file as @PhiltorX mentioned.

Yup.
That seemed to work.
Thanks @PhiltorX

2 Likes

The reason you get the error is because the yaml file is expecting docker-compose from the official Github repo. The version you grab from apt is different.

To fix it, you can use the workaround others provided above or:

sudo apt remove docker-compose

sudo curl -L “https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)” -o /usr/local/bin/docker-compose

sudo chmod +x /usr/local/bin/docker-compose

Thanks for the instructions. I am a first time Pi 3 user and was able to install Docker and the Echo Speaks service using your excellent instructions. Until… I clicked on Amazon Login, then I receive the error: Proxy-Error: Error: connect EHOSTUNREACH 54.192.31.209:443 (with a different IP each time I try). I have rebooted both Hubitat and the PI with the same results. The status, server port and URL look ok. The Pi is running a static IP (wireless). Suggestions? Please be gentle as this is new to me!
Screenshot 2022-11-27 124313

@JeffR Sometimes you will see an error like this on first run. The reboot of the Pi running the cookie authentication server should work. However, you indicate that you did that. So, are you initiating the server authentication from the Hubitat Echo Speaks app? Could you include a screen shot of the actual error? Come chat on https://chat.scottibyte.com/.

Thanks for getting back so fast. I am clicking on the Goto Login page from port 8091 from the Pi on the screenshot above and I then receive the error.
Screenshot 2022-11-27
I don’t see any authentication from the Hubitat Echo speaks app other than:
Screenshot 2022-11-27 1
But I do see this (which is concerning that is still shows the old server)
Screenshot 2022-11-27 2
When I go to the next screen the server switch is off and there is nothing to sign in at that point.
Screenshot 2022-11-27 3
I have tried using the reset options several times.
Thanks in advance for your assistance.

@JeffR Ok, very close. When you tap the “Begin Server Setup” on your last screenshot, It should bring you to a page showing you the Callback URL which you copy. Then you visit your server at port 8091 and paste that into the last field entitled “App Callback URL” on the “Echo Speaks Service v2.7.2” screen. Then, you exit that screen. Then you exit the screen that gave you the callback URL. At the bottom of the Echo Speaks screen give it a NEXT… Then go back into the Echo Speaks App and you will be able to provide your login credentials and it will work.

Thanks again. Yes, after I hit next on the echo speaks, I also hit done, went back into echo speaks and still no request for the credentials. If I go back into the Login service page it brings me right back to the same spot to deploy the server. I rebooted both hub and Pi but no where to enter credentials. Apologies for taking up your time.

No problem. If you would still like help, come by the chat at https://chat.scottibyte.com/ and we can figure it out. When I wrote the blog, I had issues trying to get it up and running and finally figured out the nuances.