This is a module for MagicMirror² to show the next waste pickup dates for any address in Oslo, Norway. It gets the dates by scraping the municipal lookup service. All of the information on the board can be configured, ensuring you can get the exact look you want.
Enter your MagicMirror² module folder, e.g.:
cd ~/MagicMirror/modules
Clone the repository
git clone https://github.com/blixhavn/MMM-AvfallshentingOslo.git
Install the dependencies
cd MMM-AvfallshentingOslo
npm install
Add the module to your configuration file, for instance:
{
module: "MMM-AvfallshentingOslo",
position: "top_right",
config: {
address: "Maridalsveien 52",
dateFormat: "dddd Do MMM",
useHumanFormat: "by_week",
showHeader: false,
updateSpeed: 1000,
refresh: 3600,
displayIcons: true,
displayWasteType: false,
exclusions: ["Restavfall", "Restavfall til forbrenning"],
}
},
Configuration option | Comment | Default |
---|---|---|
address | Street address to provide to the lookup service. Typically your home address. | "Slottsplassen 1" |
dateFormat | String specifying the date format for the Moment.js library. See documentation here. | "dddd Do MMMM" |
useHumanFormat | Accepts options "strict", "by_week". As the "Next thursday" phrase can be interpreted differently, I've included two options. strict means that any date within a week (7 days) will display the weekday, while dates between one and two weeks away will display "Next {weekday}". by_week will display "Next {weekday}" if the date is within the date range for next week (e.g. on friday it will display "Next monday" for the upcoming monday). Omitting the config, or setting it to anything but these options will always display the above dateFormat. |
"by_week" |
showHeader | Boolean for whether or not to display header for the module (see example in image above) | false |
updateSpeed | Transition speed when updating the display (in milliseconds). | 1000 |
refresh | Refresh interval for polling the website for new information (in seconds). | 3600 |
displayIcons | Boolean for whether or not to display waste icons. Uses the official waste icons for Norway. | true |
displayWasteType | Boolean for whether or not to display waste type text. | false |
exclusions | List for waste types to exclude from the list. Needs to match the exact text, but is case insensitive. | [] |
If you have any feedback, questions or suggestions, do not hesitate to make an issue on GitHub 🙂 Also, feel free to make contributions in form of pull requests!
MMM-AvfallshentingOslo is released under the MIT license. Have at it.
Made by Øystein Blixhavn