Ubiquiti Unifi Controller Switch - Unblock/Block Device Access to Unifi network

Host should be the ip of your controller.
I don’t have quotes around my site but I also don’t have any spaces. I am not sure how things get parsed but quotes would hurt, it should match whatever you have your site name as.
My switches are visible in the Integration existing entities.

Thanks for the suggestions. I tried changing the host to my controller’s IP address and then using quotes on the site name as well as trying 116_Carter but no luck.

Mine looks like this.

unifi:
  controllers:
    - host: 192.168.1.106
      site: Default
      block_client:
        - '54:bd:79:e9:f0:e7'
        - 'a8:e3:ee:24:47:84'
        - 'f0:79:59:09:fe:5c'

In the Unifi Integration, the devices with this mac now have a switch.
My guess is that the issue is with the site containing a space.

If you open your unifi controller what is the url it goes to?
https://192.168.1.106:8443/manage/site/default/dashboard

Mine has default as that is my site name. Try using what ever yours says.

1 Like

Mine says:

https://192.168.x.xxx:8443/manage/site/default/dashboard as well.

I have tried site: Default but no luck. Thanks for your help all the same.

I am having a similar issue.
My config is the same as above

Device tracker entities are showing up but no switches.
Weirdly one switch shows up for my apple TV but it’s not one of the mac addresses in my config.

As I’m typing this (on mobile) I’m thinking that my site name is Default with capital D and I may have my configuration with lowercase d (a habit with yaml) . I’ll have to check when I get home.
That may be the issue there but why would the Apple TV switch get created when it’s not even in my block_client config?
Anyone else seeing something like that?

I’ve tried every combination of IP address and friendly name that I can think of and I can’t get that switch to appear. Can anyone confirm that this is actually working?

I recently moved my unifi control to a different PC (not on HA) and had to re-set it up and it worked without an issue for me…

Unfi Site name is Default.
Created an Administrator account in Unifi Controller

Added the Unifi Integration into HA using IP of the PC running the Controller and the Administrator account that I created in Unifi. Default port and did not check the “Controller using proper certificate”.

Added the below to the config file. And these 3 devices show a switch in the integration…

unifi:
  controllers:
    - host: 192.168.20.7
      site: Default
      block_client:
        - '54:bd:79:e9:f0:e7'
        - 'a8:e3:ee:24:47:84'
        - 'f0:79:59:09:fe:5c'

Thanks so much. I don’t know what I did differently this time but You inspired me to bow it all up and start over, went through your steps and I’m golden.

1 Like

Hi guys, it seems to me that this does not work!

I’ve tried it solution, tried changed som tings but it solution don’t work! I don’t know what I’m doing wrong, maybe it doesn’t work at all ? Can anyone confirm that this is actually working?

unifi:
controllers:
- host: 192.168.1.215
site: unifiha #But and tried “Default”
block_client:
- ‘f8:4e:73:13:XX:XX’
- ‘70:a2:b3:d2:XX:XX’
- ‘18:f4:6а:57:XX:XX’

After rectart HASS getting these errors:

Уровень: WARNING

Logger: homeassistant.components.unifi
Source: helpers/config_validation.py:699
Integration: unifi (documentation, issues)
First occurred: 11:43:53 (1 occurrences)
Last logged: 11:43:53

The ‘unifi’ option (with value ‘OrderedDict([(‘controllers’, [OrderedDict([(‘host’, ‘192.168.1.215’), (‘site’, ‘unifiha’), (‘block_client’, [‘f8:4e:73:13:d2:4e’, ‘70:a2:b3:d2:20:8а’, ‘18:f4:6а:57:4d:40’])])])])’) is deprecated, please remove it from your configuration. This option will become invalid in version 0.109

Any ideas! I am grateful to you!

version 0.108.6

Check the docs.

This is a UI integration now.

Thanks! I’m happy!)

Thanks! I’m happy!)

I for the life of me can not get block and unblock switch to work. I have unifi integration configured and the device trackers working and the rest of it fine. However the one client i expose in the configuration section “Create switches for serial numbers you want to control network access for.” gets a switch entity created but it does not block when i toggle it to block or unblock. However if i do it via the unifi system it does update to the switch.

Permission under unifi os seem to be right:

Nothing shows when debug is turned on:

logger:
  default: info
  logs:
    homeassistant.components.switch.unifi: debug

Any help would be appreciated.

It seems to be broken right now… Unifi Block Network Access for clients not working · Issue #73071 · home-assistant/core · GitHub.

Thanks @johntdyer

confirmed this is working as a fix.

1 Like

Is this working in the latest release? I upgraded to the first November release, tried to add a block switch but it wasn’t created.

Currently you need to restart home assistent after configure of a new block sensor

I must be doing something wrong. Configured a block sensor, rebooted and their are no new entities. Entity count is unchanged at 109 and there are no switch.xxxx entities.

I am seeing something strange after upgrading my UniFi controller. While I can see the devices as switches, I cannot “Unblock” them, and the current state is only accurately reflected after reloading the integration.

WiFi Device Unblock/Current State broken after UniFi Controller v7.2.95 Upgrade - Home Assistant Community (home-assistant.io)

Same issue as this turn_off switch created for network client immediately turns on again · Issue #81819 · home-assistant/core · GitHub it will be fixed with 2022.11.3