• Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
MagicMirror Forum
  • Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
A New Chapter for MagicMirror: The Community Takes the Lead
Read the statement by Michael Teeuw here.

2 problems with MMM-MyCommute module

Scheduled Pinned Locked Moved Troubleshooting
13 Posts 6 Posters 8.0k Views 6 Watching
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    Bob
    last edited by Bob Aug 29, 2017, 9:55 AM Aug 27, 2017, 12:34 PM

    Brief bit of background.

    I have 2 offices that I go to. One is about a mile from where I live and I have 4 ways to get to there (walking, tram, train or bus). The other is about 30 miles away with a couple of alternative driving routes. Depending on which office I’m going to (and whether I want to walk or take public transport), I want the module to show me what is likely to be the best option to get to each of the specific offices.

    This is where I have 2 problems I’m trying to resolve and could do with some help.

    1. For driving, I never have anything but a “green” commuting time (ie, it never goes yellow or red for delays, even when adjusted to 1% and 5% delay thresholds)

    2. For the closer office I can’t get the alternative transit modes to work (ie, train, tram, bus etc). If I specify anything within the transitMode option, I get Error displayed in the module. If I just use transit (with no transitmode) it works fine, although I can’t then pick which mode of transit to use.

    My code is below (API is edited out, as are home & work postal codes - the rest is cut and paste)

    {
    	module: 'MMM-MyCommute',
    	header: "Work Commute",
    	position: 'bottom_right',
    	config: {
    		api_key: 'xxxxxxxxxxxxxxxxxxxxxxxxxxx',
    		origin: 'Home Postal Code',
    		showSummary: true,
    		startTime: '00:00',
    		endTime: '23:59',
    		colorCodeTravelTime: true,
    		moderateTimeThreshold: 1.01,
    		poorTimeThreshold: 1.05,
    		destinations: [
    			{
    			destination: 'Work  1 Postal Code', // Farther office, by car, alternatives on
    			label: 'Office 1',
    			color: '#1E90FF', //Blue
    			alternatives: true,
    			},
    			{
    			destination: 'Work  2 Postal Code', // Closer office, walking, alternatives off
    			label: 'Office 2 - Walking',
    			mode: 'walking',
    			color: '#98FB98', // Green
    			alternatives: false,
    			},
    			{
    			destination: 'Work 2 Postal Code',
    			label: 'Office 2 - Train',
    			mode: 'transit',
    			transitMode: 'train',
    			showNextVehicleDeparture: true,
    			color: '#ffff00', //Yellow
    			alternatives: false,
    			},
    			{
    			destination: 'Work 2 Postal Code,
    			label: 'Office 2 - Tram',
    			mode: 'transit',
    			transitMode: 'tram',
    			showNextVehicleDeparture: true,
    			color: '#ffff00', //Yellow
    			alternatives: false,
    			},
    			{
    			destination: 'Work 2 Postal Code,
    			label: 'Office 2 - Bus',
    			mode: 'transit',
    			transitMode: 'bus',
    			showNextVehicleDeparture: true,
    			color: '#ffff00', //Yellow
    			alternatives: false,
    			},
    			]
    	},
    },
    

    I’ve tried all sorts of editing, using both single and double quotes, and am using Geany to check the syntax (which I believe is correct)

    Any ideas ?

    S 1 Reply Last reply Aug 27, 2017, 7:13 PM Reply Quote 0
    • S Offline
      strawberry 3.141 Project Sponsor Module Developer @Bob
      last edited by Aug 27, 2017, 7:13 PM

      @Bob I can spot multiple missing quotes

      Please create a github issue if you need help, so I can keep track

      1 Reply Last reply Reply Quote 0
      • B Offline
        Bob
        last edited by Bob Aug 29, 2017, 10:22 AM Aug 29, 2017, 9:53 AM

        @strawberry-3-141 Where are there quotes missing ? I could only see a couple (which I’ve corrected in my first post). I edited the code to remove identifying info, so it should be ok now. Normally when there is a code error due to syntax (such as quotes), MM won’t even run.

        In this instance, I simply get a line error for the specific mode of transport.

        1 Reply Last reply Reply Quote 0
        • B Offline
          Bob
          last edited by Aug 29, 2017, 10:22 AM

          This is what I get using the code above.

          0_1504002124877_MyCommute error.JPG

          S 1 Reply Last reply Aug 29, 2017, 6:56 PM Reply Quote 0
          • S Offline
            strawberry 3.141 Project Sponsor Module Developer @Bob
            last edited by Aug 29, 2017, 6:56 PM

            @Bob two times you have destination: 'Work 2 Postal Code, instead of destination: 'Work 2 Postal Code',

            Please create a github issue if you need help, so I can keep track

            1 Reply Last reply Reply Quote 0
            • Y Offline
              yawns Moderator
              last edited by Aug 30, 2017, 7:54 AM

              {
              	module: 'MMM-MyCommute',
              	header: "Work Commute",
              	position: 'bottom_right',
              	config: {
              		api_key: 'xxxxxxxxxxxxxxxxxxxxxxxxxxx',
              		origin: 'Home Postal Code',
              		showSummary: true,
              		startTime: '00:00',
              		endTime: '23:59',
              		colorCodeTravelTime: true,
              		moderateTimeThreshold: 1.01,
              		poorTimeThreshold: 1.05,
              		destinations: [
              			{
              			destination: 'Work  1 Postal Code', // Farther office, by car, alternatives on
              			label: 'Office 1',
              			color: '#1E90FF', //Blue
              			alternatives: true,
              			},
              			{
              			destination: 'Work  2 Postal Code', // Closer office, walking, alternatives off
              			label: 'Office 2 - Walking',
              			mode: 'walking',
              			color: '#98FB98', // Green
              			alternatives: false,
              			},
              			{
              			destination: 'Work 2 Postal Code',
              			label: 'Office 2 - Train',
              			mode: 'transit',
              			transitMode: 'train',
              			showNextVehicleDeparture: true,
              			color: '#ffff00', //Yellow
              			alternatives: false,
              			},
              			{
              			destination: 'Work 2 Postal Code',
              			label: 'Office 2 - Tram',
              			mode: 'transit',
              			transitMode: 'tram',
              			showNextVehicleDeparture: true,
              			color: '#ffff00', //Yellow
              			alternatives: false,
              			},
              			{
              			destination: 'Work 2 Postal Code',
              			label: 'Office 2 - Bus',
              			mode: 'transit',
              			transitMode: 'bus',
              			showNextVehicleDeparture: true,
              			color: '#ffff00', //Yellow
              			alternatives: false,
              			}
              		]
              	},
              },
              
              1 Reply Last reply Reply Quote 0
              • B Offline
                Bob
                last edited by Aug 30, 2017, 9:20 AM

                @strawberry-3-141 I saw that, and fixed it (just not in my post)

                @yawns I cut and pasted your code (adjusted the API key and the postal codes), and still get the same error (as per previous screenshot)

                1 Reply Last reply Reply Quote 0
                • B Offline
                  Bob
                  last edited by Sep 7, 2017, 5:07 PM

                  I’m guessing no-one has any other ideas ? I wondered if there was a conflict with any other modules, so I’ve done a full rebuild of the RPi, stripped the config to just this module, and it still doesn’t work properly.

                  Ho hum

                  J 1 Reply Last reply Sep 7, 2017, 10:33 PM Reply Quote 0
                  • J Offline
                    j.e.f.f Project Sponsor Module Developer @Bob
                    last edited by Sep 7, 2017, 10:33 PM

                    @Bob I’m the author of this module. Can you send me a private message? I’ll see if I can figure out what’s going on.

                    1 Reply Last reply Reply Quote 0
                    • K Offline
                      knubbl
                      last edited by Sep 17, 2017, 5:40 PM

                      I got the same problem. So im really interested what is the problem and how to fix.

                      Thanks

                      1 Reply Last reply Reply Quote 0
                      • 1
                      • 2
                      • 1 / 2
                      • First post
                        Last post
                      Enjoying MagicMirror? Please consider a donation!
                      MagicMirror created by Michael Teeuw.
                      Forum managed by Sam, technical setup by Karsten.
                      This forum is using NodeBB as its core | Contributors
                      Contact | Privacy Policy