ElectricMotorcycleForum.com

  • November 25, 2024, 03:55:54 PM
  • Welcome, Guest
Please login or register.

Login with username, password and session length
Advanced search  

News:

Electric Motorcycle Forum is live!

Pages: 1 ... 5 6 [7] 8

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

remmie

  • Sr. Member
  • ****
  • Posts: 318
    • View Profile
Re: SR/F App (NextGen) - API
« Reply #90 on: July 03, 2020, 07:04:17 PM »

Hans,

1) for iOs I think you can use this function, because you already have location points for the poly line points. :
https://developer.apple.com/documentation/corelocation/cllocation/1423689-distance

when you iterate through all the location points when generating the poly line, you can add the length of each segment into a global variable "total distance". When you select a new day it would just add that day's distance to the total, making a grand total of all the selected days.

2) yeah, both are good.

3) not what I originally meant but still a nice feature :) what I meant was, selecting a start and end date (so 2 date selectors) and displaying the route of all the days from start to end. But to get the data from the server you would have to do that day per day.
that was more because now I had to select 12 days in a row which was a real hassle (hahaha NOT). It would just make it a little bit easier. And also in my case you would see the start date and the end date of the vacation trip. Would make a nice Header picture of the photo album :)
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 #91 on: July 03, 2020, 07:24:02 PM »

ok so 3) is for display on the map also but not having to select all dates in between. Got it.
Logged
2021 Energica SS9+ 21.5kWh
--- Belgium ---

Hans2183

  • Sr. Member
  • ****
  • Posts: 468
    • View Profile
Re: SR/F App (NextGen) - API
« Reply #92 on: July 08, 2020, 11:37:24 PM »

Android App has been updated with the colored routes and distance calculation. Haven't done the range selection just yet since I need to verify what times would work. Up next is updating the iOS app first.



both Android and iOS app have 22 active users atm
« Last Edit: July 08, 2020, 11:44:31 PM by Hans2183 »
Logged
2021 Energica SS9+ 21.5kWh
--- Belgium ---

BrianTRice@gmail.com

  • Unofficial Zero Manual Editor
  • Hero Member
  • *****
  • Posts: 4014
  • Nerdy Adventurer
    • View Profile
    • Personal site
Re: SR/F App (NextGen) - API
« Reply #93 on: July 09, 2020, 12:03:26 AM »

Nice work with the map plot!

I updated https://zeromanual.com/wiki/VIN_Guide with the SR/S codes (which were already available in Zero's English SR/S Owner's Manual).
Logged
Current: 2020 DSR, 2012 Suzuki V-Strom
Former: 2016 DSR, 2013 DS

Hans2183

  • Sr. Member
  • ****
  • Posts: 468
    • View Profile
Re: SR/F App (NextGen) - API
« Reply #94 on: July 09, 2020, 12:28:00 AM »

Ha good point about that owners manual. Didn't think of that. I'll keep that in mind when they announce the SR/X  8)

This update was surprisingly simple by the way. Great input from remmie giving these nice feature requests. And then code was just a random color instead of the fixed one to color the line. For distance there was a function to calculate the difference (in meters) between two points.

Getting more than one point at once I'll have to experiment a bit what time should be between requests and so on.
Logged
2021 Energica SS9+ 21.5kWh
--- Belgium ---

remmie

  • Sr. Member
  • ****
  • Posts: 318
    • View Profile
Re: SR/F App (NextGen) - API
« Reply #95 on: July 09, 2020, 01:03:10 AM »

thanks Hans,

I have no android but this is exactly what i had in mind :)
The selecting of multiple days was the least "important" feature for me.
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 #96 on: July 09, 2020, 11:54:20 PM »

just submitted iOS version to appstore. Users that have the test flight builds should already be able to update. The others will follow in a day or so. Typically doesn't take that long for apple since it's a fairly small app.

https://bitbucket.org/cappelleh/zeronextgen/pull-requests/10/ios-release-24/diff



edit: @Remmie that screenshot was from an iPad right? I can see how it's easier to show routes on bigger screens. To be honest the iPad feature only is in the app because I forgot to delete it before publishing for the first time. And once uploaded with iPad features you can't remove it afterwards :D. Never tested it on iPad, probably should start doing that also.
« Last Edit: July 10, 2020, 01:38:46 AM by Hans2183 »
Logged
2021 Energica SS9+ 21.5kWh
--- Belgium ---

remmie

  • Sr. Member
  • ****
  • Posts: 318
    • View Profile
Re: SR/F App (NextGen) - API
« Reply #97 on: July 13, 2020, 02:08:42 AM »

Yes, correct Hans. My picture was made using an iPad. Your update with the colors and the distance works perfect (also on the iPhone). The trip op 3900 km was registered as 3100 km but that was to be expected as the points are each a (few) minutes apart and the distance calculation does that as the crow flies.

Still, great job :)
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)

gb

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: SR/F App (NextGen) - API
« Reply #98 on: October 14, 2020, 01:57:20 PM »

Here's a working sensor config for home assistant :
Code: [Select]

- platform: rest
  name: zero srs
  json_attributes:
    - address
    - altitude
    - analog1
    - chargecomplete
    - charging
    - chargingtimeleft
    - color
    - datetime_actual
    - datetime_utc
    - door
    - driver
    - emergency
    - gps_connected
    - gps_valid
    - heading
    - hood
    - ignition
    - int_lights
    - latitude
    - lock
    - logic_state
    - longitude
    - main_voltage
    - mileage
    - name
    - oil_pressure
    - perimeter
    - pluggedin
    - reason
    - response
    - satellites
    - shock
    - siren
    - soc
    - software_version
    - tipover
    - unitmodel
    - unitnumber
    - unittype
    - velocity
    - volume
    - water_temp
  resource: https://mongol.brono.com/mongol/api.php?commandname=get_last_transmit
  headers:
    User-Agent: Home Assistant
    Content-Type: application/x-www-form-urlencoded
  payload: 'format=json&pass=xxxxxxxx&user=xxxxxxxx&unitnumber=xxxxxxxxx'
  method: POST
  value_template: '{{ value_json[0].soc }}'
  unit_of_measurement: "%"
  scan_interval: 300
Logged

jonblow

  • Newbie
  • *
  • Posts: 20
    • View Profile
Re: SR/F App (NextGen) - API
« Reply #99 on: October 18, 2020, 05:12:29 PM »

Sorry if this question has been posted before but I can no longer get my soc info on either app now, the official one in remote connection or the lovely ZeroNG app that I use a lot as a handy check to see if my bike charged overnight.
I think this functionality broke when I updated my srf to version 18.
Anyone else have this?
Logged

Hans2183

  • Sr. Member
  • ****
  • Posts: 468
    • View Profile
Re: SR/F App (NextGen) - API
« Reply #100 on: October 18, 2020, 05:22:20 PM »

Could be that they decided to break API since it was known here (and elsewhere). But then I would expect the official app to have an update also so theirs keeps working. Did you check if there is an update for the Official Zero app?

You could also try and execute the HTTP commands at the beginning of this thread manually in a browser to make sure the API remains.

I would try it myself but the OTA update to 18 failed on my bike and it doesn't work from the app either for the moment. If I get it updated I'll report back.
Logged
2021 Energica SS9+ 21.5kWh
--- Belgium ---

gadgetgirl

  • Jr. Member
  • **
  • Posts: 68
    • View Profile
Re: SR/F App (NextGen) - API
« Reply #101 on: October 26, 2020, 12:46:03 AM »

Does the app fail to show charging state with remote query too? I had this issue on my SR/F where I got responses in the API and app, but they weren’t updating. After reinstalling the app, unpairing/pairing with no fix, Zero support had me pull the fuse. That resolved it.

Just in case you need that: with the bike keyed off and key out, remove the CCM fuse (Fuse1) and reinstall the fuse. It’s on page 6.34 in the owner’s manual. It’s a bit of a pain to get to.
Logged
Current: 2020 SR/F Premium Seabright Blue (J1772)
Former: 2011 VRSCDX Sedona Orange

ms_smart

  • Newbie
  • *
  • Posts: 49
    • View Profile
Re: SR/F App (NextGen) - API
« Reply #102 on: October 29, 2020, 12:31:09 AM »

I have the same problem with V18. A HTTPS query returns soc=0. I don't think the API changed. It clearly says SOC=0. This is only true if in park state. If active, the API returns correct SOC. The problem immediately popped up after installing V18.

I have opened a ticket with Zero support.
Logged

gb

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: SR/F App (NextGen) - API
« Reply #103 on: November 24, 2020, 03:57:21 PM »

I see the same. Soc is 0 when bike is off, in the API response and in the ios app (which is consistent).
It started occuring since v18 update.
Logged

PaulZero

  • Jr. Member
  • **
  • Posts: 55
    • View Profile
Re: SR/F App (NextGen) - API
« Reply #104 on: February 20, 2021, 11:15:00 PM »

Anyone get any luck with Zero support on the SOC freezing or sitting at 0 since the v18 update?
Logged
Pages: 1 ... 5 6 [7] 8