# Dev module xiaomi v4

**URL:** <https://community.gladysassistant.com/t/dev-module-xiaomi-v4/4803>\
**Category:** Développement\
**Created:** [July 2, 2019, 6:36pm UTC](https://community.gladysassistant.com/t/dev-module-xiaomi-v4/4803 "2019-07-02T18:36:29Z")\
**Posts on this page:** 20\
**Page:** 3

<div class="post-metadata">

**Author:** ![damalgos](https://gladys-assistant-community.b-cdn.net/letter_avatar_proxy/v4/letter/d/e274bd/32.png) [@damalgos](https://community.gladysassistant.com/u/damalgos)\
**Post date:** [July 18, 2019, 7:32pm UTC](https://community.gladysassistant.com/t/dev-module-xiaomi-v4/4803/51 "2019-07-18T19:32:32Z")

</div>

> [@Jacky](#):
>
> Well, it doesn’t seem to work under Windows WSL, I don’t see any equipment, but also no log or error.

The problem may be that the equipment sometimes takes time to react… So you have to wait.

---

<div class="post-metadata">

**Author:** ![link39](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/link39/32/3756_2.png) [@link39](https://community.gladysassistant.com/u/link39)\
**Post date:** [July 18, 2019, 7:33pm UTC](https://community.gladysassistant.com/t/dev-module-xiaomi-v4/4803/52 "2019-07-18T19:33:38Z")

</div>

If you have a door opening sensor, you will immediately see if it works by moving it.

---

<div class="post-metadata">

**Author:** ![damalgos](https://gladys-assistant-community.b-cdn.net/letter_avatar_proxy/v4/letter/d/e274bd/32.png) [@damalgos](https://community.gladysassistant.com/u/damalgos)\
**Post date:** [July 18, 2019, 7:36pm UTC](https://community.gladysassistant.com/t/dev-module-xiaomi-v4/4803/53 "2019-07-18T19:36:10Z")

</div>

> [@link39](#):
>
> Victory, I finally succeeded on Windows 10!!!

Yes! Thanks, great I plan to do that! 🙂 I’ll need to add the IP address, let’s see if I can retrieve it easily. Thanks!!

---

<div class="post-metadata">

**Author:** ![damalgos](https://gladys-assistant-community.b-cdn.net/letter_avatar_proxy/v4/letter/d/e274bd/32.png) [@damalgos](https://community.gladysassistant.com/u/damalgos)\
**Post date:** [July 18, 2019, 7:55pm UTC](https://community.gladysassistant.com/t/dev-module-xiaomi-v4/4803/55 "2019-07-18T19:55:39Z")

</div>

> [@Jacky](#):
>
> It’s been more than 20 minutes ^^

I admit it’s taking a while, but what type of device do you have?

---

<div class="post-metadata">

**Author:** ![damalgos](https://gladys-assistant-community.b-cdn.net/letter_avatar_proxy/v4/letter/d/e274bd/32.png) [@damalgos](https://community.gladysassistant.com/u/damalgos)\
**Post date:** [July 18, 2019, 7:57pm UTC](https://community.gladysassistant.com/t/dev-module-xiaomi-v4/4803/56 "2019-07-18T19:57:47Z")

</div>

By chance @Jacky did you enable developer mode on the gateway??

---

<div class="post-metadata">

**Author:** ![link39](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/link39/32/3756_2.png) [@link39](https://community.gladysassistant.com/u/link39)\
**Post date:** [July 18, 2019, 8:15pm UTC](https://community.gladysassistant.com/t/dev-module-xiaomi-v4/4803/59 "2019-07-18T20:15:43Z")

</div>

With Wireshark, can you see the multicast packets arriving on your PC?

---

<div class="post-metadata">

**Author:** ![damalgos](https://gladys-assistant-community.b-cdn.net/letter_avatar_proxy/v4/letter/d/e274bd/32.png) [@damalgos](https://community.gladysassistant.com/u/damalgos)\
**Post date:** [July 18, 2019, 8:43pm UTC](https://community.gladysassistant.com/t/dev-module-xiaomi-v4/4803/61 "2019-07-18T20:43:07Z")

</div>

Weird anyway … You tell me again with the raspberry pi

---

<div class="post-metadata">

**Author:** ![Boimb](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/boimb/32/225_2.png) [@Boimb](https://community.gladysassistant.com/u/Boimb)\
**Post date:** [July 18, 2019, 10:16pm UTC](https://community.gladysassistant.com/t/dev-module-xiaomi-v4/4803/64 "2019-07-18T22:16:20Z")

</div>

If you load the dev seeds in the DB, you should be able to log in with the demo account.

> [@Jacky](#):
>
> The page calls certain API requests on localhost

You have a config file to set the server URLs. API http and ws.  
Edit: front/config.js

---

<div class="post-metadata">

**Author:** ![Boimb](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/boimb/32/225_2.png) [@Boimb](https://community.gladysassistant.com/u/Boimb)\
**Post date:** [July 18, 2019, 10:54pm UTC](https://community.gladysassistant.com/t/dev-module-xiaomi-v4/4803/66 "2019-07-18T22:54:50Z")

</div>

> [@Jacky](#):
>
> it was hardcoded in the app

Well… it’s variabilized in a config file. Front and back are two stand-alone apps. So you have to specify to the front where it should hit 😉

---

<div class="post-metadata">

**Author:** ![damalgos](https://gladys-assistant-community.b-cdn.net/letter_avatar_proxy/v4/letter/d/e274bd/32.png) [@damalgos](https://community.gladysassistant.com/u/damalgos)\
**Post date:** [July 19, 2019, 5:08am UTC](https://community.gladysassistant.com/t/dev-module-xiaomi-v4/4803/70 "2019-07-19T05:08:58Z")

</div>

Hi, actually the service is working on your end! A small issue on the front end that I normally fixed, I just need to push everything, it’s my fault!

If you see addTemperature.js in the logs, it means a device has gone through it!

---

<div class="post-metadata">

**Author:** ![damalgos](https://gladys-assistant-community.b-cdn.net/letter_avatar_proxy/v4/letter/d/e274bd/32.png) [@damalgos](https://community.gladysassistant.com/u/damalgos)\
**Post date:** [July 19, 2019, 5:20am UTC](https://community.gladysassistant.com/t/dev-module-xiaomi-v4/4803/71 "2019-07-19T05:20:55Z")

</div>

I actually forgot an `else` in a function on the front end that was causing everything to crash…

So it will be fine, I’ll push as soon as my tests pass and you can test.

---

<div class="post-metadata">

**Author:** ![damalgos](https://gladys-assistant-community.b-cdn.net/letter_avatar_proxy/v4/letter/d/e274bd/32.png) [@damalgos](https://community.gladysassistant.com/u/damalgos)\
**Post date:** [July 19, 2019, 5:28am UTC](https://community.gladysassistant.com/t/dev-module-xiaomi-v4/4803/72 "2019-07-19T05:28:59Z")

</div>

@Jacky normally if you pull it, it should work 🙂

---

<div class="post-metadata">

**Author:** ![damalgos](https://gladys-assistant-community.b-cdn.net/letter_avatar_proxy/v4/letter/d/e274bd/32.png) [@damalgos](https://community.gladysassistant.com/u/damalgos)\
**Post date:** [July 19, 2019, 9:34am UTC](https://community.gladysassistant.com/t/dev-module-xiaomi-v4/4803/74 "2019-07-19T09:34:27Z")

</div>

So pay attention, if the sensor was not added to the database, the values cannot be updated. The sensor must be in the first tab to be created in order to be updated. You often have to wait a second time for it to speak on the network :).

So yes … It’s complicated, I don’t know how to differentiate LOL. I only have information like ‹&nbsp;sid&nbsp;› …

We would need to link the two and I have no idea how to do that!

I’ll think about it on my side. Otherwise, wait for it to come up and give the temperature and check on the miHome application and compare … 😕

---

<div class="post-metadata">

**Author:** ![damalgos](https://gladys-assistant-community.b-cdn.net/letter_avatar_proxy/v4/letter/d/e274bd/32.png) [@damalgos](https://community.gladysassistant.com/u/damalgos)\
**Post date:** [July 19, 2019, 9:48am UTC](https://community.gladysassistant.com/t/dev-module-xiaomi-v4/4803/77 "2019-07-19T09:48:12Z")

</div>

> [@Jacky](#):
>
> This has been going on for half an hour, still no data, I activated a motion sensor in the meantime

On my end, it’s the same, the gateway communicates very little with the temperature device

---

<div class="post-metadata">

**Author:** ![damalgos](https://gladys-assistant-community.b-cdn.net/letter_avatar_proxy/v4/letter/d/e274bd/32.png) [@damalgos](https://community.gladysassistant.com/u/damalgos)\
**Post date:** [July 19, 2019, 9:52am UTC](https://community.gladysassistant.com/t/dev-module-xiaomi-v4/4803/79 "2019-07-19T09:52:50Z")

</div>

Oh I see that! 🙂

---

<div class="post-metadata">

**Author:** ![damalgos](https://gladys-assistant-community.b-cdn.net/letter_avatar_proxy/v4/letter/d/e274bd/32.png) [@damalgos](https://community.gladysassistant.com/u/damalgos)\
**Post date:** [July 19, 2019, 9:55am UTC](https://community.gladysassistant.com/t/dev-module-xiaomi-v4/4803/80 "2019-07-19T09:55:14Z")

</div>

> [@Jacky](#):
>
> I have a bug with the device id during database insertion:

Do you have the latest version? Because on my end, I don’t see any issues! I’ll test at home this afternoon with my gateway 🙂

---

<div class="post-metadata">

**Author:** ![link39](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/link39/32/3756_2.png) [@link39](https://community.gladysassistant.com/u/link39)\
**Post date:** [July 19, 2019, 11:13am UTC](https://community.gladysassistant.com/t/dev-module-xiaomi-v4/4803/82 "2019-07-19T11:13:41Z")

</div>

I just noticed two bugs:

- I think devices are being reported multiple times. In the device view, I have more temperature probes and motion detectors than I actually have in the house (a surprise delivery :D).

- Once a device is deleted from the device view, I can no longer reassign it via the setup view.

Regarding device identification, there is a solution. The SID should be displayed in the setup view. Then, from the mi-home application, you can find out the SID of the devices.  
@pierre-gilles, this meets the zwave requirement with the node ID reporting. Could we consider displaying this information somewhere, for example next to the device name or elsewhere:

 ![image](https://gladys-assistant-community.b-cdn.net/uploads/default/original/2X/e/e1bf0c9535019b1be81b4104774d9ad1d983b62a.png)

I think this is not limited to only Xiomi and Zwave, all devices have an ID.

---

<div class="post-metadata">

**Author:** ![damalgos](https://gladys-assistant-community.b-cdn.net/letter_avatar_proxy/v4/letter/d/e274bd/32.png) [@damalgos](https://community.gladysassistant.com/u/damalgos)\
**Post date:** [July 19, 2019, 11:38am UTC](https://community.gladysassistant.com/t/dev-module-xiaomi-v4/4803/85 "2019-07-19T11:38:03Z")

</div>

> [@link39](#):
>
> Then, from the mi-home application, you can find out the SID of the devices.

How do you do it? 😃

> [@link39](#):
>
> You should display the sid

I’ll add it!! 🙂

---

<div class="post-metadata">

**Author:** ![damalgos](https://gladys-assistant-community.b-cdn.net/letter_avatar_proxy/v4/letter/d/e274bd/32.png) [@damalgos](https://community.gladysassistant.com/u/damalgos)\
**Post date:** [July 19, 2019, 11:38am UTC](https://community.gladysassistant.com/t/dev-module-xiaomi-v4/4803/86 "2019-07-19T11:38:48Z")

</div>

> [@Jacky](#):
>
> Could you add the SIDs in this version?

Yes, I will do it as quickly as possible.

To note that from Sunday until next Sunday, I will be unavailable (no access to a computer).

---

<div class="post-metadata">

**Author:** ![pierre-gilles](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/pierre-gilles/32/5886_2.png) [@pierre-gilles](https://community.gladysassistant.com/u/pierre-gilles)\
**Post date:** [July 19, 2019, 11:43am UTC](https://community.gladysassistant.com/t/dev-module-xiaomi-v4/4803/87 "2019-07-19T11:43:56Z")

</div>

> [@damalgos](#):
>
> Yes, it is complicated… I don’t know how to differentiate MDR. I only have information like ‹&nbsp;sid&nbsp;›…
> 
> I need to link the two, and I have no idea how to do that!

I have a small idea about this!

In the Xiaomi configuration page, we could display an indicator (a kind of highlight) on the box of each device when a value has just been reported on a sensor, leaving it for about 1 or 2 seconds.

That way, you just need to open the window and see which one lights up to understand which device is which.

Example in scenarios, when a step is being executed, I highlight the box in blue:

 ![09](https://gladys-assistant-community.b-cdn.net/uploads/default/original/2X/c/c306af2abd1d74f5d10e1793588992d719779375.png)

We could do the same on the Xiaomi device box that has just been triggered.

We can add a mention «&nbsp;Last value: 20 seconds ago&nbsp;» as well.

[Previous page](https://community.gladysassistant.com/t/dev-module-xiaomi-v4/4803.md?page=2)

[Next page](https://community.gladysassistant.com/t/dev-module-xiaomi-v4/4803.md?page=4)
