Hypfer / ICantBelieveItsNotValetudo

A Valetudo companion service which renders maps to pngs
Apache License 2.0
129 stars 80 forks source link

hosting the underlay image #23

Closed brunoamaral closed 4 years ago

brunoamaral commented 4 years ago

I was trying to setup the underlay image by hosting it inside the container, at /app/assets/img.

But it's not working. Is it supposed to be hosted outside of the container somehow?

{
  "mqtt": {
    "identifier": "rockrobo",
    "topicPrefix": "valetudo",
    "autoconfPrefix": "homeassistant",
    "broker_url": "mqtt://192.168.XX.XX",
    "caPath": "",
    "mapSettings": {
      "drawPath": true,
      "drawCharger": true,
      "drawRobot": true,
      "border": 2,
      "scale": 4,
      "underlay_path": "/app/assets/img/home_2d_reverse.png",
      "underlay_scale": 2,
      "underlay_x": 0,
      "underlay_y": 0
    },
    "mapDataTopic": "valetudo/rockrobo/map_data",
    "minMillisecondsBetweenMapUpdates": 250,
    "publishMapImage": true
  },
  "webserver": {
    "enabled": true,
    "port": 3030
  }
}
mar565 commented 4 years ago

Any news on this? Im having the same problem.

brunoamaral commented 4 years ago

@mar565 no, I haven't been able to make it work.

anttilip commented 4 years ago

You seem to be using the old configuration structure. Check your logs if you see these messages:

WARNING: You are using an old configuration file structure!
WARNING: mapSettings must be moved to the top level.
WARNING: Your current map settings are ignored.

If so, change the config to be like this:

{
  "mapSettings": {
    "drawPath": true,
    "drawCharger": true,
    "drawRobot": true,
    "border": 2,
    "scale": 4,
    "underlay_path": "/app/assets/img/home_2d_reverse.png",
    "underlay_scale": 2,
    "underlay_x": 0,
    "underlay_y": 0
  },
  "mqtt": {
    "identifier": "rockrobo",
    "topicPrefix": "valetudo",
    "autoconfPrefix": "homeassistant",
    "broker_url": "mqtt://192.168.XX.XX",
    "caPath": "",
    "mapDataTopic": "valetudo/rockrobo/map_data",
    "minMillisecondsBetweenMapUpdates": 250,
    "publishMapImage": true
  },
  "webserver": {
    "enabled": true,
    "port": 3030
  }
}
brunoamaral commented 4 years ago

Thank you, that was the problem. Plus I needed to add a new volume for the image assets:

    volumes:
      - ./config.json:/app/config.json
      - ./assets/img/:/app/assets/img/