Using the Plugin
- First, install the plugin
npm install pimatic-uber
- Then you need to register as an Uber Developer.
- Once this is done, create a new app, it doesn't matter what you call it (I called mine 'Pimatic Uber'). You need to keep the Client Id, Client Secret and Server Token for the plugin configuration.
Since our app is for private use, we don't need to apply for permission from Uber.
You can load the plugin by editing your
config.json to include:
Devices can be added by adding them to the
devices Array in the config file. Set the
class property to
For all device configuration options see the device-config-schema file.
Uber Price Estimate Device
For getting your Latitude and Longitude you can use latlong.net.
Start Lat/Long is where you want your starting location to be (for example the location of your home). End Lat/Long is where you want to take the ride to (for example your work location)
sandbox mode sets whether to use the testing or live uber server.
If you want to control which values are displayed, you can use the following:
"showSurge": true,"showETA": true,"showPrice": true
Creating a cache file
To work properly, the
UberPriceEstimateDevice requires a cache file which includes some information on which Uber Product IDs you want to track. See below for an example of Product IDs from Hong Kong:
In future this part will be automatic.
- Automatically create the cache file from available products
- Add ability to order a ride from the web interface (how can I do this?)
- OAuth Client Authorization, how to handle this from our web interface? Additionally we need a web-server for callbacks, how can this fit into pimatic?
Feel free to submit any pull requests or add functionality, I'm usually pretty responsive.
If you like the module, please consider donating some bitcoin or litecoin.