[APP][Pro] Niu

Niu - World’s #1 Smart Electric Scooter.

Adds support for NIU Scooters




Usage

  • Install this app on your Homey.
  • Go to the app settings and provide your Username and Password. Click Save Changes
  • Acces token will be fetched and filled in to the settings page.
  • Connect a vehicle to Homey Niu
  • Check statuses or create flows.

Current features:

  • Battery percentage
  • Battery temperature
  • Battery health
  • Battery charging
  • Remaining mileage
  • Energy consumed Today
  • Is scooter locked
  • Is scooter home (based on Homey’s location)
  • Data updates every 10 minutes

Supported Languages:

  • :uk: English
  • :netherlands: Dutch


Contributions
If you appreciate this app, contribute to future development by making a paypal contribution
or buy me a coffee on Ko-Fi or Bunq.me

image ko-fiimage


:computer: Apps made by @martijnpoppen

See for more apps link below :point_down:t2: or just open the pull down.

2 Likes

Changelog

Live version and Test version

Changelog can be viewed on the app page.

1 Like

Reserved 2

New app update (live: 1.0.5 ):

  • NEW: Niu mobility release
  • Added icons (thanks @RobbertV )
  • Add new values: Last ride time / Last ride distance / Battery connected / Battery ECU

Flowcards:

Works like a charm, other people should use it as well!

1 Like

Thanks @Rens_Hoekema :smiley:

New app update (live: 1.0.7 ):

  • Update interval settings. Change the update interval in the app settings

Created 2 flows for charging

New app update (live: 1.0.10 ):

  • Add new values: Last ride time / Last ride distance / Battery connected / Battery ECU

Flow cards:
image

1 Like

Hi @martijnpoppen - this looks nice and i just bought a NIU Mqi+ Sport :slight_smile:

But I have trouble using this app, what I enter on settings do not get saved.
Also note that NIU can have phone as account detail and not always an email - I f.ex only registered with phone number. (also you write that you should enter +46 f.ex. the NUI API use only 46 - but maybe that is handled in your code?

(And another suggestion is to use the device/driver login flow so user can enter credentials there instead of doing it on settings, better flow/ux for the user.)

I am looking forward to be able to test/use this app - keep up the good work (I was just going to write one myself :slight_smile: )

/Jonathan

Now I got it to connect, it saves and returns a token… :slight_smile:

FYI…
I remove the + sign and leading 0 of my phonenumber…

But still cannot list devices, it just runs for a while and then say “check settings”…

Hey @Jonathan_Cohen ,
I’ll have a look at that.
I use it without a + because the code handles it. I attached the link to the country codes. I understand you read the api so that why you put in the + :stuck_out_tongue:

For account I only tested with Email. Didn’t know it was possible with a phone number. I don’t own the Niu myself. (borrowed the account from Rens).

Did you try the M series?

Yes @martijnpoppen i tried to connect the m-series.

@Jonathan_Cohen I updated the app. Can you retry? version 1.0.11
I added a pairing filter for the devices. But probably the M series doesn’t start with an M in the ID

@Jonathan_Cohen
Would you mind sharing your Vehicle SN? Then I can try to find a pattern in the SN’s and put back the filtering in the pairing screen. You can send an diagnostic report if you want

Also confirmed that the country_code works without an +. Saw this on the Home assistant forum.
About the phone number maybe it should be with an double 00? Not sure. Cannot find it in the API.

Do you have an example for this? I see a lot of apps using the Configure App settings. So curious how that would work :slight_smile:

I can confirm that i can connect to my NUI now, Thanks (it never showed up in UI, just spinning icon - but closed and there it was).

About account/phone etc, I had a look at this and also mocked around with it: niu-cloud-connector/API.md at master · BlueAndi/niu-cloud-connector · GitHub

They state: Telephone country count without leading zeros or + sign, e.g. 49 instead of 0049 or +49 ( and that worked for me).

Some things I can see now

  1. The lock/unlock does not work for me → “(Un)Locking not possible”
  2. Battery show 0%

I can later this evening check a bit both in the API and your code and see if I find things.
About login flow: Custom Views - Homey Apps SDK v3 Documentation
There you could gather the information needed to continue ti list vehichles, and save to settings (for next veichle)

Anyway - thanks for great work and I will use/test this App :slight_smile:

1 Like

Hi Jonathan,

I think lock/unlock is not something you can do remote. It just shows if the contact is on or off

1 Like

@Jonathan_Cohen
Yes Rens is right. The API is read-only. But I really wanted to use the lock capability for the visuals :stuck_out_tongue:

I use the same cloud-connector as you showed.
Telephone country count without leading zeros or + sign, e.g. 49 instead of 0049 or +49.
I thought it was WITH + or 00 :expressionless:
So that’s correct will change it in the settings page.

Strange that the battery is not working. Can you share a diagnostic report?

Yeah I know that’s possible. But never saw anybody using that. Also I think the effort is too much for the result. Most apps use the Configure app. So most Homey users know where to find these settings. :wink:

@martijnpoppen - Now battery is working, I saw it was not reporting in NIU’s own app either. Started up the scooter and now it is visible on both apps. I have been in contact about this with NIU and I need an update to my ECU, it does not charge and do not hold battery after turning of my scooter - so your app is working fine!

Still a bit confusing with the lock/unlock also in the flow, but as UX/visibility on the app icon it is good to see the state :slight_smile:

1 Like

@Jonathan_Cohen Really nice to hear! Thanks

Yeah the lock/unlock is indeed confusing. But as far as I know you cannot remove flows from standard capabilities. :confused: