Need help with local add on - stuck at getting it to launch correctly

Hi
I am not Docker or linux expert, just learning as I go.
I am running HAOS on NUC and want to get my solar inverter readings via bluetooth.
I found a docker container that is using SBFspot code and it has a good guide, but I am stuck with using HA to create a local add on.
This is the docker that I am using:

I have used the Dockerfile from the project and config.json that I hacked off another addon to build it, but now I am stuck in trying to get it to launch. I need to pass some parameters to the Docker to start it like this, including the “–network host” part so that it reads my USB bluetooth dongle:

docker run --network host -e "CSV_STORAGE=1" -e "ENABLE_SBFSPOT=1" -e "TZ=Europe/Berlin" 
   -v /path/to/your/config/dir/on/host:/etc/sbfspot -v /path/to/your/data/dir/on/host:/var/sbfspot nakla/sbfspot:latest

but I dont know where to put this launch commands… My guess is in the config.json file, as I understand is like a docker-compose type file, but different. In the project they use this in their docker-composer as an example, but how do I make it work with config.json?:

version: '3'

services:
    sbfspot:
        image: nakla/sbfspot:latest
        network_mode: host
        volumes:
            - ./etc:/etc/sbfspot
            - ./data:/var/sbfspot
        environment:
            TZ: Europe/Berlin
            ENABLE_SBFSPOT: 1
            SBFSPOT_INTERVAL: 600
            ENABLE_SBFSPOT_UPLOAD: 0
            DB_STORAGE: sqlite
            CSV_STORAGE: 1
            MQTT_ENABLE: 1
            QUIET: 0
            SBFSPOT_ARGS: -d0 -v2
            INIT_DB: 0
        restart: always

This is my current config.json file - as I said, I am reusing something I had for another addon

{
  "name": "SBFSpot",
  "version": "1",
  "slug": "sbfspot",
  "description": "SMA inverter connector",
  "arch": ["armhf", "armv7", "aarch64", "amd64", "i386"],
  "startup": "application",
  "boot": "auto",
  "ports": {
    "1000/tcp": 1000
  },
  "options": {
    "url": "http://10.0.1.1:8123"
  },
  "schema": {
    "url": "url"
  }
}

That’s not how HAOS works. It only supports Docker containers specifically written to work with the HA supervisor - aka “addons”.

If you want to run any old Docker container you need to choose one of the other installation methods.

I am already running a number of containers this way. Just had to rewrite Dockerfile and config,json
This one I am sure I am close to get going. Worked out most of my questions apart from the folder mapping part.
How does this get presented to the container? I need to create mapping

map	list	no	List of maps for additional Home Assistant folders. Possible values: config, ssl, addons, backup, share or media. Defaults to ro, which you can change by adding :rw to the end of the name.

Need to create mapping like this, or at least be able to copy files over without rebuilding

        volumes:
            - ./etc:/etc/sbfspot
            - ./data:/var/sbfspot

Request access to /share.

That’s shared between all addons, so you can use samba for instance to add stuff to /share/sbfspot
And then use that path in your addon run files

It will be mapped as /share on the addon host? Guess I will have to rebuild it then =)

Ignore the host :wink:
it will be /share inside addons
Look at the “map” options https://developers.home-assistant.io/docs/add-ons/configuration

1 Like

yes, thats where I looked =) just was not sure if I understood it correctly

Did your SBF-Spot addon work?
Iam looking for the same thing :wink:

yep, works great so far =)

May, do you share your setup? Or the hole addone? Mine will not work :cry:

I just followed their install guide on Docker.
Could not get it to work running HAOS, so migrated to HA on Debian - your physical BT device connected to HA server must be able to be connected to Docker container.