Automate specific WIFI device (with status 'unavailable') reconnects in Unifi Network

Hi,

I am using the Unifi Network integration, I have many WIFI devices,

I’ve noticed that HA cannot reach the WIFI device (Unable to Ping from HA or Device Unavailable) although there is no issue if I ping from my PC or from the terminal in Unifi console.

If I go into the Unifi App, choose the device and force a “reconnect”, it usually fixes this in 10 secs.

I do not know what would be the root cause, in my HA, I have two network interfaces, 192.168.8.x (PC or higher speed network) and 192.168.5.x (IOT devices)

I do not know whether the issue is with Unifi or HA, so what I could think of is a workaround that reconnects the WIFI device when its status is ‘unavailable’.

Is there a way to do it better with Home Assistant? I.e., Currently, any device status changes to ‘unavailable’ will trigger all devices in the list to reconnect, is it possible to reconnect the specific device with ‘unavailable’ status without creating many Automation rules?

Thanks in advance.

Below my sample Automation rule

alias: Auto WIFI Reconnect
description: ""
trigger:
  - platform: homeassistant
    event: start
    enabled: false
  - platform: state
    entity_id:
      - media_player.googlehome4458
      - media_player.googlehome5604
      - climate.guest_bedroom_air_conditioning_companion
      - climate.master_bedroom_air_conditioning_companion
      - light.yeelight_stripe_0x5ec37cf
      - light.yeelight_stripe_0x5ec3aa8
    to: unavailable
condition: []
action:
  - service: unifi.reconnect_client
    data:
      device_id: xxxxxxxxxxxxxxxxxxxxxxx
  - delay:
      hours: 0
      minutes: 0
      seconds: 2
      milliseconds: 0
  - service: unifi.reconnect_client
    data:
      device_id: xxxxxxxxxxxxxxxxxxxxxxx
  - delay:
      hours: 0
      minutes: 0
      seconds: 2
      milliseconds: 0
  - service: unifi.reconnect_client
    data:
      device_id: xxxxxxxxxxxxxxxxxxxxxxx
  - delay:
      hours: 0
      minutes: 0
      seconds: 2
      milliseconds: 0
  - service: unifi.reconnect_client
    data:
      device_id: xxxxxxxxxxxxxxxxxxxxxxx
  - delay:
      hours: 0
      minutes: 0
      seconds: 2
      milliseconds: 0
  - service: unifi.reconnect_client
    data:
      device_id: xxxxxxxxxxxxxxxxxxxxxxx
  - delay:
      hours: 0
      minutes: 0
      seconds: 2
      milliseconds: 0
  - service: unifi.reconnect_client
    data:
      device_id: xxxxxxxxxxxxxxxxxxxxxxx
mode: single

There was a firmware update (starting with UAP Firmware 6.0.14) to “Improve compatibility with 2.4GHz IoT devices.” Are you running the latest firmware for your Unifi equipment?

Are you running the latest HA / Unifi Network integration?

Have you turned on Debugging integration for Unifi (see here)? Is there anything in the logs?

1 Like

Yes, all running the latest version, i would try to enable debug and extract the log.

Hi, I think the issue is not with Unifi but could be HA itself.

The reason is that I observe, I have two network Interfaces in HA, ENP0S3 (192.168.8.30) and ENP0S4 (192.168.5.30), subnets .8 and .5 handle different networks’ smart devices.

When the issue happens, either reconnect WIFI device or disable one of the network interfaces will allow the device to be pingable from HA. FYI I already unchecked the Auto Configure in the Network Adapter setting, currently both adapters are checked.

bump my post as no solution…

is there anyone using HA with UNIFI multiple networks without any issue? please share me your setup if possible, thanks.

or anyone has the idea to write the script that will be able to check the state for multiple wifi devices periodically and reconnect the wifi connect if the wifi device status is ‘unavailable’ or unable to ping? thanks.