ElectricMotorcycleForum.com

  • November 25, 2024, 06:41:11 PM
  • Welcome, Guest
Please login or register.

Login with username, password and session length
Advanced search  

News:

Electric Motorcycle Forum is live!

Pages: 1 2 3 [4] 5 6 ... 8

Author Topic: SR/F App (NextGen) - API  (Read 10827 times)

Hans2183

  • Sr. Member
  • ****
  • Posts: 468
    • View Profile
Re: SR/F App (NextGen) - API
« Reply #45 on: November 24, 2019, 11:46:32 PM »

drawing the circle on map with a given radius based on current SOC and settings from the estimator tool was easy



But indeed that is a straight line. For more data on what you passed as a rider we can query on this api using time but not based on position. So it would require getting data for a day first and then filter within that data for positions. Something must be possible but we'll have to think it through.

For 2 points on a map I also can get the distance but again that distance is in a straight line. Not sure what APIs exist to get actual routes.
Logged
2021 Energica SS9+ 21.5kWh
--- Belgium ---

remmie

  • Sr. Member
  • ****
  • Posts: 318
    • View Profile
Re: SR/F App (NextGen) - API
« Reply #46 on: November 25, 2019, 12:16:22 AM »

https://developer.tomtom.com/products/ev-route-planning-use-case

this API from TomTom looks like it has a lot of nice features specially for EV's.
I have no idea wheter it is free or payed.

quote : POST GET Calculate Reachable Range
This service calculates a set of locations that can be reached from the origin point, subject to the available fuel or energy budget that is specified in the request.
Logged
Current : Red Premium Zero SR/F (ordered May 25, delivered August 23 2019) with Rapid charger for 12kW charging
Former : White Zero SR 2018 ZF14.4 kWh (17.500 km)
Former : Black Zero SR 2014 ZF11.4 kWh (25.000 km)
SR's outfitted with Homemade "Supercharger" 6x eltek Flatpack S (12 kW)

remmie

  • Sr. Member
  • ****
  • Posts: 318
    • View Profile
Re: SR/F App (NextGen) - API
« Reply #47 on: November 25, 2019, 02:16:53 AM »

I registered for an API key which was free and if i read it correctly you can do 2500 transactions per day for free.

i used an example request around my location and got a set of coordinates in JSON format, i then converted that to csv coordinates with an online converter (took some tries and deletion of some data of the JSON response) and then fed the data into GPSvisualizer. This got a nice looking boundary box of reachable range. (see picture). i reckon that a proper programmer should not have to take all these side steps, LOL

The request even contains a variable for energy consumed per 100 km which we should adapt to the SR/F.  It is in the form of
{"key":"constantSpeedConsumptionInkWhPerHundredkm","value":"50,8.2:130,21.3"}
which I read to be "at 50 kph the consumption is 8.2kWh per 100 km and at 130 kph 21.3 kwH per 100 km"
This would be a lot lower for the SR/F. Having the current Wh/km readout on the dash and going a constant 50 and 130 should be easy to do. Or maybe we can just enter the ranges Zero claims on their website

another parameter is the current available kwh : energyBudgetInkWh=12 which is easily determined by max kwh (12.6 for the SR/F) and the current SOC. So when the SOC is getting lower the boundary box would get smaller

the full command i used was (api key removed for obvious reasons :)
curl -X GET "https://api.tomtom.com/routing/1/calculateReachableRange/51.500000,4.700000/json?\
> energyBudgetInkWh=12&report=effectiveSettings\
> &routeType=eco&traffic=true&avoid=unpavedRoads&travelMode=car&vehicleMaxSpeed=120\
> &vehicleCommercial=false&vehicleEngineType=electric\
> &constantSpeedConsumptionInkWhPerHundredkm=50%2C8.2%3A130%2C21.3\
> &key=xxxxxxxxxxxxxxxxxxx" -H "accept: */*"

Logged
Current : Red Premium Zero SR/F (ordered May 25, delivered August 23 2019) with Rapid charger for 12kW charging
Former : White Zero SR 2018 ZF14.4 kWh (17.500 km)
Former : Black Zero SR 2014 ZF11.4 kWh (25.000 km)
SR's outfitted with Homemade "Supercharger" 6x eltek Flatpack S (12 kW)

Hans2183

  • Sr. Member
  • ****
  • Posts: 468
    • View Profile
Re: SR/F App (NextGen) - API
« Reply #48 on: November 25, 2019, 04:06:05 PM »

nice find Remmie, looks promising. I'll look into adding that to the app.
Logged
2021 Energica SS9+ 21.5kWh
--- Belgium ---

ben.m

  • Newbie
  • *
  • Posts: 35
    • View Profile
Re: SR/F App (NextGen) - API
« Reply #49 on: November 27, 2019, 02:28:51 PM »

Just downloaded you app yesterday, and a major update this morning, on iPhone.

Great job ! Continue that way.
The only thing i noticed is you calculation is very very optimistic ! Your estimated range is twice the reality range.
Logged

Hans2183

  • Sr. Member
  • ****
  • Posts: 468
    • View Profile
Re: SR/F App (NextGen) - API
« Reply #50 on: November 27, 2019, 02:51:52 PM »

Thanks Ben

Did you play with the options that cause penalties on the range? Like riding style and temperature? There is a set of values I use as a baseline based on the road type. That then is adjusted based on charge and penalties given for dynamic riding style, hills in landscape and/or temperatures.

Code: [Select]
Fixed value for each scenario:

city = 287 km
road = 174 km
mixed city/road = 216 km
highway = 143 km
mixed city/highway = 193 km

Penalty (percentage off) based on:

riding style

conservative (as is)
agressive -10%

landscape

flat (as is)
hills -10%

weather

warm = as is
mild = -5%
cold = -5%

The initial numbers are based on the values in the Zero app. So it all seems to match up pretty wel. Just checked city scenario now. Always possible that I messed up a number.

I have all penalties on at the moment and it seems to match what I get in actual range. It is cold and hilly over here.

I could make those initial numbers configurable? Or have a custom road type where you pick what range you think it makes for your style of riding.

Do you use it in miles? Maybe I have an issue in conversion.

The circle on the map is for sure way too optimistic. It's using the parameters from the range estimator but it's just a straight line and in reality you have to follow roads. That's what remmie was looking into with the more realistic route calculations.
Logged
2021 Energica SS9+ 21.5kWh
--- Belgium ---

ben.m

  • Newbie
  • *
  • Posts: 35
    • View Profile
Re: SR/F App (NextGen) - API
« Reply #51 on: November 27, 2019, 03:07:34 PM »

Actually the circle is pretty good for me and the estimated range is way too optimistic.
Try to post attachments to show you.
It shows me 48 kms with agressive/hills/cold, in real life i can do less 40kms with very conservative driving, 20°C and almost flat road with these 31% left ;)
Logged

remmie

  • Sr. Member
  • ****
  • Posts: 318
    • View Profile
Re: SR/F App (NextGen) - API
« Reply #52 on: November 27, 2019, 03:22:02 PM »

Then you are probably better off choosing road instead of road/city.
City is not constant 50 kph but way less (stop and go traffic) And a road city combination would in my book be 50% road 50% city.

Because range is so highly dependent on speed, it takes some learning to choose the right figures.

Btw Hans, is it possible to have the options for road/city/highway etc in a sort order that would be from highest range to lowest instead of alphabetical ?
Logged
Current : Red Premium Zero SR/F (ordered May 25, delivered August 23 2019) with Rapid charger for 12kW charging
Former : White Zero SR 2018 ZF14.4 kWh (17.500 km)
Former : Black Zero SR 2014 ZF11.4 kWh (25.000 km)
SR's outfitted with Homemade "Supercharger" 6x eltek Flatpack S (12 kW)

ben.m

  • Newbie
  • *
  • Posts: 35
    • View Profile
Re: SR/F App (NextGen) - API
« Reply #53 on: November 27, 2019, 03:35:53 PM »

For sure i know that range is subject to a lot of things. But after almost 4000 kms on that bike i know it enough.
I tried a lot of combinations in the app, i can do only half the estimated range, whatever the combination.
Logged

Hans2183

  • Sr. Member
  • ****
  • Posts: 468
    • View Profile
Re: SR/F App (NextGen) - API
« Reply #54 on: November 27, 2019, 06:14:38 PM »

thanks for the feedback guys

@remmie: I'll change the order from highest to lowest range in the next update

@ben.m: I'll make you a "custom" option in that spinner where you can just give a max range number yourself and that will calculate with the current percentage.
Logged
2021 Energica SS9+ 21.5kWh
--- Belgium ---

ben.m

  • Newbie
  • *
  • Posts: 35
    • View Profile
Re: SR/F App (NextGen) - API
« Reply #55 on: November 27, 2019, 07:13:01 PM »

@ben.m: I'll make you a "custom" option in that spinner where you can just give a max range number yourself and that will calculate with the current percentage.

Don't waste your time for that, when you know your bike it's useless to have a tool to estimate the range  ;)
And we have to let our brains do a part of the job  8)
Logged

Hans2183

  • Sr. Member
  • ****
  • Posts: 468
    • View Profile
Re: SR/F App (NextGen) - API
« Reply #56 on: December 13, 2019, 04:47:12 PM »

Just pushed another update to the Google Play store (iOS will follow later this week) to add a date selection below map and then it shows the registered positions for that date as a polyline.

To keep it simple I've limited to single day selection and it will fetch for that date from 00:00:00 to 23:59:59. You can however select more dates in a row and the data will build upon the map. There is clear option to remove previous points.

Added screenshot is just demo data so not that useful.



For mine I noticed that it never registered in California. Instead the first valid points are from the center of the map (0,0) and then a straight line to the dealer where it probably got activated.

Didn't get to the notifications yet but that is a feature I could use myself to have custom notifications based on whatever property is available.



Logged
2021 Energica SS9+ 21.5kWh
--- Belgium ---

electrik

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: SR/F App (NextGen) - API
« Reply #57 on: December 15, 2019, 10:28:07 PM »

Guys,

I just bought an ex-demo SRF yesterday and trying to register on nextgen app but I'm getting an error saying that I need to be connected to motorcycle via bluetooth. I am already connected to the motorcycle but no matter what I do, the app won't let me register.

I'm 100% sure that my mobile device is connected to motorcycle via bluetooth. When not connected, it simply says I need to be connected but when connected, it says the same thing but in a longer version. My guess is someone at the dealership already tried to registered with my VIN. I dropped a message to Zero but just checking if anyone else had this issue.

Cheers
Logged

Hans2183

  • Sr. Member
  • ****
  • Posts: 468
    • View Profile
Re: SR/F App (NextGen) - API
« Reply #58 on: December 15, 2019, 10:50:18 PM »

Haven't tried out how to reset or change the password yet. And you have the added difficulty that the vin is probably already linked to an account. So once you know how I'm very interested.

I guess your beste chance is to call zero and ask them how to do this step by step.

Also congrats ot the bike!
Logged
2021 Energica SS9+ 21.5kWh
--- Belgium ---

ben.m

  • Newbie
  • *
  • Posts: 35
    • View Profile
Re: SR/F App (NextGen) - API
« Reply #59 on: December 16, 2019, 02:22:29 PM »

Yes they need to link your vin to you account.
I had the same trouble when received mine, i had to wait until zero did something, it's not something you can do on your own ;)
Logged
Pages: 1 2 3 [4] 5 6 ... 8