# \[APP\]\[Pro\] Niu

**URL:** <https://community.homey.app/t/app-pro-niu/46185>\
**Category:** Apps\
**Tags:** app, official, homey-pro\
**Created:** [April 12, 2021, 11:18pm UTC](https://community.homey.app/t/app-pro-niu/46185 "2021-04-12T23:18:26Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![martijnpoppen](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/martijnpoppen/32/84849_2.png) [@martijnpoppen](https://community.homey.app/u/martijnpoppen)\
**Post date:** [April 12, 2021, 11:18pm UTC](https://community.homey.app/t/app-pro-niu/46185/1 "2021-04-12T23:18:26Z")

</div>

## **Niu - _World’s #1 Smart Electric Scooter._**

_Adds support for NIU Scooters_

* * *

> **[Niu | Homey](https://homey.app/nl-nl/app/com.niu.mobility/Niu/)**
>
> World’s #1 Smart Electric Scooter.

* * *
  

**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:**

- 🇬🇧 English
- 🇳🇱 Dutch

  

* * *

**Contributions**  
If you appreciate this app, contribute to future development by making a [paypal contribution](https://www.paypal.me/martijnpoppen)  
or buy me a coffee on [Ko-Fi](https://ko-fi.com/martijnpoppen#checkoutModal) or [Bunq.me](https://bunq.me/MartijnPoppen)

[![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/2/9/2916364caa1239076c12be293d270d5980d9d272.png)](https://paypal.me/martijnpoppen) [![ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/martijnpoppen#checkoutModal)[![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/8/4/8449771d527e7184562e1301d641dfc1e99a4261.png)](https://bunq.me/MartijnPoppen)

* * *

## 💻 Apps made by @martijnpoppen

See for more apps link below 👇🏻 or just open the pull down.

> [@Apps made by @martijnpoppen](https://community.homey.app/t/apps-made-by-martijnpoppen/85812/1):
>
> Click to expand

---

<div class="post-metadata">

**Author:** ![martijnpoppen](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/martijnpoppen/32/84849_2.png) [@martijnpoppen](https://community.homey.app/u/martijnpoppen)\
**Post date:** [April 12, 2021, 11:19pm UTC](https://community.homey.app/t/app-pro-niu/46185/2 "2021-04-12T23:19:00Z")

</div>

## Changelog

**Live version and Test version**

> Changelog can be viewed on the app page.

---

<div class="post-metadata">

**Author:** ![martijnpoppen](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/martijnpoppen/32/84849_2.png) [@martijnpoppen](https://community.homey.app/u/martijnpoppen)\
**Post date:** [April 12, 2021, 11:19pm UTC](https://community.homey.app/t/app-pro-niu/46185/3 "2021-04-12T23:19:05Z")

</div>

Reserved 2

---

<div class="post-metadata">

**Author:** ![martijnpoppen](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/martijnpoppen/32/84849_2.png) [@martijnpoppen](https://community.homey.app/u/martijnpoppen)\
**Post date:** [April 13, 2021, 9:33am UTC](https://community.homey.app/t/app-pro-niu/46185/4 "2021-04-13T09:33:34Z")

</div>

## New app update (live: [1.0.5](https://homey.app/nl-nl/app/com.niu.mobility/Niu/)):

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

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/e/6/e6b509f893937523ecc3b477fcd5f18c97969ff6.png) ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/d/2/d28b827543ef9e1a38db29443d23d56c69f8b8db.png)

Flowcards:

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/7/e/7e16d55fcb1ea2d0524ed78668a4ee1caaffb67b.png)

---

<div class="post-metadata">

**Author:** ![Rens\_Hoekema](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/rens_hoekema/32/12848_2.png) [@Rens\_Hoekema](https://community.homey.app/u/Rens_Hoekema)\
**Post date:** [April 13, 2021, 10:19am UTC](https://community.homey.app/t/app-pro-niu/46185/5 "2021-04-13T10:19:52Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![martijnpoppen](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/martijnpoppen/32/84849_2.png) [@martijnpoppen](https://community.homey.app/u/martijnpoppen)\
**Post date:** [April 13, 2021, 10:26am UTC](https://community.homey.app/t/app-pro-niu/46185/6 "2021-04-13T10:26:45Z")

</div>

Thanks @Rens_Hoekema😃

---

<div class="post-metadata">

**Author:** ![martijnpoppen](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/martijnpoppen/32/84849_2.png) [@martijnpoppen](https://community.homey.app/u/martijnpoppen)\
**Post date:** [April 13, 2021, 11:35am UTC](https://community.homey.app/t/app-pro-niu/46185/7 "2021-04-13T11:35:27Z")

</div>

## New app update (live: [1.0.7](https://homey.app/nl-nl/app/com.niu.mobility/Niu/)):

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

---

<div class="post-metadata">

**Author:** ![Rens\_Hoekema](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/rens_hoekema/32/12848_2.png) [@Rens\_Hoekema](https://community.homey.app/u/Rens_Hoekema)\
**Post date:** [April 13, 2021, 8:50pm UTC](https://community.homey.app/t/app-pro-niu/46185/8 "2021-04-13T20:50:00Z")

</div>

Created 2 flows for charging

[https://homey.app/f/O4e\_cz/](https://homey.app/f/O4e_cz/)  
[https://homey.app/f/B8T\_cz/](https://homey.app/f/B8T_cz/)

---

<div class="post-metadata">

**Author:** ![martijnpoppen](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/martijnpoppen/32/84849_2.png) [@martijnpoppen](https://community.homey.app/u/martijnpoppen)\
**Post date:** [April 13, 2021, 10:23pm UTC](https://community.homey.app/t/app-pro-niu/46185/9 "2021-04-13T22:23:42Z")

</div>

## New app update (live: [1.0.10](https://homey.app/nl-nl/app/com.niu.mobility/Niu)):

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

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/d/2/d28b827543ef9e1a38db29443d23d56c69f8b8db.png)

Flow cards:

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/5/1/513bdb3bbd2d30e3755a5ca11356ded6c9cb172e.png)

---

<div class="post-metadata">

**Author:** ![Jonathan\_Cohen](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/jonathan_cohen/32/32700_2.png) [@Jonathan\_Cohen](https://community.homey.app/u/Jonathan_Cohen)\
**Post date:** [April 19, 2021, 10:38am UTC](https://community.homey.app/t/app-pro-niu/46185/10 "2021-04-19T10:38:28Z")

</div>

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

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 🙂 )

/Jonathan

---

<div class="post-metadata">

**Author:** ![Jonathan\_Cohen](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/jonathan_cohen/32/32700_2.png) [@Jonathan\_Cohen](https://community.homey.app/u/Jonathan_Cohen)\
**Post date:** [April 19, 2021, 10:45am UTC](https://community.homey.app/t/app-pro-niu/46185/11 "2021-04-19T10:45:37Z")

</div>

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

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

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/7/3/733a0ffe7b36ac17cbc5eb59260c5f072b6760bb.png)

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

---

<div class="post-metadata">

**Author:** ![martijnpoppen](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/martijnpoppen/32/84849_2.png) [@martijnpoppen](https://community.homey.app/u/martijnpoppen)\
**Post date:** [April 19, 2021, 10:53am UTC](https://community.homey.app/t/app-pro-niu/46185/12 "2021-04-19T10:53:07Z")

</div>

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 + 😛

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?

---

<div class="post-metadata">

**Author:** ![Jonathan\_Cohen](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/jonathan_cohen/32/32700_2.png) [@Jonathan\_Cohen](https://community.homey.app/u/Jonathan_Cohen)\
**Post date:** [April 19, 2021, 10:57am UTC](https://community.homey.app/t/app-pro-niu/46185/13 "2021-04-19T10:57:30Z")

</div>

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

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/0/7/07c2cff845912006ee340ac1ee9727989bb3e427.png)

---

<div class="post-metadata">

**Author:** ![martijnpoppen](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/martijnpoppen/32/84849_2.png) [@martijnpoppen](https://community.homey.app/u/martijnpoppen)\
**Post date:** [April 19, 2021, 11:06am UTC](https://community.homey.app/t/app-pro-niu/46185/14 "2021-04-19T11:06:03Z")

</div>

@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

---

<div class="post-metadata">

**Author:** ![martijnpoppen](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/martijnpoppen/32/84849_2.png) [@martijnpoppen](https://community.homey.app/u/martijnpoppen)\
**Post date:** [April 19, 2021, 11:43am UTC](https://community.homey.app/t/app-pro-niu/46185/15 "2021-04-19T11:43:12Z")

</div>

@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.

> [@Jonathan\_Cohen](#):
>
> (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.)

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

---

<div class="post-metadata">

**Author:** ![Jonathan\_Cohen](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/jonathan_cohen/32/32700_2.png) [@Jonathan\_Cohen](https://community.homey.app/u/Jonathan_Cohen)\
**Post date:** [April 19, 2021, 12:45pm UTC](https://community.homey.app/t/app-pro-niu/46185/16 "2021-04-19T12:45:23Z")

</div>

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](https://github.com/BlueAndi/niu-cloud-connector/blob/master/doc/API.md)

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](https://apps-sdk-v3.developer.athom.com/tutorial-Drivers-Pairing-Custom%20Views.html)  
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 🙂

---

<div class="post-metadata">

**Author:** ![Rens\_Hoekema](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/rens_hoekema/32/12848_2.png) [@Rens\_Hoekema](https://community.homey.app/u/Rens_Hoekema)\
**Post date:** [April 19, 2021, 12:54pm UTC](https://community.homey.app/t/app-pro-niu/46185/17 "2021-04-19T12:54:47Z")

</div>

Hi Jonathan,

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

---

<div class="post-metadata">

**Author:** ![martijnpoppen](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/martijnpoppen/32/84849_2.png) [@martijnpoppen](https://community.homey.app/u/martijnpoppen)\
**Post date:** [April 19, 2021, 1:01pm UTC](https://community.homey.app/t/app-pro-niu/46185/18 "2021-04-19T13:01:34Z")

</div>

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

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 😑  
So that’s correct will change it in the settings page.

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

> [@Jonathan\_Cohen](#):
>
> About login flow: [Custom Views - Homey Apps SDK v3 Documentation](https://apps-sdk-v3.developer.athom.com/tutorial-Drivers-Pairing-Custom%20Views.html)  
> There you could gather the information needed to continue ti list vehichles, and save to settings (for next veichle)

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. 😉

---

<div class="post-metadata">

**Author:** ![Jonathan\_Cohen](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/jonathan_cohen/32/32700_2.png) [@Jonathan\_Cohen](https://community.homey.app/u/Jonathan_Cohen)\
**Post date:** [April 22, 2021, 7:08pm UTC](https://community.homey.app/t/app-pro-niu/46185/19 "2021-04-22T19:08:36Z")

</div>

@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 🙂

---

<div class="post-metadata">

**Author:** ![martijnpoppen](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/martijnpoppen/32/84849_2.png) [@martijnpoppen](https://community.homey.app/u/martijnpoppen)\
**Post date:** [April 22, 2021, 7:23pm UTC](https://community.homey.app/t/app-pro-niu/46185/20 "2021-04-22T19:23:40Z")

</div>

@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. 😕

[Next page](https://community.homey.app/t/app-pro-niu/46185.md?page=2)
