Noob question: using Home Assistant via Docker with other Docker containers

Hi, I’ve been using Hass.io for a while now and overall I’m loving the functionality it adds to my home automation setup. However having spent a few Sundays rebuilding the system after it’s had a meltdown and eaten through 2 MicroSD cards, and to reduce the (admittedly minimal) additional power consumption of the RPi, I thought I’d try installing Home Assistant on my Synology DS918+. Installation itself has gone well enough and I’ve got a mostly duplicated setup running nicely. However, I can’t work out how to install a few things that I have running as addons in Hass.io.

I’ve got as far as installing them as additional containers in Docker but can’t work out how I connect A to B. The two things I’m looking at are:

Xbox One SmartGlass RESTful server

and

Nekmo Amazon Dash

For both of these in Hass.io the setup was relatively straightforward. I’ve got the Xbox RESTful server to the stage where it recognises the Xbox, what I need now is to have Home Assistant understand that this other container exists and be able to recognise it as a media player.

And the Dasshio script does a nice job of repurposing a Dash button as the on/off toggle switch for a PC upstairs that is too far under a desk to easily reach the power button so again I need to understand how to have Home Assistant running a switch that will send the WOL / RPC Shutdown command (and I probably also need to find an equivalent to the RPC Shutdown addon).

Finally, in case it wasn’t obvious from this post, I’m not a Linux user and would prefer to keep the use of command line stuff to a minimum. I do have Putty installed so can use that but most Linux guides I look at tend to read like they were written to be impenetrable to the uninitiated / take for granted an understanding of the inner workings of an OS that I don’t have.

Any guidance would be appreciated (even if it’s just sit-tight and wait for Hass.io to arrive as a Docker container!).

Hassio already IS running in docker. That’s the entire platform hassio has been built on.

Looks like you need to add the custom component to your install.

You can just create scripts or shell commands that fire the command.

Addons are Hass.io-specific Docker containers but, many times. the functionality is available as custom components for home Assistant.

When I moved from Hassio to Home Assistant I made note of what addons I valued and located how to add that functionality to Home Assistant.

Both not Hass.io ADD-ON’s, must be setup as custom components.

Thanks, all.

I don’t use the xbox sensor but the Dash set up was pretty straight forward as far as I can remember.

It looks like you already have the nekmo amazon-dash container running?

then all you need to do is edit the amazon-dash.yml file in the containers config folder with your device specific config (instructions at the github link you posted). then whenever the button is pressed it will generate an event that HA will listen for and you can use in automations.

Here is a good video of someone (burnsHA) setting it up using the command line but you can skip to the part where he configures the dash button and finds the mac address.

There are some differences between what he does and my set up because I use the access token obtained from HA instead of the HA API password. Here is my config file (tokens changed to bogus values):

# amazon-dash.yml
# ---------------
settings:
  delay: 10
devices:
  00:FC:8B:65:CC:CB: # Home Assistant example
    name: Hershey
    homeassistant: 192.168.1.11
    event: hershey_button_pressed
    access_token: lkuhglghuhg;uhhuh;h;ljhjh;kuhg;uhkjhgljkhgkjghgfghfdfdfdjfdhj
  FC:65:DE:EF:BC:BE:
    name: Gatorade
    homeassistant: 192.168.1.11
    event: gatorade_button_pressed
    access_token: jytfkygkuygkuygyuguygyguygguyghjdfsdyytoiiu;oiggt

I have two buttons setup.

See here for setting up the container with homeassistant (scroll down):

http://docs.nekmo.org/amazon-dash/config_file.html

1 Like

Thanks, this looks like precisely what I was after - if I can sort it for one thing then I’ve a fair chance of winging it with others (which is how I got the hang of Docker in the first place!).

Hi @finity

If you’re still about I could use a hand, please.

I think I have all the components in place but the end result isn’t working. My best guess is that perhaps I’ve not setup the docker container right.

To run it in reverse order, in Home Assistant, I have an automation:

- id: '1560539471479'
  alias: Nekmo Amazon Dash toggle Hudson
  trigger:
  - event_data: {}
    event_type: dash_switch_on
    platform: event
  condition: []
  action:
  - data:
      entity_id: light.guy_s_monitor
    service: light.toggle

This is to toggle a light on / off for testing purposes. I’ve tested the event in the Events panel and if I fire “dash_switch_on” then the light toggles on or off as appropriate.

In amazon-dash.yml I then have:

settings:
  delay: 10
devices:
  40:B4:CD:66:D4:D0:
    name: ON
    homeassistant: 192.168.1.107
    event: dash_switch_on
    access_token: [access token generated by Home Assistant]

That seems to match your config and the instructions. The MAC address of the button I already had from my previous Hassio install and it shows up on my router as such so I know that’s right, as is the IP address for the DS918+ running Home Assistant.

I realised through trial and error that I’d originally misdirected the config file for amazon-dash but that should now be setup right. My container config is:

Execute container using high privilege: true
Enable auto-restart: true
Volume set so that “/docker/AmazonDash” on the DS918+ maps to “/etc”
Use the same network as Docker Host: true

Everything else is untouched. Is there an environment setting I need to add?

Here is my docker run command:

sudo docker run -itd --network=host --name="amazon-dash" --restart=unless-stopped -v /home/finity/docker/amazon-dash/amazon-dash.yml:/config/amazon-dash.yml nekmo/amazon-dash:latest amazon-dash run --ignore-perms --root-allowed --config /config/amazon-dash.yml

1 Like