Skip to content

Docker Compose "compliant" #1

@DavZero

Description

@DavZero

Hi,

First thanks for your work.

I'm a docker beginner so may be I'm in the wrong way, but I try to use your projet and find some issue when try to add it in my docker compose yaml.

I think, you should do some change "for dockerisation":

  • When start the docker, there is no argument so may be you should define a default value for the config_file like this : parser.add_argument("--config_file", help="Config file", default="/app/data/config.yaml"). Setting a default value of /app/data/config.yml allow end user to set the config file through the docker-compose.yml file like this :
rfxtrx2mqtt:
    build: ./rfxtrx2mqtt
    container_name: rfxtrx2mqtt
    volumes:
      - ./data/rfxtrx2mqtt:/app/data
    devices:
      - /dev/ttyRfx:/dev/ttyRfx
    restart: always
    network_mode: host
    environment:
      - TZ=Europe/Paris

then I just put my config.yml in the relative folder ./data/rfxtrx2mqtt and it's use by default.

  • For the same reason, I think you should add a debug section in the config.yml file
  • For my test, I've add :
homeassistant:
  enable_discovery: True

in the config.yml in order to manage if I want the discovery topic to be publish or not. Note sure if anyone else need this

In addition, I've seen for my rfxtrx module that changing the battery change the ID of the device so I think that base the topic name for the state and for the discovery topic was note the best way to avoid impact in HA and WhiteList. What do you think about use the device name as a topic name? By doing this when changing battery, we just need to change the device name map to replace the old device ID with the new Device ID ?
I know that topic name should be unique but I prefer to manage manually a unique name instead of loose all parameter and history of value in HA?
Finally I'm not sure why you create a sensor_name_map. I think you could (should?) use the device name map? (or I miss something)?

Note If you are agree with all / some of these change, I could made them.

Finally, again :), I plan to made a web interface to manage the config.yml file. For this I will probably need to add a device_list topic somewhere in order to manage name mapping and withe list.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions