markItDown
📱 A React app to preview and edit Markdown✍. You can also export it as HTML.
Xiaomi Mi Smart Fan integration for Home Assistant
git clone https://github.com/syssi/xiaomi_fan.gitsyssi/xiaomi_fanThis is a custom component for home assistant to integrate the Xiaomi Mi Smart Fan.
Please follow the instructions on Retrieving the Access Token to get the API token to use in the configuration.yaml file.
Credits: Thanks to Rytilahti for all the work.
| Name | Model | Model no. | Specs |
|---|---|---|---|
| Pedestal Fan Fan V2 | zhimi.fan.v2 | ||
| Pedestal Fan Fan V3 | zhimi.fan.v3 | ||
| Pedestal Fan Fan SA1 | zhimi.fan.sa1 | ||
| Pedestal Fan Fan ZA1 | zhimi.fan.za1 | ||
| Pedestal Fan Fan ZA3 | zhimi.fan.za3 | ||
| Pedestal Fan Fan ZA4 | zhimi.fan.za4 | ZLBPLDS04ZM | |
| Smartmi Standing Fan 3 | zhimi.fan.za5 | ||
| Pedestal Fan Fan 1C | dmaker.fan.1c | ||
| Pedestal Fan Fan P5 | dmaker.fan.p5 | ||
| Pedestal Fan Fan P8 | dmaker.fan.p8 | ||
| Pedestal Fan Fan P9 | dmaker.fan.p9 | ||
| Pedestal Fan Fan P10 | dmaker.fan.p10 | ||
| Mijia Pedestal Fan | dmaker.fan.p11 | BPLDS03DM | 2800mAh, 24W, <=58dB |
| Smart Standing Fan 2 Pro | dmaker.fan.p33 | BPLDS03DM | 2800mAh, 24W, <=58dB |
| Pedestal Fan Fan P15 | dmaker.fan.p15 | ||
| Mi Smart Standing Fan 2 P18 | dmaker.fan.p18 | BPLDS02DM | AC, 15W, 30.2-55.8dB |
| Mi Smart Standing Fan 2 P30 | dmaker.fan.p30 | BPLDS02DM | AC, 15W, 30.2-55.8dB |
| Rosou SS4 Ventilator | leshow.fan.ss4 | ||
| Xiaomi Smart Tower Fan | dmaker.fan.p39 | BPTS01DM | 22W, <=63dB |
| Xiaomi Smart Standing Air Circulation Fan | xiaomi.fan.p76 | JLLDS01XY | - |
| Xiaomi Smart Desktop Air Circulation Fan | xiaomi.fan.p70 | - | - |
| Mi Smart Standing Fan 2 Lite | xiaomi.fan.2lite | - | - |
| Xiaomi Smart Standing Fan Pro Slim | xiaomi.fan.p85 | - | - |
Power (on, off)
Operation modes (manual, sleep, strong, natural)
Preset modes (Level 1, Level 2, Level 3, Level 4)
Speed percentage (0...100)
Oscillate (on, off)
Buzzer (on, off)
Delayed turn off (minutes)
Attributes
modelmodespeedbuzzeroscillatedelay_off_countdownerror_detectedYou can install this custom component via HACS. Search for 'Xiaomi Mi Smart Pedestal Fan Integration' at the integration page of HACS. Alternatively, you can install it manually by copying the custom_components folder to your Home Assistant configuration folder.
As next step you have to setup the custom component at your configuration.yaml. This custom component doesn't provide a config-flow right now. A restart of Home Assistant is required afterwards.
# configuration.yaml
fan:
- platform: xiaomi_miio_fan
name: Xiaomi Smart Fan
host: 192.168.130.71
token: b7c4a758c251955d2c24b1d9e41ce47d
Configuration variables:
preset_modes_override: []).fan.set_percentageSet the fan speed percentage.
| Service data attribute | Optional | Description |
|---|---|---|
entity_id |
yes | Only act on a specific fan entity. Else targets all. |
percentage |
no | Percentage speed setting. Valid values are between 0 and 100. |
fan.set_preset_modeSet a preset mode.
| Service data attribute | Optional | Description |
|---|---|---|
entity_id |
yes | Only act on a specific fan entity. Else targets all. |
preset_mode |
no | Preset mode. Valid values are Level 1, Level 2, Level 3 and Level 4. |
fan.oscillateOscillates the fan.
| Service data attribute | Optional | Description |
|---|---|---|
entity_id |
yes | Only act on a specific fan entity. Else targets all. |
oscillating |
no | Flag to turn on/off oscillation. Valid values are True and False. |
fan.set_directionRotates the fan 5 degrees to the left/right.
| Service data attribute | Optional | Description |
|---|---|---|
entity_id |
yes | Only act on a specific fan entity. Else targets all. |
direction |
no | Rotate the fan 5 degrees. Valid values are left/reverse and right/forward. |
xiaomi_miio_fan.fan_set_oscillation_angleSet the oscillation angle. Supported values are 30, 60, 90 and 120 degrees.
| Service data attribute | Optional | Description |
|---|---|---|
entity_id |
yes | Only act on a specific xiaomi miio entity. Else targets all. |
angle |
no | Angle in degrees. Valid values are 30, 60, 90, 120, and 140. |
xiaomi_miio_fan.fan_set_delay_offSet the scheduled turn off time. Supported values are 0, 60, 120, 180, 240, 300, 360, 420, 480 minutes. When 0 is passed, delay_off is disabled.
| Service data attribute | Optional | Description |
|---|---|---|
entity_id |
yes | Only act on a specific xiaomi miio entity. Else targets all. |
delay_off_countdown |
no | Time in minutes. Valid values are 0, 60, 120, 180, 240, 300, 360, 420, 480 minutes. |
xiaomi_miio_fan.fan_set_natural_mode_onTurn the natural mode on.
| Service data attribute | Optional | Description |
|---|---|---|
entity_id |
yes | Only act on a specific xiaomi miio entity. Else targets all. |
xiaomi_miio_fan.fan_set_natural_mode_offTurn the natural mode off.
| Service data attribute | Optional | Description |
|---|---|---|
entity_id |
yes | Only act on a specific xiaomi miio entity. Else targets all. |
xiaomi_miio_fan.fan_set_buzzer_onTurn the buzzer on.
| Service data attribute | Optional | Description |
|---|---|---|
entity_id |
yes | Only act on a specific xiaomi miio entity. Else targets all. |
xiaomi_miio_fan.fan_set_buzzer_offTurn the buzzer off.
| Service data attribute | Optional | Description |
|---|---|---|
entity_id |
yes | Only act on a specific xiaomi miio entity. Else targets all. |
xiaomi_miio_fan.fan_set_child_lock_onTurn the child lock on.
| Service data attribute | Optional | Description |
|---|---|---|
entity_id |
yes | Only act on a specific xiaomi miio entity. Else targets all. |
xiaomi_miio_fan.fan_set_child_lock_offTurn the child lock off.
| Service data attribute | Optional | Description |
|---|---|---|
entity_id |
yes | Only act on a specific xiaomi miio entity. Else targets all. |
xiaomi_miio_fan.fan_set_led_brightnessSet the led brightness. Supported values are 0 (Bright), 1 (Dim), 2 (Off).
| Service data attribute | Optional | Description |
|---|---|---|
entity_id |
yes | Only act on a specific xiaomi miio entity. Else targets all. |
brightness |
no | Brightness, between 0 and 2. |
xiaomi_miio_fan.fan_set_anion_onTurn the ionizer on.
| Service data attribute | Optional | Description |
|---|---|---|
entity_id |
yes | Only act on a specific xiaomi miio entity. Else targets all. |
xiaomi_miio_fan.fan_set_anion_offTurn the ionizer off.
| Service data attribute | Optional | Description |
|---|---|---|
entity_id |
yes | Only act on a specific xiaomi miio entity. Else targets all. |
xiaomi_miio_fan.fan_turnTurn to the given direction. Supported values are left, right, up and down. (P76 only)
| Service data attribute | Optional | Description |
|---|---|---|
entity_id |
yes | Only act on a specific xiaomi miio entity. Else targets all. |
direction |
no | Direction. Valid values are left, right, up and down. |
xiaomi_miio_fan.fan_set_vertical_oscillation_onTurn the vertical oscillation on. (P70 and P76 only)
| Service data attribute | Optional | Description |
|---|---|---|
entity_id |
yes | Only act on a specific xiaomi miio entity. Else targets all. |
xiaomi_miio_fan.fan_set_vertical_oscillation_offTurn the vertical oscillation off. (P70 and P76 only)
| Service data attribute | Optional | Description |
|---|---|---|
entity_id |
yes | Only act on a specific xiaomi miio entity. Else targets all. |
xiaomi_miio_fan.fan_set_vertical_oscillation_angleSet the vertical oscillation angle. (P70 and P76 only)
| Service data attribute | Optional | Description |
|---|---|---|
entity_id |
yes | Only act on a specific xiaomi miio entity. Else targets all. |
vertical_angle |
no | Vertical angle in degrees. Valid values are 30, 60, 90 and 100. |
more like this
📱 A React app to preview and edit Markdown✍. You can also export it as HTML.
search projects, people, and tags