Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create xiaomi_gw.markdown #3028

Merged
merged 4 commits into from Jul 23, 2017
Merged

Create xiaomi_gw.markdown #3028

merged 4 commits into from Jul 23, 2017

Conversation

jcastro
Copy link
Contributor

@jcastro jcastro commented Jul 20, 2017

Initial commit for the new Xiaomi Gateway component

Description:

Pull request in home-assistant (if applicable): home-assistant/home-assistant#

Initial commit for the new Xiaomi Gateway component
Copy link
Member

@Danielhiversen Danielhiversen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great. The code pr is now merged: home-assistant/core#8555


One Gateway
```yaml
# You can leave sid empty if you only have one gateway
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have changed from sid to mac address in the implementation now.
So the config should be:- mac:
Both the old sid format and mac address with colon are supported

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed 👍 thanks

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great (replace sid on line 55 with mac too)

footer: true
logo: xiaomi.png
ha_category: Hub
ha_release: 0.4X
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It will be 0.50

Updated sid to mac terminology
Modified release version

Configuration variables:
- **mac** (*Optional*): The MAC of your gateway. Required if you have more than one gateway
- **key** (*Required*): The key of your gateway
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

key is optional, but without providing the key you can not control lights or the switch. (But the sensors and binary sensors will still work)
discovery_retry (Optional): How many times Home Assistant should try to reconnect to the Xiaomi hub. (Default is 3.)
interface (Optional): Which network interface to use. (Default to any)

Tweaked configuration variables
- **mac** (*Optional*): The MAC of your gateway. Required if you have more than one.
- **key** (*Optional*): The key of your gateway. Required if you also want to control lights and switches; sensors and binary sensors will still work.
- **discovery_retry** (*Optional*): Amount of times Home Assitant should try to reconnect to the Xiaomi Gateway. Default is 3.
- **interface** (*Optional*): Which network interface to use. Default to any.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

{% linkable_title Services %}

The gateway provides two services (xiaomi.play_ringtone, xiaomi.stop_ringtone). To play ringtones by HA the version of the gateway firmware must be 1.4.1_145 at least. A ringtone_id and gw_mac must be supplied. The parameter 'ringtone_vol' (percent) is optional. Allowed values of the ringtone_id are:

  • alarm ringtones [0-8]
  • doorbell ring [10-13]
  • alarm clock [20-29]
  • custom ringtones (uploaded by mi home app) starting from 10001

Automation example

    - alias: Let a dog bark on long press
      trigger:
        platform: event
        event_type: click
        event_data:
          entity_id: binary_sensor.switch_158d000xxxxxc2
          click_type: long_click_press
      action:
        service: xiaomi.play_ringtone
        data:
          gw_mac: xxxxxxxxxxxx
          ringtone_id: 8
          ringtone_vol: 8

    - alias: Stop barking immediately on single click
      trigger:
        platform: event
        event_type: click
        event_data:
          entity_id: binary_sensor.switch_158d000xxxxxc2
          click_type: single
      action:
        service: xiaomi.stop_ringtone
        data:
          gw_mac: xxxxxxxxxxxx

Copy link
Member

@fabaff fabaff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will merge it and add the details by @syssi.

@fabaff fabaff added the new-integration This PR adds documentation for a new Home Assistant integration label Jul 23, 2017
@fabaff fabaff merged commit 0ed71ca into home-assistant:next Jul 23, 2017
@EabeyTong
Copy link

I hope that the mi gateway can join the control play FM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new-integration This PR adds documentation for a new Home Assistant integration
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants