Read the statement by Michael Teeuw here.
MMM-Fuel - multi instances
-
Cause we live close to the border with largely varying fuel prices (switzerland, austria, germany) I wanted to set up 3 instances of the MMM-Fuel module to compare prices.
It appears to only use one (the first) of the configured providers and locations.
The module is shown twice on my mirror, with the same stations. It rotates through both fuel types and distance sorting then starts at the first fuel type again.If I only use one of my configurations either one works as intended.
Is there any way to start multipe instances?
this is my config for two locations:
{ module: "MMM-Fuel", position: "top_right", config: { provider: "tankerkoenig", api_key: "myAPiKey for tankerkönig", lat: 47.791416, lng: 9.882849, radius: 15, types: ["diesel", "e5"], // all your config options, which are different than their default values } }, { module: "MMM-Fuel", position: "top_right", config: { provider: "spritpreisrechner", lat: 47.2722109, lng: 9.6025761, radius: 5, types: ["diesel", "e5"], // all your config options, which are different than their default values } }, -
@liz looking at the code, this module doesn’t support multiple instances.
you might be able to make a setup for this
copy the MMM-Fuel folder to
new folder MMM-Fuel1
inside MMM-Fuel1, rename everything MMM-Fuel to MMM-Fuel1
inside templates, rename MMM-Fuel.njk to MMM-Fuel1.njkinside the MMM-Fuel1.js, change places of MMM-Fuel to MMM-Fuel1
Module.register('MMM-Fuel', { // <- getStyles() { return ['font-awesome.css', 'MMM-Fuel.css']; .// <- }, getTemplate() { return 'templates/MMM-Fuel.njk'; // <- },in your multi-instance config.js, change one of them to module:“MMM-Fuel1”
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login