Giter VIP home page Giter VIP logo

homebridge-xiaomi-fan's Introduction

homebridge-xiaomi-fan

verified-by-homebridge homebridge-xiaomi-fan mit-license follow-me-on-twitter join-discord

homebridge-xiaomi-fan is a plugin for homebridge which allows you to control Xiaomi Smartmi and Mija Fans! It should work with most smart fans from xiaomi. The goal is to make the fan fully controllable from the native Homekit iOS app and Siri.

Features

  • Integrates into homekit as a fan device
  • Control power, speed, swing mode and switch between standard and natural wind
  • Set oscillation angle
  • Rotate fan to the left or right by 5°
  • Turn on/off the buzzer
  • Turn on/off the LEDs
  • Set a shutdown timer
  • Homekit automations

Known supported fan models

  • zhimi.fan.sa1 (Mi Standing Fan)
  • zhimi.fan.v2/v3 (Smartmi DC Pedestal Fan)
  • zhimi.fan.za1 (Smartmi Inverter Pedestal Fan)
  • zhimi.fan.za3 (Smartmi Standing Fan 2)
  • zhimi.fan.za4 (Smartmi Standing Fan 2S)
  • zhimi.fan.za5 (Smartmi Standing Fan 3)
  • zhimi.fan.fa1 (Mijia DC Circulating Fan)
  • zhimi.fan.fb1 (Mi Smart Air Circulator Fan)
  • dmaker.fan.1c (Mi Smart Standing Fan 1C)
  • dmaker.fan.p5 (Mi Smart Standing Fan 1X)
  • dmaker.fan.p8 (Mi Smart Standing Fan 1C CN)
  • dmaker.fan.p9 (Mi Smart Tower Fan)
  • dmaker.fan.p10 (Mi Smart Standing Fan 2)
  • dmaker.fan.p11 (Mi Smart Standing Fan Pro)
  • dmaker.fan.p15 (Mi Smart Standing Fan Pro EU)
  • dmaker.fan.p18 (Mi Smart Fan 2)
  • air.fan.ca23ad9 (AIRMATE CA23-AD9 Air Circulation Fan)
  • dmaker.fan.p30 (Xiaomi Smart Standing Fan 2)
  • dmaker.fan.p33 (Xiaomi Smart Standing Fan 2 Pro)
  • dmaker.fan.p220 (Mijia DC Inverter Circulating Floor Fan)

Installation

If you are new to homebridge, please first read the homebridge documentation. If you are running on a Raspberry, you will find a tutorial in the homebridge wiki.

Install homebridge:

sudo npm install -g homebridge

Install homebridge-xiaomi-fan:

sudo npm install -g homebridge-xiaomi-fan

Configuration

Add the xiaomifan platform in config.json in your home directory inside .homebridge.

Add your Fan or multiply Fans in the devices or fans array.

Example configuration:

{
  "platforms": [
    {
      "platform": "xiaomifan",
      "devices": [
        {
          "name": "Xiaomi Fan 2s",
          "ip": "192.168.0.40",
          "token": "8305d8fba83f94bb5ad8f963b6c84c84",
          "pollingInterval": 10,
          "moveControl": true,
          "buzzerControl": true,
          "ledControl": true,
          "naturalModeControl": true,
          "shutdownTimer": true,
          "angleButtons": [
             5,
             60,
             100
           ]
        }
      ]
    }
  ]
}

Token

For the plugin to work the device token is required. For methods on how to find the token refer to this guide obtaining mi device token.

You can also use this tool to easily retrieve the token: Xiaomi Cloud Tokens Extractor.

Configuration

Platform Configuration fields

  • platform [required] Should always be "xiaomifan".
  • devices or fans [required] A list of your Fans.

Fan Configuration fields

  • name [required] Name of your accessory.
  • ip [required] ip address of your Fan.
  • token [required] The device token of your Fan.
  • deviceId [optional] New fan devices which use the miot protocol require the device id to be specified. The deviceId will be automatically retrieved by the plugin but if there is trouble you can manually specify it. Default: "" (not specified)
  • model [optional] The fan model. If specified then the accessory will be created instantly without the need to first discover and identify the fan. Default: "" (not specified)
  • prefsDir [optional] The directory where the fan device info will be stored. Default: "~/.homebridge/.xiaomiFan"
  • pollingInterval [optional] The fan state background polling interval in seconds. Default: 5
  • deepDebugLog [optional] Enables additional more detailed debug log. Useful when trying to figure out issues with the plugin. Default: false
  • buzzerControl [optional] Whether the buzzer service is enabled. This allows to turn on/off the fan buzzer. On Smartmi fans the rotation direction switch can be used to select between loud or quiet buzzer level. Default: true
  • ledControl [optional] Whether the led service is enabled. This allows to turn on/off the fan LED. Default: true
  • naturalModeControl [optional] Show a switch which allows to quickly enable/disable the natural mode. Only on supported devices! Default: true
  • sleepModeControl [optional] Show a switch which allows to quickly enable/disable the sleep mode. Only on supported devices! Default: true
  • moveControl [optional] Whether the move service is enabled. This allows to move the fan in 5° to the left or right. Only on supported devices! Default: false
  • shutdownTimer [optional] Show a slider (as light bulb) which allows to set a shutdown timer in minutes. Default: false
  • angleButtons [optional] Whether the angle buttons service is enabled. This allows to create buttons which can switch between different oscillation angles. Only on supported devices! Default: "" (disabled)
    • Set an array of numeric values. Possible values depend on the fan model
    • Some fans support predefined angle buttons, in the case if the property is not specified the angle buttons are retrieved from the fan and displayed as switches. If you want to prevent that behaviour set the property value as an empty array [] or false
    • Tapping the active oscillation angle button will disable oscillation completely
  • verticalAngleButtons [optional] Whether the vertical angle buttons service is enabled. This allows to create buttons which can switch between different vertical oscillation angles. Only on supported devices! Default: "" (disabled)
    • Set an array of numeric values. Possible values depend on the fan model
    • Some fans support predefined vertical angle buttons, in the case if the property is not specified the vertical angle buttons are retrieved from the fan and displayed as switches. If you want to prevent that behaviour set the property value as an empty array [] or false
    • Tapping the active vertical oscillation angle button will disable vertical oscillation completely
  • ioniserControl [optional] Show a switch which allows to quickly enable/disable the ioniser on your fan. Only on supported devices! Default: false
  • fanLevelControl [optional] Show fan level switches which allow to change the fan level. Only on supported devices! Default: true

Troubleshooting

If you have any issues with the plugin or fan services then you can run homebridge in debug mode, which will provide some additional information. This might be useful for debugging issues.

Homebridge debug mode:

homebridge -D

Deep debug log, add the following to your config.json:

"deepDebugLog": true

This will enable additional extra log which might be helpful to debug all kind of issues.

Special thanks

miio - the Node.js remote control module for Xiaomi Mi devices.

HAP-NodeJS & homebridge - for making this possible.

homebridge-xiaomi-fan's People

Contributors

merdok avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

homebridge-xiaomi-fan's Issues

Understandable models

Hi,

Thanks for working on this plugin!
It would be great if marketing names (like 2S or 1C) could be added behind the technical names in the readme. That would be good for discoverability and for knowing which fan to buy. I for example am looking to buy a comparable fan but I can't find anything with these technical names.

Stijn

Why don't you make the oscillating angle a picklist?

You currently allow the user to create individual buttons for individual oscillating angles.
This provides for some clutter in the UI.

Have you looked at using e.g. the TV source selection picklist control to allow the user to select one of Off,30°,60°,90° or 120°?

Error: The requested accessory 'xioamifan' was not registered by any plugin.

@merdok First of all, thanks for your work and sharing.

I am using my Smartmi Fan (ZRFFS01ZM) with Battery, Natural wind, White stand (not sure what the exact model is) with the https://github.com/YinHangCode/homebridge-mi-fan since many moth now.
But of course I would love to give your plugin a chance and see if it is a perfect replacement for the old plugin.

Unfortunately I did not get it to work. Any Idea?
I am running several plugins on my Pi 3 B+.
[email protected] | [email protected] | npm 6.10.3 | [email protected] | [email protected]

        {
            "accessory": "xiaomifan",
            "name": "Xiaomi Fan",
            "ip": "xxx.xxx.xxx.xx",
            "token": "12a356b7c8d2b89e12fgh1i3j45kl67m",
            "pollingInterval": 5,
            "moveControl": true,
            "buzzerControl": true,
            "ledControl": true
        }
[Aug 11 18:24:53 raspberrypi-3BPlus homebridge[2724]: [2019-8-11 18:24:53] Loaded plugin: homebridge-xiaomi-fan
Aug 11 18:24:53 raspberrypi-3BPlus homebridge[2724]: [2019-8-11 18:24:53] Registering accessory 'homebridge-xiaomi-fan.xiaomifan'

Aug 11 18:24:57 raspberrypi-3BPlus homebridge[2724]: [2019-8-11 18:24:57] Error: The requested accessory 'xiaomifan' was not registered by any plugin.
Aug 11 18:24:57 raspberrypi-3BPlus homebridge[2724]:     at API.accessory (/usr/local/lib/node_modules/homebridge/lib/api.js:64:13)
Aug 11 18:24:57 raspberrypi-3BPlus homebridge[2724]:     at Server._loadAccessories (/usr/local/lib/node_modules/homebridge/lib/server.js:297:42)
Aug 11 18:24:57 raspberrypi-3BPlus homebridge[2724]:     at Server.run (/usr/local/lib/node_modules/homebridge/lib/server.js:91:38)
Aug 11 18:24:57 raspberrypi-3BPlus homebridge[2724]:     at module.exports (/usr/local/lib/node_modules/homebridge/lib/cli.js:59:10)
Aug 11 18:24:57 raspberrypi-3BPlus homebridge[2724]:     at Object.<anonymous> (/usr/local/lib/node_modules/homebridge/bin/homebridge:17:22)
Aug 11 18:24:57 raspberrypi-3BPlus homebridge[2724]:     at Module._compile (internal/modules/cjs/loader.js:816:30)
Aug 11 18:24:57 raspberrypi-3BPlus homebridge[2724]:     at Object.Module._extensions..js (internal/modules/cjs/loader.js:827:10)
Aug 11 18:24:57 raspberrypi-3BPlus homebridge[2724]:     at Module.load (internal/modules/cjs/loader.js:685:32)
Aug 11 18:24:57 raspberrypi-3BPlus homebridge[2724]:     at Function.Module._load (internal/modules/cjs/loader.js:620:12)
Aug 11 18:24:57 raspberrypi-3BPlus homebridge[2724]:     at Function.Module.runMain (internal/modules/cjs/loader.js:877:12)
Aug 11 18:24:57 raspberrypi-3BPlus homebridge[2724]:     at internal/main/run_main_module.js:21:11](url)

Mi fan 2 is not reliable on HOOBS

Hi there,
using hoops and the fan is not reliable. 50% of the time is not responding to my control from HomeKit.
New issue that started the past 2 days is that its showing fan "on" without any reason when fan is off, when shutting it down it sometimes jumps back to on again with no input on my side.
other than that Fan is working correctly on mihome app and with Alexa.

Thanks!

Set buzzer only works on one fan

When using the "set rotation direction"-button on my first fan it changes the volume form low to high and vice versa. I can also see this in the logs being confirmed:

Aug 15 19:36:40 xxx homebridge[12829]: [8/15/2020, 19:36:40] [xiaomifan] [Ventilator Wohhnzimmer] Successfully executed set_buzzer with value 2! Result: ok
Aug 15 19:36:49 xxx homebridge[12829]: [8/15/2020, 19:36:49] [xiaomifan] [Ventilator Wohhnzimmer] Successfully executed set_buzzer with value 1! Result: ok

The second fan doesn't work, nothing appears in the logs and the button in the HomeKit window returns to its previous setting.

Any reason why moving support for dmaker.fan.p5 has been removed?

I initially was going to contact you directly but ehh it's not that serious problem anyway so GitHub issue it is. In version 0.9.5, moving left or right was fully working for dmaker.fan.p5. Then in version 1.0.0, you've removed the feature completely for dmaker fans. I saw that you rewrote and split the code to smartmi and dmaker fans, so I wonder if this is a temporary thing or it's gonna stay this way? I actually had downgraded to 0.9.5 because of this, but then I just modified the code a bit and it works now at least for me.

can connect fan but can't control fan

@merdok It is a cool plugin, but I meet some troubles. I run homebridge in my MacBook and I got the token from android apk without miio.
Here is log:

[5/10/2020, 11:45:38 PM] [My Xiaomi Fan] Xiaomi Fan - connected to Fan
[5/10/2020, 11:45:38 PM] [My Xiaomi Fan] MiioDevice {
  model=dmaker.fan.p5,
  types=miio,
  capabilities=
}
false
false
(node:18623) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'log' of undefined
    at /usr/local/lib/node_modules/homebridge-xiaomi-fan/index.js:312:26
(node:18623) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:18623) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
(node:18623) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'log' of undefined
    at /usr/local/lib/node_modules/homebridge-xiaomi-fan/index.js:312:26
(node:18623) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)
(node:18623) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'log' of undefined
    at /usr/local/lib/node_modules/homebridge-xiaomi-fan/index.js:312:26
(node:18623) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 3)
(node:18623) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'log' of undefined
    at /usr/local/lib/node_modules/homebridge-xiaomi-fan/index.js:312:26
(node:18623) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 4)
ifconfig: sysctl IFDATA_SUPPLEMENTAL: Cannot allocate memory

Thanks a lot.

Fan connected but error requesting dmaker fan properties

The fan seems to connect successfully but there seems to be an error while requesting fan properties.

This is the homebridge log:

[6/25/2020, 2:39:13 PM] [My Xiaomi Fan] Initializing xiaomifan accessory...
[6/25/2020, 2:39:33 PM] [My Xiaomi Fan] Xiaomi Fan - found Fan in network. Trying to connect...
[6/25/2020, 2:39:33 PM] [My Xiaomi Fan] Xiaomi Fan - connected to Fan
[6/25/2020, 2:39:33 PM] [My Xiaomi Fan] MiioDevice {
  model=dmaker.fan.1c,
  types=miio,
  capabilities=
}
[6/25/2020, 2:39:33 PM] [My Xiaomi Fan] Xiaomi Fan - fan model info file already exists, not saving!
[6/25/2020, 2:39:45 PM] [My Xiaomi Fan] Xiaomi Fan - error while requesting dmaker fan properties: Error: Call to device timed out
    at Timeout.retry [as _onTimeout] (/homebridge/node_modules/homebridge-xiaomi-fan/node_modules/miio/lib/network.js:487:18)
    at listOnTimeout (internal/timers.js:549:17)
    at processTimers (internal/timers.js:492:7) {
  code: 'timeout'
}

My fan config:

{
            "name": "My Xiaomi Fan",
            "ip": "192.168.1.212",
            "token": "fe2b5e2833a98418ec59c609e21700b7",
            "prefsDir": "/homebridge/.xiaomiFan",
            "pollingInterval": 20,
            "moveControl": false,
            "buzzerControl": false,
            "ledControl": false,
            "accessory": "xiaomifan"
}

Issue with Token on Mi Fan 1C

Hi there,

First of, thank you for your work in this plugin! Im having an issue with adding my 1C fan to homekit. If i use the example config it shows up in the add accessory window but when i change the token to to the one of my fan it doenst show up. I got this token using the device backup and the miIO device library command, both giving the same code. Every token works except for the correct token.
Log:
[xiaomifan] Init - initializing devices
[xiaomifan] Init - initializing device with name: Xiaomi Fan 2s
Xiaomi Fan 2s is running on port 45597.

Feature request: Move fan x degree left/right from neutral point

Hi,

I would like to ask if this is possible: I want to have a switch to move the fan exact x degree from neutral point in left or right direction.

With that, I could make switches so automatically align the fan to the desired places, like couch or bed. You could say, "Hey Siri, Fan bed" and it would move to the bed direction.

At the moment you can move it with the switches, but since there is no "neutral point" it is impossible to automate effectively, because the alignment is always different.

Regards

plugin error in iobroker.ham

Hey i try to user homebridge-xiaomi-fan in an running iobroker.homebridge instance.

sadly after editing the config i get errors during start

ham.1 2020-07-07 17:10:20.012 error (14783) Error: The requested accessory 'xiaomifan' was not registered by any plugin.
ham.1 2020-07-07 17:10:20.011 error (14783) uncaught exception: The requested accessory 'xiaomifan' was not registered by any plugin.
2020-07-07 17:10:24.290 error Caught by controller[3]: [2020-7-7 17:10:23] Error: Plugin /opt/iobroker/node_modules/iobroker.ham/node_modules/homebridge-xiaomi-fan requires a HomeBridge version of >=1.0.0 which does not satisfy t
host.buanet-iobroker1 2020-07-07 17:10:24.289 error
host.buanet-iobroker1 2020-07-07 17:10:24.289 error
host.buanet-iobroker1 2020-07-07 17:10:24.288 error

Support for HOOBS is gone

Using the plugin for a few weeks now on HOOBS new version when trying to input the config in the configuration section in plugin page on HOOBS seems to not working at all and shutdown the entire bridge for HOOBS.

homebridge problem

Hi trying to install this, but I get only this message

Error: Cannot find module 'semver'
Require stack:

  • /usr/share/npm/lib/utils/unsupported.js
  • /usr/share/npm/bin/npm-cli.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:965:15)
    at Function.Module._load (internal/modules/cjs/loader.js:841:27)
    at Module.require (internal/modules/cjs/loader.js:1025:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at Object. (/usr/share/npm/lib/utils/unsupported.js:2:14)
    at Module._compile (internal/modules/cjs/loader.js:1137:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10)
    at Module.load (internal/modules/cjs/loader.js:985:32)
    at Function.Module._load (internal/modules/cjs/loader.js:878:14)
    at Module.require (internal/modules/cjs/loader.js:1025:19) {
    code: 'MODULE_NOT_FOUND',
    requireStack: [
    '/usr/share/npm/lib/utils/unsupported.js',
    '/usr/share/npm/bin/npm-cli.js'
    ]
    }

Command failed. Please review log for details.

Swing Mode

Hi, are there any plans to add a HomeKit Switch for choosing SwingMode? (Standard / Natural)
I see get.SwingMode in index, but no config etc.

Thanks
Tobias

buzzerControl with rotation direction switch not working on Xiaomi Smartmi Fan 2S (zhimi.fan.za4)

I use this plugins for some days now and nearly everything is working very well. Many thanks for your work!
But i have a last one problem with my Xiaomi Smartmi Fan 2S (zhimi.fan.za4) model.

In readme buzzerControl is described as:

buzzerControl
[optional] Whether the buzzer service is enabled. This allows to turn on/off the fan buzzer.
On Smartmi fans the rotation direction switch can be used to select between loud or quiet buzzer level.
Default: true

But no matter if I set this value to true or false, the rotation direction switch (blue circle arrow) in Homekit fan device do not act as buzzerControl switch. If set to true, it just creates a normal switch button that works smoothly.

Am i doing something wrong?

Move control not working

I read the move control was added back, but with latest version 1.0.2 if I press the switches nothing happens.

Xiaomi Fan 2s won't respond within HomeKit

I just received my Xiaomi Fan 2s today and added to homebridge with this plugin.
The device is added to HomeKit so I can see it there, but when I try to interact with it, HomeKit this the device is not responding. Using the Xiaomi app works as it should.

When restarting homebridge all I see in the log file concerning the fan is
[2020-7-22 20:32:19] [Ventilator] Initializing xiaomifan accessory...

In #13 I saw way more info in the log file - like "found Fan in network" and so on. So maybe somethings wrong there!?

I already have some other Xiaomi devices with different plugins in Homebridge, so I'm pretty confident, that I got the token thing right.

Any help is appreciated.

Xiaomi fan 2S connection problem

Hello

i have a question to the plugin. I use a xiaomi fan 2S with your plugin and my home App. When the xiaomi is connectet with electricity it works. But when the xiaomi is without electricity it canceled the connection to wifi after a time and get sleeping. after that i can not use it with the home app. I have to torn on it with the button. only then he connectec again with the wifi and with the xiaomi app but not with the home app. i have to restart the homebridge. what is the fail?

here my config
"devices": [
{
"name": "Ventilator",
"ip": "192.168.178.51",
"token": "eb...............................be98",
"pollingInterval": 10,
"moveControl": true,
"buzzerControl": false,
"ledControl": true,
"naturalModeButton": true,
"shutdownTimer": true,
"angleButtons": [
30,
90,
120
]
}
],
"platform": "xiaomifan"

Duplicate label in Log Entry

The following entry duplicates the label [Fan]. One of them could be removed from the log entry ;)

[7/14/2020, 16:28:08] [Fan] [Fan] Connected to Fan zhimi.fan.za3

Future support Xiaomi Smart Pedestal Fan (zhimi.fan.v3)

Hello,

first of all many thanks for the ingenious plug-in!

Would it be possible to use the Xiaomi Smart Pedestal Fan Gen. 1 (zhimi.fan.v3)
is supported?
Currently it can be detected, but the fan cannot be controlled via HomeKit.
It would be great when this would work.

Thanks a lot!

Switches are still displayed

Hello Merdok,

first of all many thanks for this great plugin!! 👍👏

But I noticed the following. If the value "false" is entered in the config.json for BuzzerControl, LEDControl and MoveControl, the respective switches in the HomeApp are still loaded.

Only when I have changed the stand values in Index.js to "false" they are no longer displayed in the HomeApp.

If this is an error or if I have set the configuration wrong.

Thank you very much for your help!

Fan does not appear in HomeKit in 1.3

Before the 1.3 release I got the fan (Xiaomi Fan 2s, zhimi.fan.za4) working in HomeKit. However, after the 1.3 release, there is no fan available.

The config:

{
            "platform": "xiaomifan",
            "devices": [
                {
                    "name": "Xiaomi Fan 2s",
                    "ip": "XX.XX.XX.XX",
                    "token": "XXXXXXXXXXXXXXXXXXXX",
                    "pollingInterval": 10,
                    "moveControl": true,
                    "buzzerControl": true,
                    "ledControl": true,
                    "naturalModeButton": true,
                    "shutdownTimer": true,
                    "angleButtons": [
                        30,
                        60,
                        90,
                        120
                    ]
                }
            ]
        },

The logs in homebridge:

[7/30/2020, 9:29:30 AM] [xiaomifan] [Xiaomi Fan 2s] Found Fan zhimi.fan.za4
[7/30/2020, 9:29:30 AM] [xiaomifan] [Xiaomi Fan 2s] Creating SmartmiFan device!
[7/30/2020, 9:29:30 AM] [xiaomifan] [Xiaomi Fan 2s] Setting up fan!
[7/30/2020, 9:29:30 AM] [xiaomifan] [Xiaomi Fan 2s] Getting device info.
[7/30/2020, 9:29:30 AM] [xiaomifan] [Xiaomi Fan 2s] Got fan did: 116769850.
[7/30/2020, 9:29:30 AM] [xiaomifan] [Xiaomi Fan 2s] Doing model specific setup.
[7/30/2020, 9:29:30 AM] [xiaomifan] [Xiaomi Fan 2s] Adding properties to fan.
[7/30/2020, 9:29:30 AM] [xiaomifan] [Xiaomi Fan 2s] Doing initial properties fetch.
[7/30/2020, 9:29:30 AM] [xiaomifan] [Xiaomi Fan 2s] Starting property polling.
[7/30/2020, 9:29:30 AM] [xiaomifan] [Xiaomi Fan 2s] Setup finished!
[7/30/2020, 9:29:30 AM] [xiaomifan] [Xiaomi Fan 2s] Fan model info file already exists, not saving!

I already deleted the persist and accessories directory and re-installed the plugin but I got no luck.
Any other ideas?

Future support Xiaomi Smart Pedestal Fan (zhimi.fan.v3)

Hello,

first of all many thanks for the ingenious plug-in!

Would it be possible to use the Xiaomi Smart Pedestal Fan Gen. 1 (zhimi.fan.v3)
is supported?
Currently it can be detected, but the fan cannot be controlled via HomeKit.
It would be great when this would work.

Thanks a lot!

I have the latest model, but I cannot use the plugin

model:dmaker.fan.p10
log:

5/28/2020, 2:35:46 PM] [Xiaomi Fan 2] Xiaomi Fan - connected to Fan
[5/28/2020, 2:35:46 PM] [Xiaomi Fan 2] MiioDevice {
  model=dmaker.fan.p10,
  types=miio,
  capabilities=
}
[5/28/2020, 2:35:46 PM] [Xiaomi Fan 2] Xiaomi Fan - error occured could not write fan model info [Error: ENOENT: no such file or directory, open '~/.xiaomiFan/info_19216850118_466f849648a1bea6611f59f156b5fe36'] {
  errno: -2,
  code: 'ENOENT',
  syscall: 'open',
  path: '~/.xiaomiFan/info_19216850118_466f849648a1bea6611f59f156b5fe36'
[5/28/2020, 2:35:49 PM] [Xiaomi Fan 2] Xiaomi Fan - error while requesting led state: Error: busy.
    at Object.reject (/homebridge/node_modules/homebridge-xiaomi-fan/node_modules/miio/lib/network.js:475:13)
    at DeviceInfo.onMessage (/homebridge/node_modules/homebridge-xiaomi-fan/node_modules/miio/lib/network.js:374:8)
    at Socket.<anonymous> (/homebridge/node_modules/homebridge-xiaomi-fan/node_modules/miio/lib/network.js:160:11)
    at Socket.emit (events.js:310:20)
    at UDP.onMessage (dgram.js:924:8) {
  code: -30012
}
[5/28/2020, 2:35:52 PM] [Xiaomi Fan 2] Xiaomi Fan - error while requesting power state: Error: busy.
    at Object.reject (/homebridge/node_modules/homebridge-xiaomi-fan/node_modules/miio/lib/network.js:475:13)
    at DeviceInfo.onMessage (/homebridge/node_modules/homebridge-xiaomi-fan/node_modules/miio/lib/network.js:374:8)
    at Socket.<anonymous> (/homebridge/node_modules/homebridge-xiaomi-fan/node_modules/miio/lib/network.js:160:11)
    at Socket.emit (events.js:310:20)
    at UDP.onMessage (dgram.js:924:8) {
  code: -30012
}
[5/28/2020, 2:35:52 PM] [Xiaomi Fan 2] Xiaomi Fan - error while requesting child lock state: Error: busy.
    at Object.reject (/homebridge/node_modules/homebridge-xiaomi-fan/node_modules/miio/lib/network.js:475:13)
    at DeviceInfo.onMessage (/homebridge/node_modules/homebridge-xiaomi-fan/node_modules/miio/lib/network.js:374:8)
    at Socket.<anonymous> (/homebridge/node_modules/homebridge-xiaomi-fan/node_modules/miio/lib/network.js:160:11)
    at Socket.emit (events.js:310:20)
    at UDP.onMessage (dgram.js:924:8) {
  code: -30012
}
[5/28/2020, 2:35:52 PM] [Xiaomi Fan 2] Xiaomi Fan - error while requesting speed level: Error: busy.
    at Object.reject (/homebridge/node_modules/homebridge-xiaomi-fan/node_modules/miio/lib/network.js:475:13)
    at DeviceInfo.onMessage (/homebridge/node_modules/homebridge-xiaomi-fan/node_modules/miio/lib/network.js:374:8)
    at Socket.<anonymous> (/homebridge/node_modules/homebridge-xiaomi-fan/node_modules/miio/lib/network.js:160:11)
    at Socket.emit (events.js:310:20)
    at UDP.onMessage (dgram.js:924:8) {
  code: -30012
}
[5/28/2020, 2:35:52 PM] [Xiaomi Fan 2] Xiaomi Fan - error while requesting mode: Error: busy.
    at Object.reject (/homebridge/node_modules/homebridge-xiaomi-fan/node_modules/miio/lib/network.js:475:13)
    at DeviceInfo.onMessage (/homebridge/node_modules/homebridge-xiaomi-fan/node_modules/miio/lib/network.js:374:8)
    at Socket.<anonymous> (/homebridge/node_modules/homebridge-xiaomi-fan/node_modules/miio/lib/network.js:160:11)
    at Socket.emit (events.js:310:20)
    at UDP.onMessage (dgram.js:924:8) {
  code: -30012
}
[5/28/2020, 2:35:53 PM] [Xiaomi Fan 2] Xiaomi Fan - error while requesting swing mode state: Error: busy.
    at Object.reject (/homebridge/node_modules/homebridge-xiaomi-fan/node_modules/miio/lib/network.js:475:13)
    at DeviceInfo.onMessage (/homebridge/node_modules/homebridge-xiaomi-fan/node_modules/miio/lib/network.js:374:8)
    at Socket.<anonymous> (/homebridge/node_modules/homebridge-xiaomi-fan/node_modules/miio/lib/network.js:160:11)
    at Socket.emit (events.js:310:20)
    at UDP.onMessage (dgram.js:924:8) {
  code: -30012
}
[5/28/2020, 2:35:56 PM] [Xiaomi Fan 2] Xiaomi Fan - Fan found
[5/28/2020, 2:36:00 PM] [Xiaomi Fan 2] Xiaomi Fan - error while requesting buzzer state: Error: Call to device timed out
    at Timeout.retry [as _onTimeout] (/homebridge/node_modules/homebridge-xiaomi-fan/node_modules/miio/lib/network.js:487:18)
    at listOnTimeout (internal/timers.js:549:17)
    at processTimers (internal/timers.js:492:7) {
  code: 'timeout'
}
[5/28/2020, 2:36:00 PM] [Config] Starting terminal session
[5/28/2020, 2:36:06 PM] [Xiaomi Fan 2] Xiaomi Fan - Fan found
[5/28/2020, 2:36:14 PM] [Config] [homebridge-xiaomi-fan] Failed to check registry.npmjs.org for updates: Timeout: request took more than 15 seconds
[5/28/2020, 2:36:16 PM] [Xiaomi Fan 2] Xiaomi Fan - Fan found
[5/28/2020, 2:36:26 PM] [Xiaomi Fan 2] Xiaomi Fan - Fan found
[5/28/2020, 2:36:36 PM] [Xiaomi Fan 2] Xiaomi Fan - Fan found
[5/28/2020, 2:36:46 PM] [Xiaomi Fan 2] Xiaomi Fan - Fan found
[5/28/2020, 2:36:56 PM] [Xiaomi Fan 2] Xiaomi Fan - Fan found
[5/28/2020, 2:37:06 PM] [Xiaomi Fan 2] Xiaomi Fan - Fan found
[5/28/2020, 2:37:16 PM] [Xiaomi Fan 2] Xiaomi Fan - Fan found
[5/28/2020, 2:37:26 PM] [Xiaomi Fan 2] Xiaomi Fan - Fan found
[5/28/2020, 2:37:36 PM] [Xiaomi Fan 2] Xiaomi Fan - Fan found
[5/28/2020, 2:37:46 PM] [Xiaomi Fan 2] Xiaomi Fan - Fan found
[5/28/2020, 2:37:56 PM] [Xiaomi Fan 2] Xiaomi Fan - Fan found
[5/28/2020, 2:38:06 PM] [Xiaomi Fan 2] Xiaomi Fan - Fan found
[5/28/2020, 2:38:16 PM] [Xiaomi Fan 2] Xiaomi Fan - Fan found
[5/28/2020, 2:38:26 PM] [Xiaomi Fan 2] Xiaomi Fan - Fan found
[5/28/2020, 2:38:36 PM] [Xiaomi Fan 2] Xiaomi Fan - Fan found
[5/28/2020, 2:38:46 PM] [Xiaomi Fan 2] Xiaomi Fan - Fan found
[5/28/2020, 2:38:56 PM] [Xiaomi Fan 2] Xiaomi Fan - Fan found
[5/28/2020, 2:39:06 PM] [Xiaomi Fan 2] Xiaomi Fan - Fan found
[5/28/2020, 2:39:16 PM] [Xiaomi Fan 2] Xiaomi Fan - Fan found

Slow in response, timeout?

@merdok After a few days of use unfortunately the plugin didn't work well for me.
When I open Eve or Home App, the Fan switch is not responding a long time. Eve App is showing the circle a while, then exclamation mark symbol, and a few seconds later the fan is available. Please see video https://youtu.be/KFvNhxXq0YM
This brings the problem that Siri is pointing to that the Fan/Device is not responding. A few seconds later, it works after asking again. The major issue is with automations. Because of that the device is not responding in first place, the automation triggers not "Fan on" etc.
I never faced this issue with the old plugin of https://github.com/YinHangCode/homebridge-mi-fan
Any Idea? I'd like to prefer your plugin.
Thanks.

Plugin complaining about homebridge version even though it's updated

Hi,

Tried to install the plugin today, but it won't work properly. At first it complained about my homebridge version, but then I updated it, but it still says I'm running an older version? What can I do? I've tried rebooting everything, re-installing the plugin, re-adding it to the home app, but nothing is working?

ERROR LOADING PLUGIN homebridge-xiaomi-fan: [2020-7-29 22:18:16] Error: Plugin /usr/lib/node_modules/homebridge-xiaomi-fan requires a HomeBridge version of >=1.0.0 which does not satisfy the current HomeBridge version of 0.4.50. You may need to upgrade your installation of HomeBridge. at Plugin.load (/usr/local/lib/node_modules/homebridge/lib/plugin.js:56:11) at Server.<anonymous> (/usr/local/lib/node_modules/homebridge/lib/server.js:153:14) at Array.forEach (<anonymous>) at Server._loadPlugins (/usr/local/lib/node_modules/homebridge/lib/server.js:145:22) at new Server (/usr/local/lib/node_modules/homebridge/lib/server.js:57:24) at module.exports (/usr/local/lib/node_modules/homebridge/lib/cli.js:32:16) at Object.<anonymous> (/usr/local/lib/node_modules/homebridge/bin/homebridge:17:22) at Module._compile (internal/modules/cjs/loader.js:1137:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10) at Module.load (internal/modules/cjs/loader.js:985:32)

Error: The requested platform 'xiaomifan' was not registered by any plugin. at API.platform (/usr/local/lib/node_modules/homebridge/lib/api.js:134:13) at Server._loadPlatforms (/usr/local/lib/node_modules/homebridge/lib/server.js:327:45) at Server.run (/usr/local/lib/node_modules/homebridge/lib/server.js:90:36) at module.exports (/usr/local/lib/node_modules/homebridge/lib/cli.js:59:10) at Object.<anonymous> (/usr/local/lib/node_modules/homebridge/bin/homebridge:17:22) at Module._compile (internal/modules/cjs/loader.js:1137:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10) at Module.load (internal/modules/cjs/loader.js:985:32) at Function.Module._load (internal/modules/cjs/loader.js:878:14) at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)

Running version 1.1.1 of homebridge. Please let me know if you need anything else to assist me further.

Best,
Simon

using homebridge-xiaomi-fan with iobroker.ham

hey,

i am using homebridge-xiaomi-fan with iobroker.ham (v2.0)
as it looks like the plugin works and iobroker.ham gets green.... but i don't get any data set points for mapping into yahka...

is this plugin only for directly use in HomeKit?!

Log flooded with unnecessary data

Log flooded with unnecessary data

Since the latest v1.1.3 (or the version before) the log file is being flooded with message like the onse shown below.
The array consumes 5 lines per log entry, and thus uses up a lot of screen space.
Are so many log entries really necessary? Can they be reduced?

[7/14/2020, 07:51:11] [Fan] MiioDevice {
model=zhimi.fan.za3,
types=miio,
capabilities=
}
[7/14/2020, 07:51:12] [Fan] [Fan] Fan total use time: 1600 minutes.
[7/14/2020, 07:51:39] [Fan] [Fan] Connected to Fan zhimi.fan.za3
[7/14/2020, 07:51:39] [Fan] MiioDevice {
model=zhimi.fan.za3,
types=miio,
capabilities=
}
[7/14/2020, 07:51:40] [Fan] [Fan] Fan total use time: 1600 minutes.
[7/14/2020, 07:51:48] [Fan] [Fan] Connected to Fan zhimi.fan.za3
[7/14/2020, 07:51:48] [Fan] MiioDevice {
model=zhimi.fan.za3,
types=miio,
capabilities=
}
[7/14/2020, 07:51:51] [Fan] [Fan] Fan total use time: 1600 minutes.
[7/14/2020, 07:52:50] [Fan] [Fan] Connected to Fan zhimi.fan.za3
[7/14/2020, 07:52:50] [Fan] MiioDevice {
model=zhimi.fan.za3,
types=miio,
capabilities=
}
[7/14/2020, 07:52:51] [Fan] [Fan] Fan total use time: 1600 minutes.
[7/14/2020, 07:53:08] [Fan] [Fan] Connected to Fan zhimi.fan.za3
[7/14/2020, 07:53:08] [Fan] MiioDevice {
model=zhimi.fan.za3,
types=miio,
capabilities=
}

dmaker.fan.1c does not respond

Hi, I've bought Xiaomi Fan 1C recently and wanted to add it to Homekit.
I successfully added it at first time, controlling via Home app worked but then it stoped after a few days.
Device is available in Home app bot does not respond to any action.

Here is log from Homebrige:

[9/11/2020, 15:26:52] [xiaomifan] Init - initializing devices
[9/11/2020, 15:26:52] [xiaomifan] Init - initializing device with name: Fan
[9/11/2020, 15:26:52] [xiaomifan] [Fan] Found Fan dmaker.fan.1c
[9/11/2020, 15:27:12] [xiaomifan] [Fan] Connected to Fan dmaker.fan.1c
[9/11/2020, 15:27:45] [xiaomifan] [Fan] Connected to Fan dmaker.fan.1c
[9/11/2020, 15:32:00] [xiaomifan] [Fan] Connected to Fan dmaker.fan.1c
[9/11/2020, 15:32:31] [xiaomifan] [Fan] Connected to Fan dmaker.fan.1c
[9/11/2020, 15:32:49] [xiaomifan] [Fan] Connected to Fan dmaker.fan.1c
[9/11/2020, 15:32:50] [xiaomifan] [Fan] Connected to Fan dmaker.fan.1c

I also noticed that device changed token when I was playing with different wifi networks.
It doesn't work even with new token taken from iphone backup.

Is there anything I can to do help you with debugging?

dmaker.fan.1c connection error

Hi,
I'm trying to add the Xiaomi Smart Fan 1c, but I get the following error message in the homebridge log:

_[7/10/2020, 22:26:08] [My Xiaomi Fan] [My Xiaomi Fan] Connected to Fan dmaker.fan.1c
[7/10/2020, 22:26:08] [My Xiaomi Fan] MiioDevice {
model=dmaker.fan.1c,
types=miio,
capabilities=
}
(node:23589) UnhandledPromiseRejectionWarning: Error: Call to device timed out
at Timeout.retry [as onTimeout] (/usr/local/lib/node_modules/homebridge-xiaomi-fan/node_modules/miio/lib/network.js:487:18)
at listOnTimeout (internal/timers.js:549:17)
at processTimers (internal/timers.js:492:7)
(node:23589) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 8)

Is it because he is not supported or is there any other reason.

thanks
baschdie

Angle button power off

If I crate an angle button, the fan will start to turn (100°) but I can‘t deactivate that it will stop the movement.

Any ideas? Version is 1.0.0

Any plan to support dmaker.fan.p9?

I bought a MIJIA Tower Fan yesterday, but this plug-in doesn't support this device. This model name is dmaker.fan.p9. Is there any plan to support it?

Connection-faillure zhimi.fan.za4

Hi merdok,
I do fail to integrate my Fan correctly to the homebridge Setup.

I did get the Token of the Fan

resetting wifi
Connect pi to Fan wifi
request Token (discover)

I then copied the given Token, disconnected the pi from fans wifi and re-added the Fan to the mi home app.
Afterwards added the Fan to homebridge.

It was set up and integrated even into HomeKit on my device, but afterwards do only Producer errors in homebridge.

Did I Miss anything? Might the Token have changed when i re-added the Fan to mi home App?

Typo in Example configuration: xioamifan

@merdok

There is a typo in your example configuration.
xioamifan
"accessory": "xioamifan",

Should be "xiaomifan"

And a quick feedback.
The plugin worked with fan instantly.
Looks good to my with a quick test.
Although, the state on/off did not change or very slow. Sometimes the fan did not respond instantly. When the fan is turned on/off by another remote the status in eve app does not switch to the actual state. Only when manuel refresh.
Never had this problem with the old plugin.
Many a bit fine tuning? If there is anything I can do to help, please of course let me know.

Battery level is not showing, wich is good I think, because this was a problem with the other Plugin from https://github.com/YinHangCode/homebridge-mi-fan
I think my fan does not support showing battery level at all?
Thanks for your work and sharing.

Aug 11 19:35:58 raspberrypi-3BPlus homebridge[11176]: [2019-8-11 19:35:58] Loaded plugin: homebridge-xiaomi-fan
Aug 11 19:35:58 raspberrypi-3BPlus homebridge[11176]: [2019-8-11 19:35:58] Registering accessory 'homebridge-xiaomi-fan.xiaomifan'
Aug 11 19:35:58 raspberrypi-3BPlus homebridge[11176]: [2019-8-11 19:35:58] [Xiaomi Fan] Initializing xiaomifan accessory...
Aug 11 19:36:00 raspberrypi-3BPlus homebridge[11176]: [2019-8-11 19:36:00] [Xiaomi Fan] Xiaomi Fan - connected to Fan
Aug 11 19:36:00 raspberrypi-3BPlus homebridge[11176]: [2019-8-11 19:36:00] [Xiaomi Fan] MiioDevice {
Aug 11 19:36:00 raspberrypi-3BPlus homebridge[11176]:   model=zhimi.fan.za1,
Aug 11 19:36:00 raspberrypi-3BPlus homebridge[11176]:   types=miio,
Aug 11 19:36:00 raspberrypi-3BPlus homebridge[11176]:   capabilities=
Aug 11 19:36:00 raspberrypi-3BPlus homebridge[11176]: }

Napkin 2 11 08 19, 7 56 26 PM

Can help me with xiaomi tower fan

Hi, I got the xiaomi tower fan, think is the latest version product, it can be install at my mi home app but I can't see the fan at my Google assistant app as I can see other xiaomi products. Any chance I can control the fan thru Google assistant?

Homebridge Scene with more then one fan controls won‘t work

Hello,
i‘ve make a scenes with fan controls like:

Scene 1: fan on, rotation speed 40%, natural switch on, shutdown timer off.
Scene 2: fan on, rotation speed 100%, natural switch off, shutdown timer off.

When i switch between these scenes, only the rotation speed is changed. Natural switch is still on. No error logs.

Andy ideas?

dmaker.fan.p5 throwing Unhandled promise rejection

After update to 1.2.0, dmaker.fan.p5 has stopped working. Also 1.2.1 did not fix the issue, but slightly changed things.
Also, downgrading to 1.0.2 which was definitely working didn't help. Also throws UnhandledPromiseRejectionWarning.
It could be my network issue, so i'm investigating.

2020. 7. 27. AM 7:59:54 Loaded plugin "homebridge-xiaomi-fan".
2020. 7. 27. AM 7:59:54 Registering accessory "homebridge-xiaomi-fan.xiaomifan"
2020. 7. 27. AM 7:59:55 [Mi Fan 1X] Found Fan dmaker.fan.p5
2020. 7. 27. AM 7:59:55 [Mi Fan 1X] Creating DmakerFan device!
2020. 7. 27. AM 7:59:55 [Mi Fan 1X] Setting up fan!
2020. 7. 27. AM 7:59:55 [Mi Fan 1X] Getting device info.
2020. 7. 27. AM 7:59:55 [Mi Fan 1X] Got fan did: 242265925.
2020. 7. 27. AM 7:59:55 [Mi Fan 1X] Doing model specific setup.
2020. 7. 27. AM 7:59:55 [Mi Fan 1X] Starting property polling.
2020. 7. 27. AM 7:59:55 [Mi Fan 1X] Setup finished!
2020. 7. 27. AM 7:59:55 [Mi Fan 1X] Fan model info file already exists, not saving!
2020. 7. 27. AM 8:00:07 (node:29035) UnhandledPromiseRejectionWarning: Error: Call to device timed out
2020. 7. 27. AM 8:00:07 at Timeout.retry [as _onTimeout] (/root/.hoobs/node_modules/miio/lib/network.js:487:18)
2020. 7. 27. AM 8:00:07 at listOnTimeout (internal/timers.js:549:17)
2020. 7. 27. AM 8:00:07 at processTimers (internal/timers.js:492:7)
2020. 7. 27. AM 8:00:07 (node:29035) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
2020. 7. 27. AM 8:00:07 (node:29035) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
2020. 7. 27. AM 8:00:12 [Mi Fan 1X] Poll failed! No response from Fan! Stopping polling! Error: Error: Call to device timed out
2020. 7. 27. AM 8:00:12 [Mi Fan 1X] Trying to reconnect
2020. 7. 27. AM 8:00:12 [Mi Fan 1X] Could not connect to the fan! Retrying in 30 seconds!
2020. 7. 27. AM 8:00:42 [Mi Fan 1X] Connected to Fan dmaker.fan.p5
2020. 7. 27. AM 8:00:42 [Mi Fan 1X] Setting up fan!
2020. 7. 27. AM 8:00:42 [Mi Fan 1X] Getting device info.
2020. 7. 27. AM 8:00:42 [Mi Fan 1X] Doing model specific setup.
2020. 7. 27. AM 8:00:42 [Mi Fan 1X] Starting property polling.
2020. 7. 27. AM 8:00:42 [Mi Fan 1X] Setup finished!
2020. 7. 27. AM 8:00:54 (node:29035) UnhandledPromiseRejectionWarning: Error: Call to device timed out
2020. 7. 27. AM 8:00:54 at Timeout.retry [as _onTimeout] (/root/.hoobs/node_modules/miio/lib/network.js:487:18)
2020. 7. 27. AM 8:00:54 at listOnTimeout (internal/timers.js:549:17)
2020. 7. 27. AM 8:00:54 at processTimers (internal/timers.js:492:7)
2020. 7. 27. AM 8:00:54 (node:29035) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)
2020. 7. 27. AM 8:00:55 [Mi Fan 1X] Poll failed! No response from Fan! Stopping polling! Error: Error: busy.
2020. 7. 27. AM 8:00:55 [Mi Fan 1X] Trying to reconnect
2020. 7. 27. AM 8:00:55 [Mi Fan 1X] Could not connect to the fan! Retrying in 30 seconds!

Battery mode

Hey,
Is it somehow possible to get the info if the fan is running on battery or from mains?

I have some automations going that are suitable just for the fixed position on main. But if I unplug it and set it up somewhere else, let it run on battery, these automations shouldn’t run and therefore it would be nice to let the automations and triggers know if it is running on battery or not.
Maybe there is some data hidden underneath. 🤷🏻‍♂️

No Access to MI smart Standing Fan C1 and cutting the connection to the fan

Dear merdok,
thanks for your support.

This is my issue, using the plugin with the brand new 1C fan.

Thanks for a response
Kind Regards
Thomas

I've installed the plugin and did a step by step installation using IP and token. The token was defined and set to the plugin.
But there is no access (no reaction to the settings at my homeKit).
My fan is a MI smart Standing Fan 1C (brand new).

This is what happened during the restart of the home bridge:

[7/20/2020, 3:12:30 PM] [My Xiaomi Fan] Connected to Fan dmaker.fan.1c
(node:367) UnhandledPromiseRejectionWarning: Error: busy.
at Object.reject (/homebridge/node_modules/homebridge-xiaomi-fan/node_modules/miio/lib/network.js:475:13)
at DeviceInfo.onMessage (/homebridge/node_modules/homebridge-xiaomi-fan/node_modules/miio/lib/network.js:374:8)
at Socket. (/homebridge/node_modules/homebridge-xiaomi-fan/node_modules/miio/lib/network.js:160:11)
at Socket.emit (events.js:315:20)
at UDP.onMessage (dgram.js:910:8)
(node:367) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 248)

BTW:
If i have used the plugin and the token there is no access via the Xiaomi App anymore.
Firmware is the actual version (2.0.4.0003.)
Thanks for your support.

Add thing to control for oscillating angle

First of all, thank you for present this home bridge.

I am using the Xiaomi fan of 2s and first model.

Is it possible to add separate fan accessory in order to control oscillating angle?

For example, if the swing mode of the related fan is on, this fan accessory will be on and after checking the oscillating angle, the number of angle will be fan speed.
(30 degree - 30, 60 degree - 60, 90 degree - 90, 120 degree - 100)

And to control the oscillating angle, if the fan speed of this new fan accessory is changed, the oscillating angle will be changed as following,
(1 ~ 30 : 30 degree, 31 ~ 60 : 60 degree, 61 ~ 90 : 90 degree, 91 ~ 100 : 120 degree)

Please consider it.

Two 2sfans constantly throwing errors

I have two Xiaomi 2s fans configured via this great plugin. Unfortunately, the longer my Homebridge is up and running, the more errors ("UnhandledPromiseRejectionWarning") I see in my log. How can I solve this?

Timer extension

Hello,
i don't have your plugin installed yet but will do it soon. Thanks for your work!

I still have an idea for an extension. Is it possible that you install a slider on the device that can be used as a timer for the fan?

Would be pretty cool 😃

Fans keep connecting and disconnecting every few seconds

As the title says my two 2s keep connecting and disconnecting every few seconds.

This is what the plugin reports in console:

Jun 24 13:43:17 homebridge[388]: [6/24/2020, 1:43:17 PM] [Ventilator Schlafzimmer] Xiaomi Fan - lost connection to fan. Disconnecting...
Jun 24 13:43:35 homebridge[388]: [6/24/2020, 1:43:35 PM] [Ventilator Schlafzimmer] Xiaomi Fan - found Fan in network. Trying to connect...
Jun 24 13:43:35 homebridge[388]: [6/24/2020, 1:43:35 PM] [Ventilator Schlafzimmer] Xiaomi Fan - connected to Fan
Jun 24 13:43:35 homebridge[388]: [6/24/2020, 1:43:35 PM] [Ventilator Schlafzimmer] MiioDevice {
Jun 24 13:43:35 homebridge[388]:   model=zhimi.fan.za4,
Jun 24 13:43:35 homebridge[388]:   types=miio,
Jun 24 13:43:35 homebridge[388]:   capabilities=
Jun 24 13:43:35 homebridge[388]: }
Jun 24 13:43:38 homebridge[388]: 100
Jun 24 13:43:47 homebridge[388]: [6/24/2020, 1:43:47 PM] [Ventilator Wohnzimmer] Xiaomi Fan - lost connection to fan. Disconnecting...
Jun 24 13:43:47 homebridge[388]: [6/24/2020, 1:43:47 PM] [Ventilator Schlafzimmer] Xiaomi Fan - lost connection to fan. Disconnecting...
Jun 24 13:43:56 homebridge[388]: [6/24/2020, 1:43:56 PM] [Ventilator Schlafzimmer] Xiaomi Fan - found Fan in network. Trying to connect...
Jun 24 13:43:56 homebridge[388]: [6/24/2020, 1:43:56 PM] [Ventilator Schlafzimmer] Xiaomi Fan - connected to Fan
Jun 24 13:43:56 homebridge[388]: [6/24/2020, 1:43:56 PM] [Ventilator Schlafzimmer] MiioDevice {
Jun 24 13:43:56 homebridge[388]:   model=zhimi.fan.za4,
Jun 24 13:43:56 homebridge[388]:   types=miio,
Jun 24 13:43:56 homebridge[388]:   capabilities=
Jun 24 13:43:56 homebridge[388]: }
Jun 24 13:44:05 homebridge[388]: [6/24/2020, 1:44:05 PM] [Ventilator Wohnzimmer] Xiaomi Fan - found Fan in network. Trying to connect...
Jun 24 13:44:05 homebridge[388]: [6/24/2020, 1:44:05 PM] [Ventilator Wohnzimmer] Xiaomi Fan - connected to Fan
Jun 24 13:44:05 homebridge[388]: [6/24/2020, 1:44:05 PM] [Ventilator Wohnzimmer] MiioDevice {
Jun 24 13:44:05 homebridge[388]:   model=zhimi.fan.za4,
Jun 24 13:44:05 homebridge[388]:   types=miio,
Jun 24 13:44:05 homebridge[388]:   capabilities=
Jun 24 13:44:05 homebridge[388]: }
Jun 24 13:44:27 homebridge[388]: [6/24/2020, 1:44:27 PM] [Ventilator Wohnzimmer] Xiaomi Fan - lost connection to fan. Disconnecting...
Jun 24 13:44:27 homebridge[388]: [6/24/2020, 1:44:27 PM] [Ventilator Schlafzimmer] Xiaomi Fan - lost connection to fan. Disconnecting...
Jun 24 13:44:36 homebridge[388]: [6/24/2020, 1:44:36 PM] [Ventilator Wohnzimmer] Xiaomi Fan - found Fan in network. Trying to connect...
Jun 24 13:44:36 homebridge[388]: [6/24/2020, 1:44:36 PM] [Ventilator Wohnzimmer] Xiaomi Fan - connected to Fan
Jun 24 13:44:36 homebridge[388]: [6/24/2020, 1:44:36 PM] [Ventilator Wohnzimmer] MiioDevice {
Jun 24 13:44:36 homebridge[388]:   model=zhimi.fan.za4,
Jun 24 13:44:36 homebridge[388]:   types=miio,
Jun 24 13:44:36 homebridge[388]:   capabilities=
Jun 24 13:44:36 homebridge[388]: }
Jun 24 13:44:36 homebridge[388]: [6/24/2020, 1:44:36 PM] [Ventilator Schlafzimmer] Xiaomi Fan - found Fan in network. Trying to connect...
Jun 24 13:44:36 homebridge[388]: [6/24/2020, 1:44:36 PM] [Ventilator Schlafzimmer] Xiaomi Fan - connected to Fan
Jun 24 13:44:36 homebridge[388]: [6/24/2020, 1:44:36 PM] [Ventilator Schlafzimmer] MiioDevice {
Jun 24 13:44:36 homebridge[388]:   model=zhimi.fan.za4,
Jun 24 13:44:36 homebridge[388]:   types=miio,
Jun 24 13:44:36 homebridge[388]:   capabilities=
Jun 24 13:44:36 homebridge[388]: }
Jun 24 13:45:07 homebridge[388]: [6/24/2020, 1:45:07 PM] [Ventilator Schlafzimmer] Xiaomi Fan - lost connection to fan. Disconnecting...
Jun 24 13:45:47 homebridge[388]: [6/24/2020, 1:45:47 PM] [Ventilator Wohnzimmer] Xiaomi Fan - lost connection to fan. Disconnecting...

Temperature & Humidity display option

I got an Mi fan 3 (zhimi.fan.za5) and it has Temperature & Humidity sensor, which i didn't never know before I saw it on Mi Home.
but sadly It seems this plugin doesn't support Temperature and Humidity Display. It's not that big deal for me, but It would be nice this plugin supports them!

Language inconsistencies between MiHome and this plugin

Language inconsistencies between MiHome and this plugin

Xiaomi Home: Turn left / Turn right
Plugin: Move left / Move right

Xiaomi: Buzzer
Plugin: Sound

Xiaomi: Light
Plugin: LED

Also Xioami app allows Mode to be Standard or Natural, but never both off. This could be accomplished with one switch: Natural = On/Off. When Natural is Off, the fan is in Standard Mode. When On, then in Natural mode. You could thus save a switch in the UI.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.