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
Conversation
Initial commit for the new Xiaomi Gateway component
There was a problem hiding this 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 |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changed 👍 thanks
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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
There was a problem hiding this 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.
I hope that the mi gateway can join the control play FM |
Initial commit for the new Xiaomi Gateway component
Description:
Pull request in home-assistant (if applicable): home-assistant/home-assistant#