Home Assistant UniFi Integration (HOW-TO)

Sdílet
Vložit
  • čas přidán 1. 07. 2024
  • My UniFi equipment in Amazon (affiliate link) - amzn.to/3wfgGHn
    After you finish watching this Home Assistant Ubiquiti UniFi video you will be able to do presence detection, block network access for any clients, check bandwidth and uptime sensors and more. Everything that you will need is Home Assistant and UniFi network equipment.
    ► TIME TABLE
    00:00 Intro
    00:24 What you need for this video?
    01:21 Home Assistant UniFi integration
    02:22 Home Assistant UniFi integration options
    03:29 Add Home Assistant card with sensors and switch
    04:19 UniFi clients uptime sensor fix
    06:20 Home Assistant UniFi presence detection
    07:42 Home Assistant UniFi Automation example
    09:59 Testing the automation
    ► MY GUIDE - ON SALE
    Smart Home Getting Started Smart Home Guide v2.0 - peyanski.com/product/smart-ho...
    ► AFFILIATE LINKS
    Ubiquiti UniFi Dream Machine (UDM) - amzn.to/34B0FQK
    Ubiquiti UniFi Security Gateway (USG) - amzn.to/2WCYNCk
    Ubiquiti Networks Networks UniFi Security Gateway Pro (USG-PRO-4) - amzn.to/3palPwQ
    UniFi Dream Machine Pro (UDM-Pro) - amzn.to/3paw3gG
    Raspberry Pi 4 4GB Starter Kit with 32GB Micro SD Card - amzn.to/3qaI5qN
    Best Crypto currency exchange Binance - www.binance.com/en/register?r...
    Tech that I’m using right now - www.amazon.com/shop/kpeyanski
    Get $100 in credit over 60 days for DigitalOcean - m.do.co/c/6dd2caef1f1f
    ► SUPPORT MY WORK
    Patreon - / kpeyanski
    Paypal - www.paypal.me/kpeyanski
    Bitcoin - 1GnUtPEXaeCUVWdJxCfDaKkvcwf247akva
    Revolut - revolut.me/kiriltk3x
    ► TEMPLATE UPTIME SENSOR FOR THE NATIVE UNIFI UPTIME SENSOR
    configuration.yaml entry
    sensor:
    - platform: template
    sensors:
    YOUR_NEW_SENSOR_NAME_uptime:
    friendly_name: “Whatever you wish “
    value_template: "{{states('sensor.YOUR_UPTIME_SENSOR_uptime').split('T')[1].split('+')[0]}}"
    ► HOME ASSISTANT UNIFI EXAMPLE AUTOMATION
    automations.yaml entry
    alias: If Apple TV uptime reached and Kiril is not home
    description: ''
    trigger:
    - platform: state
    entity_id: sensor.appletv_uptime
    to: '00:00:10'
    condition:
    - condition: device
    domain: device_tracker
    entity_id: device_tracker.kiril_phone
    type: is_not_home
    action:
    - service: switch.turn_off
    target:
    entity_id: switch.apple_tv_4
    mode: single
    ► COME AND SAY “HI”
    My Discord server - invite.gg/kpeyanski
    Twitter - / kpeyanski
    ✅ Don't Forget to like 👍 comment ✍ and subscribe to my channel!
    ► DISCLAIMER
    Some of the links above are affiliate links, where I earn a small commission if you click on the link and purchase an item. You are not obligated to do so, but it does help fund these videos in hopes of bringing value to you!
  • Jak na to + styl

Komentáře • 37

  • @raymondsiew1696
    @raymondsiew1696 Před 2 lety +1

    Awesome Video! Wonder if you could do a video covering POE of/off with HomeAssistant on USW?

  • @buf0rd
    @buf0rd Před 2 lety +1

    THANK YOU!

    • @KPeyanski
      @KPeyanski  Před 2 lety

      You are very welcome. Feel free to check my other videos as well!

  • @lobatodan
    @lobatodan Před 2 lety

    Tks to share!

  • @speakup11
    @speakup11 Před 2 lety

    I found the uptime generated by the Unifi to be very unpredictable. Sometimes it just "pauses" when offline and continues afterwards, having the client device more than 3 days connected, while clearly having been disconnected from the wifi multiple times. It looks in some cases the uptime reverts back to the time the UDM rebooted. Will try to create a service timer in HA which triggers when the device gets online. Hope this will be more stable.

  • @Talk2Giuseppe
    @Talk2Giuseppe Před 2 lety +1

    Would really like to get this integration going - but I'm unable to get past the Set Up screen. Even tried creating a new admin user in Unifi and it simply won't go... Perhaps you could do a video on making sure we have the data right with Ubiquiti? I tried username, email, lowercase, proper case, port number changes (how to locate that on Unifi's site would be nice!)... Nothing... Gave up after a week of banging my head on the wall! :)

  • @sirnicolas21
    @sirnicolas21 Před 2 lety +1

    i can find "unifi network" and "unifi protect" integrations, the network is not showing the poe and rx/tx operations at all, my list doesn't have "ubiquity unifi" integration like you have (running a UDM-Pro)

  • @mskikitv1681
    @mskikitv1681 Před rokem +1

    Great video. Can HA act as a unfi controller? Or do I need to purchase a unifi controller?

    • @BrianMPedersen
      @BrianMPedersen Před rokem +2

      yes search: Home Assistant Community Add-on: UniFi Network Application; default port is with the docker install is 8443

    • @KPeyanski
      @KPeyanski  Před rokem +1

      Yes you can! Just add the UniFi add-on as Brian suggested

    • @mskikitv1681
      @mskikitv1681 Před rokem

      Great thank you!

  • @rstdude1
    @rstdude1 Před 3 lety

    When you block network access using the switch it blocks the device but devices already connected seem to keep working. Do you know a way to disconnect and block already connected devices? Thanks for the video!

    • @KPeyanski
      @KPeyanski  Před 3 lety

      Hmm, my Apple TV was connected to the network already and when I disabled the switch - I was unable to open CZcams app and to stream on it. So it was working as expected. Could you please try again on different devices?

    • @rstdude1
      @rstdude1 Před 3 lety +1

      @@KPeyanski So I isolated the issue to devices connected to one AP. Other APs would block and disconnect the devices fine. All the AP needed was a restart and it works fine now. Thanks for the reply!

    • @KPeyanski
      @KPeyanski  Před 3 lety

      Great to hear that. And thanks that you share the solution!

  • @juanmcons
    @juanmcons Před 3 lety

    Hi, when i do this it's say error, cannot connect. in the first window of the integration, do you know what can i do?

    • @KPeyanski
      @KPeyanski  Před 3 lety

      Check if the HA and UniFi controller are seeing each other. Also make sure that your Ubiquiti user is admin with local rights

    • @javandermerwe
      @javandermerwe Před 2 lety +1

      I had this issue as well and then realised my port was actually 8443, rather than the default 443. Perhaps check that on your setup.

    • @Yellowfin34
      @Yellowfin34 Před rokem +1

      @@javandermerwe Well I spent about 4 hours playing with this until I stumbled upon your comment. Works great, thank you!

  • @rallydanger07
    @rallydanger07 Před 3 lety

    How can i disconnect a device on a schedule?

    • @KPeyanski
      @KPeyanski  Před 3 lety

      You will need a time based automation. It is not hard.

    • @rallydanger07
      @rallydanger07 Před 3 lety

      @@KPeyanski any chance you can make a video, I'm sure this would help several people looking for Parental controls with UDM

  • @kevin4rsl
    @kevin4rsl Před 2 lety

    Whenever i input the ip, user, password and port. It does not work. Can you tell how to get that information correctly?

    • @KPeyanski
      @KPeyanski  Před 2 lety

      What kind of user are you trying? It should be a local one with admin privileges

    • @kevin4rsl
      @kevin4rsl Před 2 lety

      @@KPeyanski I have a unifi controller installed on a windows 10 computer with a unifi ap pro. It connected to my ISP modem/router but on modem mode only

    • @javandermerwe
      @javandermerwe Před 2 lety +1

      I had a similar issue and realised 443 wasn’t the correct port for me. When logged into my controller, I noticed it was 8443 instead. Check and confirm yours as 443 might be wrong for you

    • @kevin4rsl
      @kevin4rsl Před 2 lety

      @@javandermerwe already tried that. Still did not work

  • @taimaishublm
    @taimaishublm Před 2 lety

    I don't understand why I don't have the options button. haha

    • @KPeyanski
      @KPeyanski  Před 2 lety

      Hi, which options buttons you are talking about exactly?

  • @tonilundin
    @tonilundin Před 3 lety +1

    Guess this will not work when using 2f authentication

    • @KPeyanski
      @KPeyanski  Před 3 lety

      That is interesting question :) And I don't know the answer as I don't have 2fa enabled. If you have can you please try it and let us know the result. Thanks

    • @EsotericArctos
      @EsotericArctos Před 3 lety +2

      2FA does not yet work with the Home Assistant addon as far as I remember. May need a few people to get on GitHub and make it a feature request.

    • @KPeyanski
      @KPeyanski  Před 3 lety +1

      Yes, that could be very helpful. 2FA is really important especially after the Ubiquiti password leak issue few months ago.

    • @tonilundin
      @tonilundin Před 3 lety +2

      @@KPeyanskiJust tried. Dosent work with 2fa. But you can create a separate account with super complex password for HA. And have 2FA enable for your ordinary admin account

    • @KPeyanski
      @KPeyanski  Před 3 lety

      Thanks for the update Toni! And yes you can create another user and admin rights are not must if you don't want to block network access, but just read the data (presence & sensors)