Xiaomi Gateway Integration

Let me observe the data again and see if it makes any difference for the 11 points. Then we can decide. :slight_smile:

No joy, changed channel and same issue, so strange…

Hi,

I had some problems lime you and i detected that was my isp router. I cheked other router and worked well.

Can you try other router in your network? Which router are you using now?

Hi garvarma

Currently using the default router that comes with VM but going try a netgear I have at home later.
Thanks

edit: I moved gateway downstairs beside router so it was connecting to router’s wifi signal instead of TP Link extender upstairs and it started working immediately! TP Link must have been blocking the multicast packets

The Swing is a fast swing with the cube, like you would do if you used a sword :smiley:
The gateway says some strange things in chinese when you do it.
If anybody knows how to switch it off please let me know

1 Like

I wouldn’t have described it better

Other than muting the notifications on the gateway, also don’t know. This is the only gesture that seems to trigger this.
Most probably, the chinese lady is warning you that the cube is not a sword :crossed_swords: :grin:

1 Like

How can I change the wlan ssid and key?

Is there some reason to send the discovery packet just once? instead of multiple times? In python-mirobo it is sent thrice, I think exactly for the reason that it did not always answer to the one which caused timeouts. At least in that case the robot always answers almost immediately when it does, and thus there is no need for a long timeout. Worth trying out at least?

It is send up to 3 times by default, but you can configurate it with by setting: discovery_retry: XX in the config

Is controlling the gateway light from HA possible? Can control it from app ok.
It appears as a light but I can’t seem to control it and I see this in logs when I try turn it on/off from HA

2017-07-19 21:42:15 DEBUG (Thread-6) [custom_components.xiaomi] << {‘data’: ‘{“error”:“Invalid key”}’, ‘cmd’: ‘write_ack’, ‘sid’: ‘286c0788a6e6’}
2017-07-19 21:42:15 ERROR (Thread-6) [custom_components.xiaomi] Got error element in data {“error”:“Invalid key”}

If you fix your encryption “key” it will be possible. :wink: The gateway will be show up as “light”.

That error means that your developer key is not correct in configuration.yaml.

Please double check and try again.

Thanks, guess I gotta grab the new gateway
Is the new aqara motion sensor working with HA?

http://www.gearbest.com/alarm-systems/pp_659226.html

Yes. Please cp. https://github.com/Danielhiversen/homeassistant/blob/master/README.md

Hey Guys

Since the fw upgrade to 1.4.1_148.0143 the Gateway can’t be discovered :frowning:

Any ideas?

That’s mad that the IOS app doesn’t work correctly to give you that info. Downloaded an android emulator and regenerated a key and working now! thanks guys

Are you using a TP link repeater anywhere in your network that the gateway might be connecting to? That’s what my problem was. It looks like it was blocking the multicast packets

I am using IOS and have no issues. Good to know that you sorted it out. :slight_smile:

Hello.

Considering the amount of recent improvements/commits that have been happening in @Danielhiversen repo, I decided to add something to Home Assistant to let me know if I’m up-to-date or not:

sensor:
  - platform: command_line
    name: "Current Xiaomi Version"
    scan_interval: 3600
    command: python3 -c "import requests; print(requests.get('https://api.github.com/repos/Danielhiversen/homeassistant/commits/master').json()['sha'])"

  - platform: command_line
    name: "Xiaomi Installed version"
    scan_interval: 3600
    command: "cat /home/homeassistant/src/homeassistant/.git/FETCH_HEAD | cut -c 1-40"

  - platform: command_line
    name: "Commit Xiaomi Version Date"
    scan_interval: 3600
    command: python3 -c "import requests; print(requests.get('https://api.github.com/repos/Danielhiversen/homeassistant/commits/master').json()['commit']['author']['date'])"

  - platform: template
    sensors:
      xiaomi_update:
        friendly_name: 'Xiaomi Status'
        value_template: '{%- if states.sensor.xiaomi_installed_version.state == states.sensor.current_xiaomi_version.state -%}
                             Updated
                         {%- else -%}
                             NOT Updated
                         {%- endif -%}'
        icon_template: '{%- if states.sensor.xiaomi_installed_version.state == states.sensor.current_xiaomi_version.state -%}
                            mdi:thumb-up-outline
                        {%- else -%}
                            mdi:thumb-down-outline
                        {%- endif -%}'

  - platform: template
    sensors:
      current_xiaomi_version_date:
        friendly_name: 'Version Date'
        value_template: '{{ as_timestamp(states.sensor.commit_xiaomi_version_date.state) | timestamp_custom("%d.%m.%Y@%H:%M") }}' 

This is how it will shown on Frontend:

Hope this might be helpful for anyone.

3 Likes

What do you use to show this in your front end?