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.

    NSW Fuel Prices

    Scheduled Pinned Locked Moved Unsolved Requests
    21 Posts 3 Posters 12.8k Views 3 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
      k3tan
      last edited by

      Hi,
      I was wondering if someone would be interested in creating a module for the prices of fuel in NSW, Australia? The API can be found here: https://api.nsw.gov.au/fuel-price-check/apis

      Thanks

      strawberry 3.141S 1 Reply Last reply Reply Quote 0
      • strawberry 3.141S Offline
        strawberry 3.141 Project Sponsor Module Developer @k3tan
        last edited by

        @k3tan I registered for an api key. Because I had a really good time when I lived in Australia I might integrate it in the MMM-fuel module.

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

        1 Reply Last reply Reply Quote 1
        • K Offline
          k3tan
          last edited by

          @strawberry-3-141 that would be incredible, thank you for your time and effort. once you’ve done it, PM me your bitcoin address and I’ll be happy to show you my appreciation ;)

          strawberry 3.141S 1 Reply Last reply Reply Quote 0
          • strawberry 3.141S Offline
            strawberry 3.141 Project Sponsor Module Developer @k3tan
            last edited by

            @k3tan I registered for an api key, but every time I’m trying to login the page times out. I will try again in a couple of days.

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

            K 1 Reply Last reply Reply Quote 0
            • K Offline
              k3tan @strawberry 3.141
              last edited by

              @strawberry-3-141 I think they need to approve it. Hopefully it gets approved during business hours. Let me know how you go in a few days time.

              strawberry 3.141S 1 Reply Last reply Reply Quote 0
              • strawberry 3.141S Offline
                strawberry 3.141 Project Sponsor Module Developer @k3tan
                last edited by

                @k3tan meanwhile I was able to login, but I’m still in a pending state :(

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

                K 1 Reply Last reply Reply Quote 0
                • strawberry 3.141S Offline
                  strawberry 3.141 Project Sponsor Module Developer
                  last edited by

                  Seems like your government employes the same lazy folk as mine, it’s still pending.

                  0_1541187504545_e946f0ab-bf8b-43fc-8ea3-6656de668e3f-grafik.png

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

                  1 Reply Last reply Reply Quote 0
                  • K Offline
                    k3tan @strawberry 3.141
                    last edited by

                    @strawberry-3-141 Yep. That’s NSW government for you. Mine is also still pending. zzz.

                    1 Reply Last reply Reply Quote 0
                    • K Offline
                      k3tan
                      last edited by

                      @strawberry-3-141 hey mate, mine just got approved, so I think you can expect yours soon as well

                      strawberry 3.141S 2 Replies Last reply Reply Quote 0
                      • strawberry 3.141S Offline
                        strawberry 3.141 Project Sponsor Module Developer @k3tan
                        last edited by

                        @k3tan I will see if i can find time this weekend.

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

                        1 Reply Last reply Reply Quote 0
                        • strawberry 3.141S Offline
                          strawberry 3.141 Project Sponsor Module Developer @k3tan
                          last edited by

                          @k3tan I played around a little bit this weekend. Sadly the api is documented poorly so it will take a while to figure out all pieces.

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

                          1 Reply Last reply Reply Quote 0
                          • K Offline
                            k3tan
                            last edited by

                            @strawberry-3-141 i’d expect nothing less from our government. thanks for taking a look!

                            strawberry 3.141S 1 Reply Last reply Reply Quote 0
                            • strawberry 3.141S Offline
                              strawberry 3.141 Project Sponsor Module Developer @k3tan
                              last edited by

                              @k3tan I just got a response from the support. Hopefully i can create a prototype during the Christmas holidays.

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

                              K 1 Reply Last reply Reply Quote 0
                              • K Offline
                                k3tan @strawberry 3.141
                                last edited by

                                @strawberry-3-141 fantastic, looking forward to it. thanks once again.

                                strawberry 3.141S 1 Reply Last reply Reply Quote 0
                                • strawberry 3.141S Offline
                                  strawberry 3.141 Project Sponsor Module Developer @k3tan
                                  last edited by strawberry 3.141

                                  @k3tan I finally finished a protoype.

                                  0_1545903899534_f0504b71-08e9-40ec-8c1c-0f1b31d269fb-grafik.png

                                  I’m looking for people who are willing to test prices

                                  • nsw australia

                                  how to test:

                                  • if not already done, clone the repository to your modules cd ~/MagicMirror/modules/ && git clone https://github.com/fewieden/MMM-Fuel.git
                                  • go to the module cd ~/MagicMirror/modules/MMM-Fuel
                                  • run git fetch
                                  • run git checkout feature/api-nsw
                                  • run npm i
                                  • test various config options

                                  [card:fewieden/MMM-Fuel]

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

                                  P 1 Reply Last reply Reply Quote 0
                                  • K Offline
                                    k3tan
                                    last edited by

                                    @strawberry-3-141 hey thanks for putting this together. just trying to test the config options. can you let me know what you put into your config file? API, lat,lng etc?

                                    strawberry 3.141S 1 Reply Last reply Reply Quote 0
                                    • strawberry 3.141S Offline
                                      strawberry 3.141 Project Sponsor Module Developer @k3tan
                                      last edited by strawberry 3.141

                                      @k3tan https://github.com/fewieden/MMM-Fuel/blob/626b1434e64380475f6430086ce47bebb038b8ed/README.md#nsw-australia-nsw-only

                                      {
                                        module: "MMM-Fuel",
                                        position: "top_right",
                                        config: {
                                          provider: 'nsw',
                                          api_key: 'YOUR_API_KEY',
                                          secret: 'YOUR_API_SECRET',
                                          lat: -33.881964,
                                          lng: 151.172128,
                                          types: ["diesel", "e5"],
                                          sortBy: "diesel",
                                          radius: 10,
                                          max: 5,
                                        }
                                      },
                                      

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

                                      K 2 Replies Last reply Reply Quote 0
                                      • K Offline
                                        k3tan @strawberry 3.141
                                        last edited by

                                        @strawberry-3-141
                                        thanks. i’ve just done some testing.

                                        couple of comments so far:

                                        • your ‘E5’ is picking up P95. Can you change the heading to P95?
                                        • your diesel (DL) price is correct for stations that have diesel. however, if the station has premium diesel (PDL), it shows as “>155.9”.

                                        The possible fuel types the API serves are the following:
                                        Ethanol 94 (E10)
                                        Unleaded 91 (U91)
                                        Ethanol 105 (E85)
                                        Premium 95 (P95)
                                        Premium 98 (P98)
                                        Diesel (DL)
                                        Premium Diesel (PDL)
                                        Biodiesel 20 (B20)
                                        LPG (LPG)
                                        CNG/NGV (CNG)
                                        EV charge (EV)

                                        Are all these fuel types supported, or just E5 and Diesel at this stage? If I change the fuel type to E10 for instance, would it work?

                                        Also, I have a list of favorite stations I want to keep tabs on. Is it possible to feed those specific stations in and get the price of those?

                                        thanks for all your help so far, much appreciated!

                                        1 Reply Last reply Reply Quote 0
                                        • K Offline
                                          k3tan @strawberry 3.141
                                          last edited by

                                          @strawberry-3-141 hey mate, just went through some of your code as well as the API itself. i see there’s a page for ‘closest stations’ and a ‘cheapest stations’. is it possible to get like a page of ‘favorites’ where i can input stationcode and display those?
                                          i don’t really need cheapest and closest.
                                          ps. ive also figured out that only P95 and Diesel work at this stage. all good.
                                          cheers

                                          strawberry 3.141S 1 Reply Last reply Reply Quote 0
                                          • strawberry 3.141S Offline
                                            strawberry 3.141 Project Sponsor Module Developer @k3tan
                                            last edited by

                                            @k3tan you’re right e5 => P95 and diesel => DL as their are known here.

                                            If a station is not providing one of the fuel types the module takes the most expensive price for that type that it got as a response and puts a greater than before.

                                            Favourites are not implemented and also not trivial to do, as all data providers are based on nearby searches and limited in the response.

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

                                            1 Reply Last reply Reply Quote 0

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