Xiaomi Gateway Integration

Still not working unfortunately Rave. Switching the Gateway on and off via the button is represented via the HA website. Switching the gateway light off via HA means you can’t use the button on the gateway to switch it back on.

If Mi Home App doesn’t work, changing the color in the App will turn on the light. Bug?

Hi rave, I use motion state to turn off switch like this:

- alias: motion_switch_ct_off
  trigger:
    - platform: state
      entity_id: binary_sensor.motion_sensor_158d0001267f9c
      from: 'on'
      to: 'off'
      for:
        seconds: 30
  action:
    - service: switch.turn_off
      entity_id: switch.light_ct_1

But it will take 1 minute waiting state to off. I wonder if I can use event to do this job more efficient. eg. no event for 30 seconds then turn off switch.

1 Like

Hi,

I’m trying to use as per documentation:

- platform: event
  event_type: motion_action
  event_data:
  #service
    entity_id: binary_sensor.motion_sensor_1xx10xecxxxff1

But the sensor never fires on the automation and I don’t get any errors. Is the documentation outdated or am I missing something?

Also, the documentation for:

trigger:
platform: state
entity_id: binary_sensor.door_window_sensor_158d000xxxxxc2
from: ‘no_motion’
to: ‘motion’

Seems to be wrong, only works using from: ‘off’ to: ‘on’.

Can we have a reviewed documentation?

Thanks

That’s because the motion sensor itself has a delay for 1 minute.

updated the README. Below is the correct event type

event_type: motion

For the second one, what’s the issue? The trigger only activate when it changes from ‘no_motion’ to ‘motion’ which means it only trigger when there’s motion being detected. Btw, i’m no expert in HA automation rules. You can probably learn more by going through HA’s documentation

Thanks for the updated documentation.
It’s not ‘motion’ it’s ‘on’ and ‘no_motion’ it’s actually ‘off’.

But event didn’t need to wait 1 minute, am I right? I wonder if I can use event to do this job more efficient. eg. if no event fires for 30 seconds then turn off switch.

Hello everyone,
I’ve been following this thread for some time now, and found it very interesting. I currently have many xiaomi devices: 1 gateway, 4 temperature sensors, 2 plugs, 1 switch, 1 cube, 1 presence sensor, 3 light bulbs and 2 door sensors. Although using another software platform would be so much better than the Mi home app in order to do the monitoring, automations and so on, my interest right now is to find a way of downloading the historic data. That means, I would like to have access to the historic data of temperature, door opening logs, presence etc. directly from the xiaomi gateway or servers, without needing a software on a computer or raspberry measuring all the time.
I know the information must be stored in someplace, so I’ve tried wireshark in order to find the information exchange between the gateway and the internet, the mobile phone connected to the wifi while retrieving the historic data etc., but so far I have not been able to access the historic information. I have managed to locate the heartbeats and some measurements, but not the history log. There must be a way, since the information has to reach the app when it shows the monthly temperature profile for example.
Any help would be so much appreciated!

This is most probably going over secure http, hence you don’t see the unencrypted data. Wireshark sees the encrypted packets but you can’t decrypt them easily.

Sorry, I might have misunderstood what the bug fix was for. If I switch the gateway light off using HA, changing the brightness in the Mi Home App does turn it back on. After that I can use the either the Mi Home App or the button on the gateway.

So - Here’s the thing

I have my finger over the “buy now” button for a shed tonne of Xiaomi gear:

– Does everyone think the integration here is 100% of what it needs to be? –

If so, I’m going to clear this purchase with the boss!

Thoughts folks? Is this working out well?

1 Like

Im about to buy this product from gearbest. Are you sure that this gateway is V2. Because gearbest does not confirm that this model has this model number ‘DGNWG02LM’.

Yeah, Its the same one I bought like 6 months ago and mine is v2.

Thank you for your confirmation, their live chat does not have a clue :wink:

I saw that the absolute newest model should have the Mi home “smiley M” logo rather than MI logo.

i.e.
this:

rather than this:

I unfortunately bought a gateway and sensor kit (motion, window/door, and button kit) and it has an old version of the gateway, which does not allow the API :frowning:

Oddly though if you look at my gateway’s host name (e.g. in router DHCP lease table) it has “v2” in the name: e.g.
lumi-gateway-v2_mii01234567.local

Mine is the “old” logo, but it works in HASS

Yes… this is another undocumented subversion of the gateway :frowning:
Perhaps its nothing more than cosmetic change, since I didnt see any new feature listed on dx.com, gearbest, etc.
I saw some sites calling it the “2017” version, but really who knows?

Wait you can order from there? It is out of stock for me :open_mouth:

~Cheers