Read the statement by Michael Teeuw here.
MMM-MyCommute
-
@leem2000 if it has a package.json file, yes, and if the instructions say so, yes
gotta follow the instructions
-
Hi,
I have been installing this module on 2 MagicMirrors.
It’s running 24/7 and I check travelling time to 4 destinations (so, 8 with both mirrors).Today I got an email, that after about only 2 weeks or so, there are just 25€ remaining of my testing period and 300€.
I do not have any other projects and I’ve checked the Dashboard, there have been more than 45000 queries to the directions API so far.
First thing I did: Limited the module on both mirrors to run only at daytime. But as I have different work locations and shifts, this is not so good. And, of course, I dont want to generate queries for a real amount of cash…
What should I do? Is this normal?
-
@requiemmg yes, I got a warning too from google, 4 mirrors, asking every 5 minutes, the api query counts add up fast… 8,000 calls a week…
-
Okay, so no way to limit API calls? Would it be possible to call every 10 minutes or so and only every 60 minutes in the “non-active” time?
-
@requiemmg if someone changes the code, sure. can do almost anything. I support another mirror app which does provide for a interested time period. (rush hour), and doesn’t call API outside that time period if set
-
Okay, played around a bit. Set the module to show times only from 5am to 5pm. And I added a “pollFrequency: 15 * 60 * 1000,” to my config.
While the first one works (the module disappears at night), the second one does not seem to work:
This is the Traffic from the last 2 days. You can see the requests are paused last night. I made changes to the poll frequency yesterday in the afternoon, no change.
The module used up nearly all of my €300 starting balance. I wonder if this will go on like this.
API calls in the last 48 hours:

API calls in the last ONE hour:

Which I do not understand: No errors. Poll Frequency of every 15 Minutes. 2 Mirrors with 4 destinations each. So 4*8=24 API calls/hour would be what I expect to see…
-
@requiemmg 352/hour is 5.87 per minute, about once every 12 seconds… once every 24 seconds both of 2 machines.
1 looked at the code, 1 api request per destination.
-
Raised an issue. Seems like the problem comes with the use of MMM-Pages, so on every reload of the page, the module is loaded and the requests are sent again, even if the data is still up to date. @qistoph was so nice to make a fork to address this issue.
-
@requiemmg yep, separate instance on every page.
-
This makes it clear why I had about 50.000 requests, which made my $400 starting balance void…well, with the new fork and some config modifications, this is much better.
-
@requiemmg What I have found is if you run the module in the fixed section of MMM-pages it only does the calls every so often as you set them to i.e. the MMM-Openinghours module I run in fixed as I refresh it every 4hrs.
-
@mumblebaj Right, but in my design it doesn’t fit in this section. Anyhow, @qistoph made a test fork (https://github.com/qistoph/MMM-MyCommute/tree/issue17) which only makes requests if the data is outdated (=longer than set pollFrequency). See the issue thread (https://github.com/qistoph/MMM-MyCommute/issues/17) for further details
-
-
-
Hi all.
Wondering if there’s a way to hide the arrival time? Can’t see an option in the config.
Thanks -
Additional question - the startTime option doesn’t seem to be working correctly for me. The module doesn’t display in the morning on the pi/mirror, even after the specified startTime. Weirdly, when I browse to the mirror from my laptop or phone (http://ip:8080) that seems to trigger the module to display on the pi.
Any ideas there?! -
@matt216 said in MMM-MyCommute:
Weirdly, when I browse to the mirror from my laptop or phone (http://ip:8080) that seems to trigger the module to display on the pi.
Any ideas there?!this means the module is not written for multiple browser instances.
when the helper sends data back, it sends data back to ALL connected clients at the same time.
the clients need to check if the message is for them , but the helper needs info on the request to do it… so the modulename.js has to change too… -
@matt216 said in MMM-MyCommute:
Additional question - the startTime option doesn’t seem to be working correctly for me. The module doesn’t display in the morning on the pi/mirror, even after the specified startTime. Weirdly, when I browse to the mirror from my laptop or phone (http://ip:8080) that seems to trigger the module to display on the pi.
Any ideas there?!I think I remember with this module that it has an odd hide/show behaviour. Are you working with MMM-pages or any module scheduler being able to hide modules?
When you open your browser, a request is sent to node_helper and it sends the data back to the module (like Sam said, ALL instances). With receipt f the data the module.show() function gets triggered, so it gets shown again while it has been hidden for some reason before. -
@sdetweil thanks for the help (again).
I’m not sure I understand… it seems to take a second browser loading the page for the main mirror to display the module.
As per the github page for the module, the startTime option is “The start time of the window during which this module wil be visible.” but this is not happening.
endTime option works fine - the module disappears, but it does not reappear at startTime.
Thanks -
@matt216 said in MMM-MyCommute:
@sdetweil thanks for the help (again).
I’m not sure I understand… it seems to take a second browser loading the page for the main mirror to display the module.See my response. Every time any instance on any browser (pi/laptop) gets created, it sends a request to the server-side node_helper. This happens with most of the modules.
node_helper sends it back and all the instances get fresh data and certain functions get triggered.Here is the client side: running when you open the broser (note the
this.getdata()function.start: function() { Log.info('Starting module: ' + this.name); //start data poll this.getData(); var self = this; setInterval(function() { self.getData(); }, this.config.pollFrequency); },and here the client side receives the data from node_helper : note the
this.isHidden=falseandthis.show()functions at the end.socketNotificationReceived: function(notification, payload) { if ( notification === 'GOOGLE_TRAFFIC_RESPONSE' + this.identifier ) { this.predictions = payload; if (this.loading) { this.loading = false; if (this.isHidden) { this.updateDom(); this.show(1000, {lockString: this.identifier}); } else { this.updateDom(1000); } } else { this.updateDom(); this.show(1000, {lockString: this.identifier}); } this.isHidden = false; }
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
