Code Monkey home page Code Monkey logo

mmm-traffic's People

Contributors

bonysimon avatar commanderb avatar dozer1170 avatar krackajak avatar michmich avatar mmpieps avatar mochman avatar nigel-daniels avatar paviro avatar pvyparts avatar saml-dev avatar sanjayankur31 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mmm-traffic's Issues

Working fine then ... nothing

Hello,

I'm very new to JS and MagicMirror so please forgive my candid question... just in case :)

I'm on a rpi 2 plateform with jessie. I installed the module yesterday, configured it via config.js file and everything was fine. A few hours later, i get back to my desk and see that the commute time wasn't displayed anymore.
Nothing change in the config file, I try to reload MagicMirror application, reboot the pi, look at the log (pm2 log mm) at startup... everything seems to be fine.
My api key was created yesterday too. I can see activity on the google api dashboard and I can see when the activity stoped. I created a second one, same result.

The output on the screen is :

Current commute is --
Travail via --

Here is my config file :

                {
                        module: 'MMM-Traffic',
                        position: 'bottom_left',
                        classes: 'dimmed medium',
                        config: {
                                api_key: 'ABCDEFGH123',
                                mode: 'driving',
                                origin: '1 Boulevard Malesherbes, 75008 Paris',
                                destination: '1 Rue de Rivoli, 75004 Paris',
                                route_name: 'Travail',
                                changeColor: true,
                                showGreen: false,
                                limitYellow: 5,
                                limitRed: 20,
                                traffic_model: 'pessimistic',
                                interval: 60000,
                                showWeekend: false,
                                allTime: false
                        }
                },

Here are the logs of pm2 :

0|mm       | > [email protected] start /home/pi/MagicMirror
0|mm       | > electron js/electron.js
0|mm       | Starting MagicMirror: v2.1.0
0|mm       | Loading config ...
0|mm       | Loading module helpers ...
0|mm       | No helper found for module: alert.
0|mm       | Initializing new module helper ...
0|mm       | No helper found for module: clock.
0|mm       | Initializing new module helper ...
0|mm       | No helper found for module: compliments.
0|mm       | Initializing new module helper ...
0|mm       | No helper found for module: currentweather.
0|mm       | No helper found for module: weatherforecast.
0|mm       | Initializing new module helper ...
0|mm       | All module helpers loaded.
0|mm       | Starting server op port 8080 ...
0|mm       | Server started ...
0|mm       | Connecting socket for: updatenotification
0|mm       | Connecting socket for: calendar
0|mm       | Starting node helper for: calendar
0|mm       | Connecting socket for: MMM-Traffic
0|mm       | MMM-Traffic helper started ...
0|mm       | Connecting socket for: newsfeed
0|mm       | Starting module: newsfeed
0|mm       | Sockets connected & modules started ...
0|mm       | Launching application.
0|mm       | Create new calendar fetcher for url: https://calendar.google.com/calendar/ical/abcdefg/basic.ics - Interval: 300000
0|mm       | Create new calendar fetcher for url: https://calendar.google.com/calendar/ical/abcdefg/basic.ics - Interval: 300000
0|mm       | Create new calendar fetcher for url: https://calendar.google.com/calendar/abcdefg/basic.ics - Interval: 300000
0|mm       | Create new news fetcher for url: http://www.bfmtv.com/rss/info/flux-rss/flux-toutes-les-actualites/ - Interval: 300000

Do you know anything about this "issu" ?
Is there a way to get logs from the module directly or something like debug mode to help understand what's go wrong ?

I can give further information if you ask.

Dynamic destination

Hi,

would it be possible to set "Destination" as a dynamic value? I´m storing the parking position of my car in my smarthome system and I would like to use this position as a destination. As the coordinates change daily the destination Value in MagicMirror Config file must be dynamically. Any Idea how I could achieve this?

PS: The access to my Smart Home System (FHEM) will probably be over HTTP

has no legs

After following the directions the module worked perfectly.
But after a few config changes I am getting "Loading Commute..." but it never loads.

Upon exiting the MagicMirror I see this in the terminal window. Node_helper has Legs in it but the Request.js does not contain Legs variable.

Please advise.

Whoops! There was an uncaught exception...
TypeError: Cannot read property 'legs' of undefined
at Request._callback (/home/pi/MagicMirror/modules/MMM-Traffic/node_helper.js:31:45)
at Request.self.callback (/home/pi/MagicMirror/modules/MMM-Traffic/node_modules/request/request.js:187:22)
at emitTwo (events.js:106:13)
at Request.emit (events.js:191:7)
at Request. (/home/pi/MagicMirror/modules/MMM-Traffic/node_modules/request/request.js:1126:10)
at emitOne (events.js:96:13)
at Request.emit (events.js:188:7)
at IncomingMessage. (/home/pi/MagicMirror/modules/MMM-Traffic/node_modules/request/request.js:1046:12)
at Object.onceWrapper (events.js:290:19)
at emitNone (events.js:91:20)

Customizable Amber/Red Thresholds

It would be great if the threshold triggers for amber and red were config parameters.

limitAmber: 20,
limitRed: 50

and then

        //change color if desired and append
        if (this.config.changeColor) {
          if (this.trafficComparison >= 1 + (this.config.limitRed / 100)) {
            commuteInfo.className += ' red';
          } else if (this.trafficComparison >= 1 + (this.config.limitAmber / 100)) {
            commuteInfo.className += ' yellow';
          } else if (this.config.showGreen) {
            commuteInfo.className += ' green';
          }
        }

This should work... but my test commutes aren't tripping the colour change

named day specific destinations not loading

Hi,
I'm able to get my general destination working, but am unable to implement the specific weekday destinations (mon_destination, tues_destination, etc). When I tried it as in the example code, none of the weekdays showed up, only my main 'destination'. I tried running the module twice in my config.js, as I found elsewhere that's how to get two destinations going--if I only have the mon_destination named in the second instance, that module shows as loading and never changes. If I put in a different destination into the second module's 'destination' field, it works.

How do I get the daily destinations to work? Am I supposed to be able to run them in the same instance of the module as my standard work destination?

feature request

Hi Sam,

Firstly, thanks for sharing such an awesome module - It's the first thing I added to my Magic Mirror and I love it!

This is more of a request than an issue - would it be possible to dynamically set the destination based on the day of the week (or even better, a holiday/non-holiday value)? I suspect the latter would be incredibly difficult but perhaps the former might be a possibility?

I appreciate you've got your own life to live - if it's difficult to spare the time, woud you mind me raising the request and referencing the module on the Magic Mirror builders forum, to see if other developers are up for the challenge?

All the best,
Darren

not getting it to work

Hey, I only see "Start at: -- Work via -- to arrive at 8:00

module: 'MMM-Traffic', position: 'top_left', classes: 'dimmed medium', //optional, default is 'bright medium', only applies to commute info not route_name config: { api_key: 'my api !?', mode: 'driving', origin: 'start adress', destination: 'end address', arrival_time: '0800', //optional, but needs to be in 24 hour time if used. route_name: 'Work', changeColor: true, showGreen: false, limitYellow: 5, //Greater than 5% of journey time due to traffic limitRed: 20, //Greater than 20% of journey time due to traffic traffic_model: 'pessimistic', interval: 120000, //2 minutes showWeekend: false, allTime: false, loadingText: 'Check..', prependText: 'Work ', leaveByText: 'Start at: ', hideOffHours: false,

I do have two questions:
Since I am in Europe, does it matter HOW the address is inserted? "Street 1, zip code, city" or " Street+1,Zipcode,city" or somehow else??

Can someone please explain how to obtain a api_key. Since I am not sure, fi I have the right one, or if I have done it correctly!?

Thank You !

Stuck in Loading

I'm sure this is a really dumb issue i'm having, but I'm having the issue where it's stuck loading. I tried out the link mentioned in #10 , which worked. When I look at the API dashboard it is not showing any requests from the MagicMirror. Is there any text I need to include prior to the API key in the quotes?

Stuck on Loading Commute...

Hey!

For some reason the module is stuck on "Loading commute..." and when I check the maps api requests section it says it hasn't received any requests. Anyone have any idea what might be causing this and how to fix it? Thanks!

Multiple Commutes

First, I just wanted to say I love the module.

From a different thread I saw, you can have different routes display so I copied my first one and pasted the copy below it. I edited the location to go to my girlfriend's work and changed her arrival_time (1230).

Now it keeps flipping both modules back and forth between my departure time (6:39am) and her departure time (12:06pm).

Is there anything I can do so they don't both update to the same departure times?

Issue with Installation

I am very new to using modules. I followed the instructions to install the module. I requested and received an API from Google, and I inserted the API into the script as instructed by the readme. Even when using the example provided by the readme, the screen only says, "loading commute..."

Is there a way to debug this script to find where I am having an issue?

Adding line break in prependText

Is there a way to add a line break to the prependText? I have two modules to two different destinations, so I have the prependText set up to say "Current commute time to Destination A is" and "Current commute time to destination B is". Unfortunately, it's extending halfway across the screen and overlapping with the center text.

I tried setting it up as:
prependText: 'Travel time to\nDestination A is',
But it still shows up as a single line. Any ideas?

Magic Mirror goes blank with this module.

Hello,

First of all, thank you for providing such a great module.

I have a problem running the magic mirror with this module. After the set up is completed (installing MMM-traffic, get google API key) while trying to run the magic mirror, the interface opens with a blank screen. The application launches well but nothing is displayed on the interface.

Please let me know if you need more information.

Please help. Appreciate your time and effort

Thank you,
bikerboy

Calculated time and track from module differs to Google Maps results

While setting up MMM-Traffic told me that my way to work will be around 1 hour 52 min and the summary says via 2 highways, quite far away from normal track.

I used the example URL from Google with my locations to check the results. There the track and the estimated time are matching real life.

https://maps.googleapis.com/maps/api/directions/json?origin=75+9th+Ave+New+York,+NY&destination=MetLife+Stadium+1+MetLife+Stadium+Dr+East+Rutherford,+NJ+07073&key=YOUR_API_KEY

PrependText

When I use this in the config file, it says that I have an error in my config.

Edit : My mistake, I had a special char in the string!

Thanks!!

LJ

Commuting...

Hey, Nice module but I can't manage to make it work...
It keeps showing 'Commuting...' and nothing happens.
I just pasted your config settings and change API ID.
On the console, it says 'MMM-Traffic received a system notification: DOM_OBJECTS_CREATED'

Nothing seems to work. Did I do something wrong ?

Not showing Module with hideOffHours: true

Hi, this is an awesome module, but I am having an issue with using the hideHoursOff argument:

`{
module: 'MMM-Traffic',
position: 'top_left',
classes: 'bright medium', //optional, default is 'bright medium', only applies t$
config: {
api_key: '',
mode: 'driving',
origin: '',
destination: '
***************',
arrival_time: '0930',
route_name: 'Home to Work',
changeColor: true,
showGreen: false,
limitYellow: 5, //Greater than 5% of journey time due to traffic
limitRed: 20, //Greater than 20% of journey time due to traffic
traffic_model: 'pessimistic',
interval: 120000, //2 minutes
showWeekend: false,
allTime: false,
startHr: 6,
endHr: 12,
hideOffHours: true
}
},

{
module: 'MMM-Traffic',
position: 'top_left',
classes: 'bright medium', //optional, default is 'bright medium', only applies t$
config: {
api_key: '',
mode: 'driving',
origin: '
',
destination: '
*****',
arrival_time: '1845', //optional, but needs to be in 24 hour time if used.
route_name: 'Work to Home',
changeColor: true,
showGreen: false,
limitYellow: 5, //Greater than 5% of journey time due to traffic
limitRed: 20, //Greater than 20% of journey time due to traffic
traffic_model: 'pessimistic',
interval: 120000, //2 minutes
showWeekend: false,
allTime: false,
startHr: 15,
endHr: 20,
hideOffHours: true
}
},
`

I believe I am using it correctly, I am expecting it to show the first travel time in the morning and the second in the afternoon, and for it not to be there during the other times outside startHr, and endHr, but it is just not showing at all.

As soon as I put hieOffHours: false, it shows both all the time, am I putting the start and end arguments incorrectly?

Many thanks!!!

Will

Calendar integration

It would be awesome if you could work together with @MichMich so that the calendar may send a notification for all events that have a location and your module takes that notification and could then optionally display how long you need to get there and when you should start driving.

Not updating

Traffic loads times on initialization but fails to update while Magic Mirror runs.

Module not displayed

Hello SamLewis,

I am trying to get this module working and I am running into trouble. The magic mirror works and is displaying everything except the traffic module. I believe I installed everything right and I believe I am using the correct API key but the module will no display. any help would be appreciated. Thank you in advance.

"classes" attribute has conflict with MMM-Facial Recognition Module

Hi,

In your example config.js you are using an attribute called "classes"

module: 'MMM-Traffic',
    position: 'top_left',
    **classes: 'dimmed medium',** //optional, default is 'bright medium', only applies to commute info not route_name
    config: {

The same attribute name is use in MMM-Facial Recognition Module to call the user name that logs in.

If you try to use this module along with MMM-Traffic module there is a conflict that makes this module not work.

module: 'MMM-Traffic',
    position: 'top_left',
    **classes: 'default for_all',**
    **classes: 'dimmed medium',** //optional, default is 'bright medium', only applies to commute info not route_name
    config: {

This attribute should be named differently to avoid this conflict

Commute time not loading

Is there any particular reason why my commute times wouldn't be loading? It just stopped one day and now it just says "Current commute is--". Thank you!

Module not working with origin/destination with special characters

Thanks for this great module, did something similar for the old version of MagicMirror.

But it doesn't work with special characters (german umlauts) in the origin/destination address,

What doesn't work:

origin: 'Werastraße 123, 70190 Stuttgart',
destination: 'Hans-Klemm-Straße 5, 71034 Böblingen',

The request in node_helper.js -> getCommute returns a 400 bad request.

Quick fix: URL Encode both addresses

origin: 'Werastra%C3%9Fe%20123%2C%2070190%20Stuttgart',
destination: 'Hans-Klemm-Stra%C3%9Fe%205%2C%2071034%20B%C3%B6blingen',

If I can figure this git stuff out i will implement a fix to the code and do a pull request :)

Use of Table

Is there any particular reason why you use a table in the wrapper? If this is converted to basic DIV's it can be used in the center elements as well.

Never finishes Loading

Having an issue that the module never fully loads, I have the both the address input correctly in the config file. The Google API key is also there. It shows that the module is loading when the Mirror is launched, but never pulls up. I just continuously get Loading....
Please advise
Thanks

Adding avoid tolls to the JS

I have absolutely zero coding or java script or JSON knowledge and the fact that Ive gotten to where I am with this project in the time is amazing, But your module (which is amazing for my girlfriend who leaves late every day) takes the toll road which pretty much renders any accurate traffic patterns useless. On the google maps website (where you obtain the API key) it says to add avoid=tolls but with my knowledge, I simply dont know how or where to do so.

If you could possible take a look at that I would forever be grateful.

Thank you

Jose

Cannot read property 'legs' of undefined

Hi there,

unfortunately I got an error using this module and it hangs with Loading commute...

The API-Key and stuff are correct, I get data using my config in a webbrowser.
I can see the "legs" section in the webbrowser, but I don't know why the module doesn't handle it.

Thanks in advance,
eazee187

Inconsisent translation

Please make the entry's like arrival, via, to arrive by an maybe others translatable.

I do this every time by my self but when i do update your Module my translation in your MMM-Traffic.js are gone. :-(

Please update this.

Arrival time instead of commute time

Hi Sam,

Great module, very useful every morning!

I would have a feature request to make it even better :) : Is there a possibility to display the arrival hour instead of the time of commute? The way I would see that work is to take the current time and add it the commute time. Not sure how complex or possible that would be?

All the best,
Vincent

uncaught exception.

Whoops! There was an uncaught exception...
TypeError: Cannot read property 'legs' of undefined
at Request._callback (/home/pi/MagicMirror/modules/MMM-Traffic/node_helper.js:47:55)
at Request.self.callback (/home/pi/MagicMirror/modules/MMM-Traffic/node_modules/request/request.js:187:22)
at emitTwo (events.js:106:13)
at Request.emit (events.js:191:7)
at Request. (/home/pi/MagicMirror/modules/MMM-Traffic/node_modules/request/request.js:1048:10)
at emitOne (events.js:96:13)
at Request.emit (events.js:188:7)
at IncomingMessage. (/home/pi/MagicMirror/modules/MMM-Traffic/node_modules/request/request.js:969:12)
at emitNone (events.js:91:20)
at IncomingMessage.emit (events.js:185:7)

Multiple mode

Hi Sam,

First, I would like to congratulate you for the job you have done done!!!

I was wondering if it is possible to have more than one mode in the same module to get to the same adress ?

I managed to have driving mode and transit mode but in two different modules and not in only one.

Thanks for you help

Yann

Current Commute remains blank

Hello, first thanks for the module, its very well explained, has lots of customization options, and they are very well listed.

I have an issue with the module though, and I dont know where the problem is. I installed the module and got no error, then I copied the module in the config file, edited it with the API that got from google, added the adresses I wanted and I ran MM. The module seems to work as it appears on the screen, but only displays "Leave by --" or "Current Commute --" depending on wether i chose to put an arrival time or not. Then I tried it with the default adresses and the same happens.

This is a screenshot of what it displays.
traffic module

I then tried with another API key, and none key, and the same happens, so I imagine it has something to do with that.

Is there any info I can provide so you can tell me if its the API or something else? or is there something in particular I have to do when requesting the key?
Thank you very much! looking forward to solve this issue and enjoy your module!

commute is never displayed, if hideOffHours: true

Hi, i really can't find my mistake. If i set the hideOffHours: true the commute time is never displayed. Any chance someone could point me into the right direction?

settings from config.js
{ module: 'MMM-Traffic',
position: 'top_left',
classes: 'dimmed medium', //optional, default is 'bright medium', only applies to commute info not route_name
config: {
api_key: '*****************************',
mode: 'driving',
avoid: 'highways',
origin: 'Marktplatz 1, 70173, Stuttgart',
destination: 'Kaesbruennlestraße, 71063, Sindelfingen',
arrival_time: '1630', //optional, but needs to be in 24 hour time if used.
route_name: 'Stuggi->SiFi',
changeColor: true,
showGreen: false,
limitYellow: 5, //Greater than 5% of journey time due to traffic
limitRed: 20, //Greater than 20% of journey time due to traffic
traffic_model: 'pessimistic',
interval: 120000, //2 minutes
showWeekend: false,
allTime: false,
hideOffHours: false
}
},

i also checked the values in the MMM-Traffic.js file, they're untouched
startHr: 7,
endHr: 22,
now it's 14:42 in my timezone, this should be within the range of 7 to 22 arrival is set to 1630 but if i change hideOffHours from false to true the module disappears.

Multiple Destinations REQUEST

Hello,
I think it would be a good option to be able to have multiple destinations, eg. Work, Uni, School, etc.
Do you think this is something possible to add?
Thanks
Luke

Loading commute..

Hi SamLewis0602

First of all thank you for your work!!

I am a novice with all these stuff and i wanted to know witch kind of Google API key have you used??

Server, browser??

I am stuck and the message loading commute... and the request seems good on the google console.

Thanks!

Stuck Loading

Hey Thanks for the module.
But i cannot seem to get it to work. I have tested the API with #16. I have also try #10. But the module still says stuck loading. Any ideas?
Thanks

arrival times for different destinations

is it possible to have different arrival times for different destinations either for same or different day?

eg.

Destination B, arrival time 1500
Destination C, arrival 1700

I've tried adding arrival_time after each destination, but it calculates everything based on the last arrival time provided

config error

could someone take a look at my code to see what im missing? ever since i installed this mod the program wont recongize the config folder, theres gotta be an error in this mod code

2017-03-25-203802_1920x1080_scrot

Loading Commute error

I believe my issue is with the api code, I have one but i dont think it is working. I tried posting it into that weblink you mentioned in another thread, but it told me that my api key was invalid. Any suggestion? Ive double and triple checked the actual module files and everything appears to match yours as far as i can tell. When i run the program, it never loads, only says "Loading commute"
The terminal window outputs this when it tries to load the module,
"Whoops! There was an uncaught exception...
TypeError: Cannot read property 'legs' of undefined
at Request._callback (/home/pi/MagicMirror/modules/MMM-Traffic/node_helper.js:21:39)
at Request.self.callback (/home/pi/MagicMirror/modules/MMM- Traffic/node_modules/request/request.js:187:22)
at emitTwo (events.js:106:13)
at Request.emit (events.js:191:7)
at Request. (/home/pi/MagicMirror/modules/MMM- Traffic/node_modules/request/request.js:1048:10)
at emitOne (events.js:96:13)
at Request.emit (events.js:188:7)
at IncomingMessage. (/home/pi/MagicMirror/modules/MMM-Traffic/node_modules/request/request.js:969:12)
at emitNone (events.js:91:20)
at IncomingMessage.emit (events.js:185:7)
MagicMirror will not quit, but it might be a good idea to check why this happened. Maybe no internet connection?
If you think this really is an issue, please open an issue on GitHub: https://github.com/MichMich/MagicMirror/issues
"

Display request

Hello !

First I would like to thank you for this amazing module ! We use it every day with my wife and it is super handy.

I would like to know if it would be possible to display the address set for the current day. To be clearer, I have set a different address for each day of the week and I would like it to appear under "Home to work".

Is it possible/easy to do that ?

Cheers !

Multiple stops in commute

It would be awesome if we could get multiple stops added to the commute. I will take a swing at it later but I have never touched node/js

New Update

To get this new commit Update, can I just pull the code and type it into my .js file or do I have to flash an update install?

Stuck in loading.

Hi Sam,

Thx for creating this module! I have tought one question, im still stuck in loading face. The api key works fine when tested (lots of links, also the ones mentioned earlyer #25) When put in browser it show up the request in mu developer console.

Have tried with different requests and with place id:s. Also have pulled the latest update.

Tryed to figure this out but now im headbanging the wall :D

Arrival_time not working with transit or bicycling

Hi Sam,

It's me again.. I've noticed a bug with arrival time.

If the arrival_time has a value and mode is transit or bicycling, then commute keeps loading and nothing is displayed on the mirror ("TRAFFIC_TIMING" is not received in logs).

Any idea on how to correct that?

Thanks a lot,
Vincent

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.