This is a MagicMirror² module for showing upcoming garbage collection dates for Vestfold.
You must have MagicMirror² installed and running first.
MMM-VESAR is a module for MagicMirror and will not work as a standalone application.
In your terminal, go to the modules directory and clone the repository:
cd ~/MagicMirror/modules
git clone https://github.com/ilsegs/MMM-VESARGo to the module directory and pull the latest changes:
cd ~/MagicMirror/modules/MMM-VESAR
git pullMMM-VESAR depends on the following Node.js packages, which are installed automatically when you run npm install in the module directory:
- moment: Used for date formatting and calculations.
- cheerio: Used for parsing HTML returned from the VESAR API.
- node-fetch: Used for making HTTP requests.
Note: You need to have MagicMirror² installed and running before you can use this module.
To use this module, you have to add a configuration object to the modules array in the config/config.js file.
{
module: "MMM-VESAR",
position: "top_right",
config: {
header: "Neste hentedag for avfall",
address: "Stasjonsveien 1, Horten",
useHumanFormat: "by_week",
dateFormat: "dddd Do MMM",
showHeader: true,
displayDate: true,
displayNumberOfDays: true,
displayIcons: true,
displayWasteType: true,
exclusions: []
}
}| Option | Type | Default | Description |
|---|---|---|---|
header |
string | "Neste hentedag for avfall" | Header text. Change or set empty string to remove. |
address |
string | "Stasjonsveien 1, Horten" | Change to your own address and town (use exact formatting as shown). This module covers Tønsberg, Horten, Sandefjord, Larvik, Holmestrand, Færder. Check vesar.no to see if your address is covered. |
dateFormat |
string | "dddd Do MMM" | Date format string, using Moment.js tokens. Example: "dddd Do MMM" for "Monday 4th Aug". |
useHumanFormat |
string | "by_week" | How to format pickup dates. "by_week" formats as day of week, "strict" as raw date. |
showHeader |
boolean | true | Show the header above the table. |
displayDate |
boolean | true | Show the next pickup date. |
displayNumberOfDays |
boolean | true | Show number of days until next pickup (e.g. "2 dager"). |
displayIcons |
boolean | true | Display icons for each waste type. |
displayWasteType |
boolean | true | Display the type of waste in text. |
exclusions |
array | [] | Waste types to exclude from the list. Example: ["Restavfall"] |
You can easily customize MMM-VESAR to fit your needs:
-
Change address:
Update theaddressfield in your config to your street and town (e.g."Stasjonsveien 1, Horten").
Make sure the format matches exactly as used on vesar.no. -
Show or hide details:
UsedisplayDateto show the next pickup date, anddisplayNumberOfDaysto show the number of days until the next pickup ("today", "tomorrow", or "2 dager").
You can enable both, either, or neither, to control which information is shown. -
Format dates:
TheuseHumanFormatoption lets you choose between"by_week"(display as day of week, e.g. "Monday") and"strict"(display the raw date).
UsedateFormatto customize how the date is formatted (e.g."dddd Do MMM"for "Monday 4th Aug"). See Moment.js format docs for details. -
Icons and waste types:
SetdisplayIconsto show or hide waste type icons.
SetdisplayWasteTypeto show or hide the waste type name as text. -
Exclude waste types:
Add types (e.g.,"Restavfall") to theexclusionsarray if you don't want them displayed. -
Show/hide header:
UseshowHeaderto show or hide the header above the table. -
Styling:
To adjust sizes or colors, editMMM-VESAR.cssin the module folder. -
Translation:
The module supports Norwegian and English out of the box. Setlanguage: "nb"orlanguage: "en"in your main MagicMirrorconfig.jsfor your preferred language.
For advanced changes (such as supporting other regions, more languages, or custom waste type translations), you can edit the files in the module folder:
-
Change waste type names:
Edit thewasteTypeTranslationsmap inMMM-VESAR.jsto show custom names for each waste type. -
Add new translations:
Create translation files in thetranslations/folder (e.g.,nb.jsonfor Norwegian,en.jsonfor English).
-
If nothing is displayed:
- Check MagicMirror logs (
pm2 logs mm). - Make sure your config block has no syntax errors.
- Verify you ran
npm installin theMMM-VESARdirectory. - Open your MagicMirror in a browser and check the developer console for errors.
- Check MagicMirror logs (
-
If the module is not updating:
- Ensure your address is valid and covered by VESAR.
- Try restarting MagicMirror:
pm2 restart mm.
-
For network access, ensure your MagicMirror config allows remote access:
address: "0.0.0.0", ipWhitelist: [],
See the CHANGELOG.md for version history and updates.
Pull requests are welcome! Please open an issue first to discuss major changes.
- Fork the repo
- Create your feature branch (
git checkout -b feature/MyFeature) - Commit changes (
git commit -am 'Add new feature') - Push to your branch (
git push origin feature/MyFeature) - Open a pull request
This project is licensed under the MIT License - see the LICENSE file for details.

