RedNax67 / MMM-WunderGround

28 stars 43 forks source link

Multiple instances #20

Closed heaton1 closed 7 years ago

heaton1 commented 7 years ago

Hello!

I've got four copies of the module running, except they all have they same weather. Each have a different pws and apikey, and yet all report the same weather.

Is there a way to run multiple instances of this module?

RedNax67 commented 7 years ago

Unfortunately not. This is caused by the node_helper.js which handles the actual api requests. To keep from exhausting the api requests only one node_helper.js will be started. Other module instances will receive the exact same message sent by the node_helper and thus display the same information.

Older versions did allow for multiple locations because the requests where handled by the browser, however they would periodically stop updating.

RedNax67 commented 7 years ago

You could do it bu having multiple copies of the MMM-Winderground dir on your pi, naming them forinstance MMM-WunderGround1, 2, 3, etc.. Then you'd have to go in to the main js and modify the module name to reflect the dirname. Also you'd have to modify the ipc message name in both the main js and node_helper.js to make it unique to this instance of the module. You'd also have to have multiple entries in the config.js reflecting the relevant modulename.

heaton1 commented 7 years ago

Alright! Thank you for quickly clearing that up. I'll play around with it a bit and see if I can fandangle it to cooperate.