Skip to content

Instantly share code, notes, and snippets.

@TheRolfFR
Created June 3, 2024 17:15
Show Gist options
  • Select an option

  • Save TheRolfFR/d87e5f917988bb2ff4324e393487e77d to your computer and use it in GitHub Desktop.

Select an option

Save TheRolfFR/d87e5f917988bb2ff4324e393487e77d to your computer and use it in GitHub Desktop.
Install Home Assistant SkyConnect to Home Assistant virtual machine with virsh

How to attach Home Assistant SkyConnect to your Home Assistant VM

  1. Buy the godamn module
  2. Get your VM with your ssh

Attach a device via virsh

This guide is based of this guide from RedHat. I must say it was pretty useful.

  1. In order to locate the SkyConnect device via USB. first run lsusb before plugging the module:

    Bus 008 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
    Bus 007 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
    Bus 006 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
    Bus 005 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
    Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
    Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
    Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
    Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
    
  2. and run it after plugging the device:

    Bus 008 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
    Bus 007 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
    Bus 006 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
    Bus 005 Device 002: ID 10c4:ea60 Silicon Labs CP210x UART Bridge
    Bus 005 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
    Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
    Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
    Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
    Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
    
  3. Check details about the USB device or whatever hex numbers written after ID:

    lsusb -d 10c4:ea60 -v
  4. Create an XML file and give it a logical name (skyconnect.xml, for example). I created mine in /var/lib/libvirt/qemu/usb as I have write rights there. Not very intelligent but I can always use this guide to remember where I put it. Make sure you copy the vendor and product IDs exactly as was displayed in your search:

    <hostdev mode='subsystem' type='usb' managed='yes'>
      <source>
        <vendor id='0x10c4'/>
        <product id='0xea60'/>
      </source>
    </hostdev>
  5. Find the name of your VM that you definetly forgot since you created 2 weeks ago:

    virsh list
     Id   Name   State
    ----------------------
     1    hass   running
  6. Attach the device with the following command:

    virsh attach-device hass --file skyconnect.xml --config

    Where hass is the name of your HA VM and skyconnect.xml the path to your previously created and saved usb device file. If you want to have the change take effect in the next reboot, use the --config option. If you want this change to be persistent, use the --persistent option. If you want the change to take effect on the current domain, use the --current option. See the Virsh man page for additional information.

    Once done, it should say this:

    Device attached successfully
    
  7. New device should be discovered:
    image
    image
    BINGO!

  8. Find a good tutorial to configure your Home Assistant SkyConnect!

Hope you enjoyed!

Note to future me Hello future me who forgot how to do, you suck!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment