• 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.

MMM-SwissTransport

Scheduled Pinned Locked Moved Transport
transportation
17 Posts 7 Posters 10.9k Views 9 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.
  • K Offline
    kwyjibo089
    last edited by Mar 30, 2017, 8:06 PM

    Great module. Already added it to my mirror. Is there any chance I could filter the list and display only trains? If I put in my Station (Wädenswil) I get lots of busses and also boats.

    1 Reply Last reply Reply Quote 0
    • B Offline
      Bangee Module Developer
      last edited by Mar 31, 2017, 11:21 AM

      @kwyjibo089, yes it’s possible:

      change the line function getParams() like this:

      	/* getParams()
      	 * Generates an url with api parameters based on the config.
      	 *
      	 * return String - URL params.
      	 */
      	getParams: function() {
      		var params = "?";
                      params += "id=" + this.config.id;
      		params += "&limit=" + this.config.maximumEntries;
                      params += "&transportations[]=ec_ic&transportations[]=s_sn_r&transportations[]=ir&transportations[]=re_d&transportations[]=ice_tgv_rj";
      
      		return params;
      },
      
      

      The line params += "&transportations[]=ec_ic&transportations[]=s_sn_r..."; is new an should allow you to filter the transportation object.

      Here are all option:
      transportations
      Transportation means; one or more of ice_tgv_rj, ec_ic, ir, re_d, ship, s_sn_r, bus, cableway, arz_ext, tramway_underground
      example:
      &transportations[]=ec_ic&transportations[]=bus

      Source: http://transport.opendata.ch/docs.html#section

      It’s not testet yet, but I think it should work for you.

      Have fun,

      Gruss aus Oberrieden :-)

      K 1 Reply Last reply Mar 31, 2017, 5:10 PM Reply Quote 0
      • K Offline
        kwyjibo089 @Bangee
        last edited by Mar 31, 2017, 5:10 PM

        nice, works like a charm! thanks a lot!

        1 Reply Last reply Reply Quote 0
        • B Offline
          Bangee Module Developer
          last edited by Dec 18, 2017, 3:18 PM

          I’ve made an update. Now it works with a node_helper.js so you will have less problems with CORS errors.

          Have fun

          1 Reply Last reply Reply Quote 1
          • M Offline
            mydiva
            last edited by Dec 19, 2017, 9:40 AM

            Hi @Bangee
            Now it stays with connection and shows nothing else. I tried a clean install of the module but it did’t work anymore.

            1 Reply Last reply Reply Quote 0
            • B Offline
              BenGig
              last edited by Dec 21, 2017, 6:00 PM

              Has the station ID based data source been dropped by search.ch? Connections are not so convenient as station departure times. I have a bus stop nearby and want do display all departures, one particular connection is not informative enough.

              1 Reply Last reply Reply Quote 0
              • V Offline
                vanhoekd
                last edited by Dec 22, 2017, 12:24 PM

                Departure times have not been dropped by Search.ch. I had the same Issue as BenGig and then just reverted to the old version, which is still working.

                K 1 Reply Last reply Dec 30, 2017, 3:02 PM Reply Quote 0
                • K Offline
                  kwyjibo089 @vanhoekd
                  last edited by Dec 30, 2017, 3:02 PM

                  @vanhoekd said in MMM-SwissTransport:

                  just reverted to the old version, which is still working.

                  how do you do that?

                  1 Reply Last reply Reply Quote 0
                  • V Offline
                    vanhoekd
                    last edited by vanhoekd Jan 2, 2018, 8:23 AM Jan 2, 2018, 8:23 AM

                    Use

                    git checkout sha1
                    

                    to check out a particular commit.
                    where sha1 is the number of the commit on this site: Git repo

                    1 Reply Last reply Reply Quote 0
                    • 1
                    • 2
                    • 2 / 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