Xiaomi Gateway Integration

maybe

for: '00:02:00'

Either way is fine, I use for and minutes in mine.

  - alias: Motion_off
    trigger: 
      platform: state
      entity_id: binary_sensor.motion_sensor_158xxxxxxxxx2
      from: 'on'
      to: 'off'
      for: 
        minutes: 2
    action:
      service: light.turn_off
      entity_id: light.yeelightwhite1

Hello,
I recently bought xiaomi sensors and install HA, I want to know more about xiaomi Aqara Wall Switch. I saw that’s possible to be controlled from HA. Is it possible when is turned on by the physical switch the state in HA to be changed? And does it need neutral wire to work cuz I have only live wire.
Thanks.

Aqara wall switch does not use earth or neutral wires. Its simply creates a switch/break in the active cable. Each switch acts as a toggle button to open and close the circuit.

Also on and off state is updated in home assistant when you control the physical switch.

Thanks, I just modify a little bit my yams file, but now I’m not at home and can’t test it, but I notice that the automation is not in Automation card (I restarted HA) as you can see here:

It’s normal?

Thank you :slight_smile:

hello to everyone,

Someone tried to use the xiaomi gateway in network (192.168.0.0/24) and HA in different network 8like 192.168.1.0/24)? It’s possible to use this configuration?

When i had all in same network, all worked well, now that xiaomi is in different network, i have this log:

2017-05-11 12:40:38 WARNING (MainThread) [homeassistant.setup] Setup of xiaomi is taking over 10 seconds.
2017-05-11 12:40:43 ERROR (Thread-10) [custom_components.xiaomi] No gateway discovered
2017-05-11 12:40:43 ERROR (MainThread) [homeassistant.setup] Setup failed for xiaomi: Component failed to initialize    

The same occurs with the yeelight bulb.

thanks

Your file is not properly formatted. My guess is that you’re not including garage.yaml in your main configuration, or you are but it is failing because of the first line:

automation:

Please remove it, restart hass and look for errors, if it still doesn’t work post the main configuration.yaml file’s line where you include your automation files. DO NOT POST THE ENTIRE FILE! There’s passwords in there most probably :slight_smile:

1 Like

unless hass and the gateway are in the same network it won’t work. the gateway uses multicast which does not traverse across networks.

Oh yeah mate you are right!
I just removed the line automation: and now it pop up in the Automation cards in HA. I’ll test the real operation when I’ll go back to home in the evening :slight_smile:

Hi there, I just create a sensor:

- platform: template 
  sensors:
    sensore_ingresso:
      friendly_name: 'Sensore Ingresso'
      value_template: '{{ states.binary_sensor.door_window_sensor_158d000112031b.attributes.battery_level }}'
      icon_template: mdi:battery
      unit_of_measurement: "%"

This is only the first and I’ll add other in the evening, but I have one question:
Can you explain how to put all inside a “Card” (something like Your card Battery)?ù
Thanks in advance!

Does anyone know the limit of sensor a gateway can handle ?

(I already have 21, 3 not yet plugged, and I’m about to order 8 more)

It’s working! :smiley:

It’s possible to extend the range of the aqara gateway? Does permanent powered devices act as an range extender? I’m using a smart socket (http://www.gearbest.com/living-appliances/pp_344666.html) now. It seems not to improve the situation.

I think i read somewhere that the limit is 30 devices connected to a gateway

Indeed, just read the same thing here : http://en.miui.com/thread-493295-1-1.html
Thx

Just got my new gateway and a few plugs.
Tried adding the custom_component from below

I get the following error.

According to the “Gateway Information” button on the Mi Home App

fw_ver: 1.4.1_1_145
hw_ver: MW300
model: lumi.gateway.v3

Any ideas what could be wrong?

Did you add the key (and may be sid) of your gateway to your configuration?

xiaomi:
  gateways:
    - sid:
      key: xxxxxxxxxxxxxxxxxx

cp. https://github.com/lazcad/homeassistant (second bullet of the installation section)

Yep. I have done that.

After a few days of observation, I find that ghost motion only occurs when I block access to the internet for the gateway. With internet access for gateway I did not have a single ghost motion for 4 days.