Xiaomi Gateway Integration

They should be working, at least on my setup. Let me check and see what’s changed

Something is missing (push update and upda ha status) after this commit
dff9f36 I believe that’s what causing this. It should be an easy fix.

2 Likes

Thank you very much for this great component.

Would it be possible to get the direction of the cube controllers rotation?
The Xiaomi App shows the rotation direction via positive (rotate right) and negative (rotate left) values.

This would be really great for adjusting volume or light intensity.

It is already supported. Here is how I is use it: https://github.com/Danielhiversen/home-assistant_config/blob/master/automation/audio.yaml#L187

2 Likes

I have a TP-Link router and have had this problem in the past with other devices including the Google Home. It seems to be only certain routers that do this. Another problem I encounter with the Xiaomi gateway, Orvibo S20 switches. and a few other devices in home assistant is the discovery of the devices on a restart of hass if the router has been rebooted. If the router reboots for any reason the next time I restart homeassistant none of these devices will be found on the network.

Power cycling each problematic device and then restarting hass solves this problem. I’m thinking about getting a new (non TP-Link) router.

Thanks for the info… very disappointing tp link has been great besides this… I also have 4 s20s :frowning:

Do you have the same experience with the switches not being found? Other people here don’t seem to have this experience so I’m really only guessing when I blame the router. They are very reliable otherwise for me. At least with the Xiaomi it’s only the hub that needs rebooting but some of my s20’s are a bit harder to get to.

I notice it because my power goes out all the time. I have an Archer D9 TP Link modem/router, considering replacing it with the popular Asus RT-AC68U and bridging.

Hi can you please explain what are the other automations with the cube (p3, flip90 …???)

See point 6 here: https://github.com/lazcad/homeassistant#installation-raspberry-pi

If you enable debug for the xiaomi components: https://github.com/Danielhiversen/home-assistant_config/blob/master/configuration.yaml#L46
The received event will be printed to the log.

1 Like

yes yes, just trying to understand your automations with the cube

I don’ tunderstand the shake_air automation

This https://github.com/Danielhiversen/home-assistant_config/blob/master/automation/audio.yaml#L134-L171 ?
If the media player is on, and shake_air is triggered the media player will turn off.
If the media player is off, and shake_air is triggered the media player will turn on.

and what is the service news.read_news?

Also I don’t understand flip90 … it goes thorugh a list of radio station?

A custom component I have made to read some news, weather forecast, outside temperature, last workout (from endomondo),…

Yes, correct

and you have 2 media_player … bad and stue … and you control them with 1 cube?

2 media players and 2 cubes

thanks, trying to understand. What is state: Av??

  • alias: “Radio bad av”
    trigger:
    • platform: state
      entity_id: input_select.radio_bad
      state: ‘Av’
      action:
    • service: media_player.turn_off
      entity_id: media_player.bad

“Av” is Norwegian for off.

The automation sets the state of an input_select: https://github.com/Danielhiversen/home-assistant_config/blob/master/input_select.yaml#L20
And that triggers another automation: https://github.com/Danielhiversen/home-assistant_config/blob/master/automation/audio.yaml#L233

WOuld it be possible to use the XIaomi Switch to FORWARD a media_player track by X seconds?

New release posted.

a) Instant motion trigger event. There’s no need to wait 60 seconds for another motion trigger.
b) Simplify setup

Check the first post for details. Also, most code has been refactored (thanks to @Danielhiversen) and updated to pass pylint so it should be a good start for the official integration once the main component is separated into a separate library

2 Likes

if i can add my 2 cents.
i could use for example an arduino with a buzzer or something similar on the PI to produce sound if Pir or door sensors detect movement, right?