Xiaomi Gateway Integration

It worked!

Thank you! :slight_smile:

I think indentation is wrong: put -platform four spaces to the right

- alias: switch on lights in dining room
  trigger:
    - platform: event
      event_type: click
      event_data:
        entity_id: binary_sensor.switch_15xxxxxxx6b
        click_type: single
  action:
    service: light.toggle
    entity_id: 
      - group.lights_diningroom

[/quote]

like this above

Thank you claudio for your support. The error was definitely in the syntax :wink:

After a recent gateway upgrade, and an upgrade to the latest home-assistant, my automations no longer trigger when I single click a button.

I see an event in my logs

 [homeassistant.core] Bus:Handling <Event click[L]: click_type=single, entity_id=binary_sensor.switch_158d00012d928e>

but the automation does not trigger.

I have also tried injecting an event:

17-04-17 12:05:07 INFO (MainThread) [homeassistant.core] Bus:Handling <Event state_changed[R]: event_type=click, click_type=single, entity_id=binary_sensor.switch_158d00012d928e>

with no change. I’m unsure if this is a xiaomi component issue, or something more fundamental in home-assistant. Has anyone had this issue?

  - alias: mi button pressed
    trigger:
        platform: event
        event_type: click
        event_data:
            entity_id: binary_sensor.switch_158d00012d928e
            click_type: single
    action:
         service: notify.test
         data:
          message: '1'

So your automation is powered by hydrogen? Just kidding.

I personally don’t like to mess with high power equipment automation either, but I find it useful to monitor the power consumption or status of them. So for some reason you forget to turn off the heater or stove, you can turn them off remotely.

What’s the best way?

A smart plug maybe not (or you have to keep it always ON and trigger on/off from the stove/washer/etc… and just use it as power consumption meter???

hi can i just confirm this component will work with the non zigbee aqara switches? the battery and wifi ones? (eg: http://www.gearbest.com/alarm-systems/pp_610095.html)
Cheers

I am currently using Sonoff POW(which has a 16A relay) to monitor my water heater and stove power drain, also took extra precaution to make sure that the wiring are rated for 16A and all the connection are secured. I am lucky as I live in a 230V country so I don’t need to deal with extremely high amp cabling. I am scared to mess with anything beyond 16A. The Sonoff are running custom firmware which default to ON, and I manually turn on or off the devices with a real switch and only fall back to remote switching when needed. Input -> Physical Switch -> Sonoff -> Device. I also use the Xiaomi gateway light as a signal light that turn red whenever that is a high power device being in used.

Although some smartplug claim to handle 13A but I just skeptical.

So far my water healer only draws around 3000W peak, which is around 12-13A and my stove is around 7A~.

I think only zigbee model works

For those object the European code (and I agree with it) says to use bipolar switches (cutoff of both Live and Neutral cables), not unipolar. Be careful

mmhhh what is your use of a Sonoff switch if you use mainly the manual switch … ???

You are correct.
Op: the link you gave is for a zigbee version.
Description says:

Main Features:
Xiaomi Aqara wall switch Wireless version
Cannot be wired, only can control Xiaomi smart bulb or light through ZigBee

Are we talking about this gateway https://xiaomi-mi.com/mi-smart-home/xiaomi-mi-gateway-2/ ?

oh perfect then haha! for some reason i though the wired one had zigbee and this was wifi. cool ill pick a few up

hey np. These are powered by a CR3023 battery similar to the other xiaomi sensors

Hi DIYers, Hackers and Homebrew sensor makers

I found these xiaomi sensor hacks you might be interested in.
To be clear, these are not allowing to change or subvert behaviour when using the xiaomi GW. You would need some other zigbee interface to make use of the hacked sensors. Still… interesting what people get up to…

in french:

in English:
https://translate.google.co.uk/translate?sl=fr&tl=en&js=y&prev=_t&hl=en&ie=UTF-8&u=http%3A%2F%2Ffaire-ca-soi-meme.fr%2Fhack%2F2017%2F02%2F27%2Fhack-xiaomi-mi-smart-temperature-and-humidity-sensor%2F&edit-text=

2 Likes

Now all that’s left is for someone to write a new “firmware” for those devices and we’re all set to ditch the gateway :wink:

I’ve submitted new pull request to Daniel’s branch. Adding ringtone play.
https://github.com/Danielhiversen/homeassistant/pull/6

7 Likes

As far as I noticed the gateway is able to play some (chinese) radio tunes via the MiHome-App.
Has anyone tried to teach the gateway some custom radio streams?