xiaomi_fan icon indicating copy to clipboard operation
xiaomi_fan copied to clipboard

dmaker.fan.1c issue: fans show-up but unavailable

Open Coldrush opened this issue 3 years ago • 8 comments

Hi there!

First of all, thanks for all your hard work, awesome that you are putting time into this to give all of us a great experience. Really appreciate it!

I have been trying to setup my Xiaomi 1C fans with the integration using HACS. Installing the integration was a breeze and same goes for setting up the fans in the configuration.yaml file. However, I'm running into an issue after they were added to my config file: my fans do show up in HA as entities but unfortunately both entities show up as "unavailable". I have tried to switch on the fans using the Dev Tools but that (obviously) doesn't work, too.

My log files say this:

Logger: custom_components.xiaomi_miio_fan.fan Source: custom_components/xiaomi_miio_fan/fan.py:879 Got exception while fetching the state: Unable to discover the device [IP], _retry=20

This is how my .yaml entry looks like:

fan:

  • platform: xiaomi_miio_fan name: Smart fan host: [IP address] token: [token] model: dmaker.fan.1c

What I have done:

  • Triple checked my setup; IP and token are correct
  • Restarted HA multiple times
  • Looked at the logs - and there's no funny business to see with exception of the above error code.

I was hoping somebody could point me into the right direction?

Coldrush avatar Jun 07 '21 01:06 Coldrush

Could you describe your network setup? Do you use complex things like VLANs?

syssi avatar Jun 07 '21 04:06 syssi

Thanks for quick response!

Yes, I do have a slightly more advanced netwerk setup. However, while I was troubleshooting, I did move one of the fans to my main VLAN so that server

  • fan are on same VLAN. That unfortunately didn't solve the problem either. I can ping the fans, and both can be reached on main VLAN as well as sub VLAN.

Hope this info helps!

On Mon, Jun 7, 2021, 06:47 Sebastian Muszynski @.***> wrote:

Could you describe your network setup? Do you use complex things like VLANs?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/syssi/xiaomi_fan/issues/135#issuecomment-855572460, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAGPI7WJY4DP5CLQ64VFQUTTRRFNVANCNFSM46GTHC7A .

Coldrush avatar Jun 07 '21 08:06 Coldrush

Please troubleshoot your network setup. The esp8266 of the Fan doesn't have a full-featured ip-stack. Please move your devices (client & server) to a simple network setup for testing to get a better understanding what's happening.

syssi avatar Jun 07 '21 08:06 syssi

Thanks for the help @syssi! Good news - moving the fan to the same VLAN as HA does work. It didn't seem to work at first so I'll list my steps here for everybody who happens to find this thread during their Google quest.

  1. Use the top 2 buttons on the fan to reset the wifi. Make sure to release the buttons ONLY AFTER the fan shows a blinking orange light
  2. Reboot your full network (this might was an issue with only my network setup; you might not need to do this)
  3. Use the Mi app to re-add the fan
  4. You will need to extract the token again because your token changes after you have reset the wifi
  5. Use your new token and IP address to update your configuration file.
  6. Reboot Home Assistant

I will continue to monitor whether the fans continue to work. Let's keep our fingers crossed.

Coldrush avatar Jun 07 '21 21:06 Coldrush

I have this issue as well but my HA and fan are on two different VLANS. I suppose there is no simple work around on this?

filikun avatar Jun 17 '21 17:06 filikun

Unfortunately, no. This is a hardware related constraint so software isn't going to be able to solve this one. Here's more info: https://python-miio.readthedocs.io/en/latest/troubleshooting.html

I have taken the actions above and then blocked inbound and outbound traffic. No perfect solution but safe enough for me.

Coldrush avatar Jun 17 '21 18:06 Coldrush

just to chime in ... I dont think this is hardware related as I am able to work without an issue across VLANs with the fan being blocked from having any outbound network access and only local inbound access from the phone. Nevertheless, I was also unable to get it to work across VLANs yet ...

FYI - i got it working using Outbound NAT / IP Masquerading on pfsense ...