Moving from RPi to Docker

Having MQTT broken out gives you a little flexiblity. I have some DIY devices that send status updates to MQTT. If HASS is down or rebooting , those updates are not put on the MQTT server and picked up when HASS comes back up. I can reboot HASS docker and everything else stays up. MQTT. NGINX , NodeRed , etc.

1 Like

I’ve inadvertently stopped my HA server running in docker and now can’t access it to restart it.

How od I restart the docker container, if that’s the correct terminology?

EDIT: Should have guessed at it! $ docker restart home-assistant

OK, now that I’m back in, I’ve copied the contents of my Rpi HA Config folder to my new instance of HA running in Docker on my iMac.

However, I’m not seeing anything from my Rpi version. The docker version is still virgin.

What do I need to do have it pick up the copied config files?

??

You literally only need the config directory where the configuration.yaml is

Yes, that’s what I’ve copied over.

Does this give any clues as to where I may be going wrong?

So you have your path set to

/Users/ashleyscott/Downloads/homeassistant

Is this where your files are?

Did you restart the container after copying the files there?

Yes. Container has been restarted.

Here’s my config.yaml:

homeassistant:
  name: Home
  latitude: 
  longitude: 
  elevation: 192
  unit_system: metric
  time_zone: Europe/London
  customize: !include customize.yaml

frontend:
  themes: !include themes.yaml


config:

# Uncomment this if you are using SSL/TLS, running in Docker container, etc.
http:
  base_url: http://localhost:8123/

# Checks for available updates
# Note: This component will send some information about your system to
# the developers to assist with development of Home Assistant.
# For more information, please see:
# https://home-assistant.io/blog/2016/10/25/explaining-the-updater/
updater:
  # Optional, allows Home Assistant developers to focus on popular components.
  # include_used_components: true

discovery:

camera:
  - platform: generic
    host: 10.0.1.77
    username: 
    password: 
    port: 9003
    still_image_url: http://10.0.1.77/jpg/image.jpg

influxdb:
  host: a0d7b954-influxdb
  port: 8086
  database: homeassistant
  username: homeassistant
  password: homeassistant
  max_retries: 3
  default_measurement: state

ffmpeg:

notify:
  - name: Prowl
    platform: prowl
    api_key: !secret prowl_api
  - name: neil_prowl
    platform: prowl
    api_key: !secret neil_prowl_api
  - name: iPhone
    platform: ios
    target: !secret ios_ash_x_push_id
  - platform: webostv
    host: 10.0.1.141
    name: lounge_tv
    filename: webostv.conf

# Allows you to issue voice commands from the frontend in enabled browsers
conversation:

# Enables support for tracking state changes over time
history:

# View all events in a logbook
logbook:

# Enables a map showing the location of tracked devices
map:

# Track the sun
sun:

# lovelace:
#   mode: yaml

tts:
  - platform: google

  
weather:
  - platform: darksky
    api_key: !secret dark_sky_api

# Cloud
cloud:
  google_actions:
    filter:
      include_domains:
        - script

recorder:

ifttt:
  key: !secret IFTTT_webhook_api

panel_iframe:

  ide:
    title: IDE
    icon: mdi:code-braces
    url: http://10.0.1.32:8321

group: !include_dir_merge_named groups/
alert: !include alerts.yaml
input_number: !include input_number.yaml
script: !include scripts.yaml
binary_sensor: !include binary_sensor.yaml
switch: !include switch.yaml
sensor: !include sensor.yaml
input_boolean: !include booleans.yaml
input_select: !include input_select.yaml
cover: !include cover.yaml
automation: !include_dir_merge_list automation/
zone: !include zones.yaml
timer: !include timers.yaml

Well, for starters, discovery: will not work with you specifying a port to pass through. You need a --net=host, but I don’t think you can do that on Mac. This should be covered in the docs.

What shows up when you run docker ps -a? I suspect you have more than one instance running.

I think you’re right.

How do I get rid of the other one?

docker ps -a

the ? was indicating I was asking a question.

I spotted that too late!

I’ve edited it above.

docker kill homeassistant && docker rm homeassistant && docker kill home-assistant && docker rm home-assistant

Then run your docker run command again

Will that remove both so I start again?

yes. you could technically remove all the docker containers that are running, because it doesn’t look like any of them are important

OK, thank you. I’ll do that.

How do I get an MQTT container configured?

Perhaps you should look at this:

https://hub.docker.com/_/eclipse-mosquitto

Thank you.

All is now good. Just need to get the MQTT broker running and I’ll be done.

Thank you for your time and help. I appreciate it.

My Docker Stack shows you how a docker-compose file goes together, and the other link was the official documentation to get MQTT running on docker.

It’s not hard at all. Just understand how volumes get mounted, and permissions of the files.