Xiaomi Gateway Integration

This would do, but I don’t have any input_boolean in my entities list.
Should I define it?
like in this recipe:

If I understand correcly I have to:

  • define the input_boolean
  • turn it on when my automation for the fan starts
  • check if the input_bool has been turned on as a condition in the other automation to turn off

I’ll try this way

Almost exactly that - just need to add in the turn it on bit in the action of the automation.

Define an input boolean is simply giving it a name really, an icon if you like just like your linked example.

ok, here it is my final result:

- alias: Fan Start above 70% humidity
   trigger:
     platform: numeric_state
     entity_id: sensor.humidity_158d00012cb6c0
     above: 70
   action:
     - service: light.turn_on
       entity_id: light.ventola
     - service: homeassistant.turn_on
     entity_id: input_boolean.fan_start
- alias: Fan Stops below 50% humidity and only after "Fan Start above 70% humidity"
   trigger:
     platform: numeric_state
     entity_id: sensor.humidity_158d00012cb6c0
     below: 50
   condition:
     condition: state
     entity_id: input_boolean.fan_start
     state: on
   action:
   - service: light.turn_off
       entity_id: light.ventola
     - service: homeassistant.turn_off
     entity_id: input_boolean.fan_start

(The fan is connected to an Osram Smart Plug driven by Hue, that’s why is seen as a light)

So the first automation should run normally and turn on the boolean, the second one should run when triggered, but only at condition that the bool is on

1 Like

Is this going to be added to the official HA repository sometime soon? :smiley:

7 Likes

found this on the internet

Great News !

Apparently Xiaomi uses the standard NXP trusted Center Link KEY: 5A: 69: 67: 42: 65: 65: 41: 6C: 6C: 69: 61: 6E: 63: 65: 30: 39 with that key you can decode the Zigbee ZHA protocol messages between all the Xiaomi Sensors and the Xiaomi gateway:

He also published all attributes of different sensors in an excel sheet.

So it should be possible to connect all these great cheap sensors to the Homey Zigbee protocol when ready.

Cant wait, cause these sensors have a great range and are super efficient, haven’t had to change the battery for more than 1 year

He’s starting a kickstarter campaign for an open zigbee gateway to support multiple vendors.
Currently already working with xiaomi and Hue.
@touliloup mentioned it here: Physical Buttons for Home Assistant

Hello, I’m not able to turn on Gateaway Light, when doors are opened (Xiaomi Sensor), well, I’m not able to turn ON, at anytime, anyone could help me?

  • alias: Luz Sensor ON Al Abrir Puerta Noche
    #initial_state: False
    trigger:
    • platform: state
      entity_id: binary_sensor.door_window_sensor_158d0dd01871666
      from: ‘off’
      to: ‘on’
      for:
      hours: 0
      minutes: 2
      seconds: 0
      #condition:

    - condition: state

    entity_id: sun.sun

    state: ‘below_horizon’

    action:
    service: light.turn_on
    entity_id: light.gateway_light_34ce0ss88922c
    Thanks

Hello, have you been able to turn on the gateaway light? could you tell me how, if so?

Thanks

I use this to turn on the light on motion

action:
    service: homeassistant.turn_on
    data:
      entity_id: light.gateway_light_286c0785b6f3
      rgb_color: [25,0,150]
      brightness: 75

See the full code here
https://github.com/Data-Monkey/Home-Assistant-Config/blob/master/includes/packages/Xiaomi_Package.yaml#L85

2 Likes

Thanks I’ll check…

Mmhh like this the trigger is the sensor on for 2 minutes?

I bought a handful of the new (square) shaped temperature/humidity sensors: http://www.gearbest.com/access-control/pp_626702.html

They don’t appear to be fully supported by the gateway yet.

They don’t show up on the Android app - but they do on the IOS app.

And the gateway says the “model” is blank (which is similar to what happened with the “cube” before it was fixed in a firmware update) and crucially don’t report the temperature or humidity :disappointed:

This is both via heartbeat, and when polled directly:

{"cmd":"heartbeat","model":"","sid":"158d00017xxxxx","short_id":31890,"data":"{\"voltage\":3005}"}

# echo -n '{"cmd":"read","sid":"158d00017xxxxx"}' | nc -u 192.168.xx.yyy 9898
{"cmd":"read_ack","model":"","sid":"158d00017xxxxx","short_id":31890,"data":"{\"voltage\":3005}"}

I also bought some single button switches: http://www.gearbest.com/access-control/pp_626695.html

These again show up in the IOS app but not the Android app

And if I press the switch the gateway doesn’t send anything to the multicast address.

Hopefully there will be another firmware update to address these soon!

What fw do you have on hub?

Firmware 1.4.1_146.0141

What do you think of the new buttons? I took a look at the new aqara range, the door and window sensors I don’t like, but the new buttons seem more solid, like they would be good for wall mounting where the others seem to be better for a table?

They are tiny, compared to the other switches that I have (dual-button)

The construction seems the same. Not bad for the price!

I guess proper support will come in the Xiaomi app/gateway soon.
I noticed that the curtain device now shows up.
You could maybe contact gearbest and see if they know. A long shot, but it might help if you explain they will have a lot of support calls on these…

Somewhere in forum it was mentioned that these devices was FCC certified. Maybe it can happen that they will be available only on US market.

Maybe so.
I also noticed the Aqara and Eigenstone - who both seem to be other companies involved in the design/manufacture of these devices - both have apps available on the Apple appstore.
Both apps seem to be the same (but with different graphic assets) but neither will work as I cannot register with a UK cellphone - reg text never gets sent. Maybe a Chinese number would work, but I cant get one.

I have the new temp sensor and door sensor on the way.
Didn’t like the new switch design (button in the middle of the enclosure) compared to the old one.