Hypfer / ICantBelieveItsNotValetudo

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

Configurable colors and image overlay #15

Closed SvenFestersen closed 4 years ago

SvenFestersen commented 4 years ago

This pull request includes the following changes:

Example configuration using the new features:

{
  "mqtt": {
    "identifier": "rockrobo",
    "topicPrefix": "valetudo",
    "autoconfPrefix": "homeassistant",
    "broker_url": "mqtt://mybroker",
    "caPath": "",
    "mapSettings": {
      "drawPath": true,
      "drawCharger": true,
      "drawRobot": true,
      "border": 2,
      "scale": 4,
      "crop_x1": 55,
      "crop_x2": 340,
      "crop_y1": 75,
      "crop_y2": 270,
      "colors": {
        "floor": "rgba(0,0,0,0)",
        "obstacle_weak": "rgba(0,0,0,0)",
        "obstacle_strong": "rgba(0,0,0,0.2)",
        "path": "black"
      },
      "overlay_path": "/data/walls.png",
      "overlay_scale": 1,
      "overlay_x": -8,
      "overlay_y": 8,
      "underlay_path": "/data/floors.png",
      "underlay_scale": 1,
      "underlay_x": -8,
      "underlay_y": 8
    },
    "mapDataTopic": "valetudo/rockrobo/map_data",
    "minMillisecondsBetweenMapUpdates": 10000,
    "publishMapImage": false
  },
  "webserver": {
    "enabled": true,
    "port": 3000
  }
}

Important: When upgrading an existing installation, make sure to run npm install before npm start to upgrade Jimp.

Also please ignore commit 20e7cae ("Openhab colorscheme for map."). I included it by accident. The changes made in this commit have been made obsolete by the new configurable colors feature.