Connect AI to your Home Assistant

When you are done, you have a fresh Home Assistant installed with Claude AI connected and Zigbee2MQTT set up correctly, ready to get your smart home off the ground.

REMEMBER! Add routers to your Zigbee mesh FIRST (devices with mains power, e.g. smart plugs and light bulbs), so your mesh is strong before you start adding battery devices.

What you need
  • A running Home Assistant, or a PC and RepairGuyDK Installer for Home Assistant to install it (see step 0). Outside Denmark the installer is sold as an ISO file to download, which you write to a USB stick yourself with Rufus or balenaEtcher. The ready-made USB stick is only sold to customers in Denmark.
  • A free GitHub account for HACS. Create it now, and sign in.
  • A Claude account (free is enough to try it). Download Claude Desktop, and sign in with your account.
  • One of these two paths (you choose in step 4):
    • Path 1: Nabu Casa (Home Assistant Cloud). A paid subscription that makes Claude work everywhere, also on your phone and when you are away.
    • Path 2: A Windows PC on the same network as Home Assistant. Free, but only works at home in Claude Desktop.

Already have the accounts and Claude Desktop? Then skip this.

Each blue button opens Home Assistant in a new tab. Close the tab when you are done with the step, and go back to this guide.

  1. 0

    Do you have Home Assistant running?

    The guide starts when Home Assistant is already running on a PC in your home.

    Yes, I do Go straight to step 2.
    No, not yet Install it first with RepairGuyDK Installer for Home Assistant:
    1. If you bought the ISO file, first write it to an empty USB stick with Rufus (choose DD Image when it asks) or balenaEtcher. Everything on the stick is erased. If you have the USB stick from RepairGuyDK, skip this point.
    2. Plug the stick into the PC that will be your Home Assistant. The PC's entire disk is erased.
    3. In the BIOS: UEFI on, Secure Boot off, Legacy/CSM off
    4. Start the PC from USB (usually F9, F12, F11 or Esc at startup) and choose the UEFI entry
    5. Follow the instructions on the screen and type YES (in capital letters) when it asks
    6. Remove the stick, plug in a network cable and restart. Wait 10 to 20 minutes, then go to step 1.
  2. 1

    Open Home Assistant and create your account

    Open a browser on your PC or phone and go to:

    http://homeassistant.local

    Choose your language, create your user and enter where you live. Write down the password.

    First start: if the page shows "Preparing Home Assistant", wait 10 to 20 minutes. Home Assistant is downloading itself.

    Address not working? Use the IP address instead. It is shown on the screen of your Home Assistant PC, e.g. http://192.168.1.50

  3. 2

    Install HACS

    HACS is an extra app store for Home Assistant. We need it to get the AI connection.

    Already have HACS? If HACS is in the menu on the left in Home Assistant, go straight to step 3.

    A. Add HACS to Home Assistant
    1. The first time you click a button like this, the page asks for the address of your Home Assistant. The field already says http://homeassistant.local:8123. Delete it, type http://homeassistant.local without :8123 and click Save. If that does not work, type the IP address, e.g. http://192.168.1.50. It is shown on the screen of your Home Assistant PC. Then click Open link.
    2. Your Home Assistant asks if you want to add the repository. Click Add. A repository is just the address of an extra store.
    3. Go to Settings › Apps › Install app and type HACS in the search field at the top
    4. Open Get HACS, click Install and then Start. It only runs for a few seconds. It is completely normal that it shows as stopped afterwards.
    5. Restart Home Assistant: go to Settings, click the three dots at the top right and choose Restart Home Assistant. Wait 1 to 2 minutes until the page is back.
    B. Turn on HACS
    1. Click the blue Add integration button at the bottom right
    2. Type HACS in the search field and choose HACS
    3. Tick all the boxes and click Submit
    4. You get an 8-character code and a link to GitHub. Open the link, sign in to GitHub, enter the code and click Authorize HACS
    5. Go back to Home Assistant and click Finish. Press F5, and HACS is in the menu on the left.
  4. 3

    Install the AI connection (HA-MCP)

    HA-MCP is what lets Claude talk to your home. It lives inside Home Assistant.

    A. Get HA-MCP in HACS
    1. HACS opens the page for HA-MCP Custom Component. If it asks whether you want to add the repository, click Add.
    2. Click Download at the bottom right and then Download again
    3. Restart Home Assistant: go to Settings, click the three dots at the top right and choose Restart Home Assistant. Wait 1 to 2 minutes until the page is back.
      Do NOT skip the restart! Without it, you cannot find HA-MCP in the next step.
    B. Turn on HA-MCP
    1. Click the blue Add integration button at the bottom right
    2. Type HA-MCP in the search field and choose HA-MCP Custom Component
    3. Choose HA-MCP Server and click Submit
    4. Now it asks for an Administrator access token. Leave the window open, and open Home Assistant in a new tab (Ctrl+T)
    5. In the new tab: click your name at the bottom of the left menu, choose Security and scroll down to Long-lived access tokens
    6. Click Create token, type the name HA-MCP and click OK. Copy the code right away; it is only shown once
    7. Go back to the tab with HA-MCP Server, paste the code into Administrator access token, leave the username and password fields empty, and click Submit
    8. A message says the server has started, and HA-MCP appears in the menu on the left. Then it works.

    Important: There must only be one HA-MCP in your Home Assistant. Go to Settings › Apps and look for the app Home Assistant MCP Server. If it is there, open it and click Uninstall before you continue. If it is not there, you do not need to do anything.

  5. 4

    Choose your path and turn on access

    HA-MCP starts fully closed, so nobody can connect. Here you only open the path you want to use.

    Open HA-MCP Server

    Next to HA-MCP Server, click the gear. Then only do what is listed under your path:

    Path 1: With Nabu Casa Works in claude.ai, in the Claude app on PC and on your phone, also when you are away.
    1. Scroll past Home Assistant URL (advanced) and tick Remote access via webhook
    2. Leave Authentication mode on Sign in with Home Assistant (OAuth)
    3. Click Submit, and click the gear again
    4. Copy the address that contains ui.nabu.casa. Go to step 5.
    Path 2: At home only, free Works in Claude Desktop on a Windows PC on your home network.
    1. Click the Network access field (it says "This machine only (loopback)") and choose Local network
    2. Click Submit, and click the gear again
    3. Copy the entire address that contains :9584/private_, including http:// and :9584, e.g. http://192.168.1.50:9584/private_XJtn3QszNpRXaYYmM6YeVA. It must not start with 127.0.0.1. Go to step 6.

    Do not touch the other fields in the window.

    No address with ui.nabu.casa after Path 1? Then Nabu Casa is not turned on. Take Path 2.

    Does the address start with 127.0.0.1 after Path 2? Then Local network is not saved, and Claude cannot reach your Home Assistant. Click the gear again, choose Local network under Network access, click Submit and open the gear once more. Now the address starts with your Home Assistant's IP, e.g. http://192.168.1.50:9584/private_...

    Close the window with X once you have copied the address.

    The address is the key to your home. Whoever has it can control everything. Do not share it, and blur it in screenshots and videos.

  6. 5
    Path 1 only: Nabu Casa

    Give Claude the address

    You can do it in the browser on claude.ai or in Claude Desktop. The buttons are the same. You only need to do it in one of the places.

    The connection is saved on your Claude account. Afterwards it works everywhere you are signed in: in the browser, in Claude Desktop and on your phone.

    Open claude.ai
    1. Open claude.ai in the browser, or open Claude Desktop. Sign in if it asks you to.
    2. Click your name at the bottom left and choose Settings.
    3. In the menu on the left, click Connectors.
    4. Click the button to add a custom connector.
    5. In the Name field, type Home Assistant.
    6. In the URL field, paste the address with ui.nabu.casa from step 4 (right-click and choose Paste).
    7. Leave all other fields empty, and click Add.
    8. Your Home Assistant now opens. Sign in with your own Home Assistant user and click Allow. Claude is now connected.

    Done with Path 1? Skip step 6 and go to step 7.

  7. 6
    Path 2 only: Locally on your PC

    Run the RepairGuyDK program

    The program connects Claude Desktop to your Home Assistant. You do not need to edit any files. If you do not have Claude Desktop yet, download it and sign in first.

    If you already have Claude Desktop, click Open Claude Desktop. If the browser asks whether it may open Claude, click Open. If you do not have it, click Download Claude Desktop first.

    Download RepairGuyDK HA AI connection

    Have the RepairGuyDK USB stick? Then the program is also on it, in the AI-connection folder on the REPAIRGUYDK drive.

    1. Right-click the downloaded zip file and choose Extract All
    2. Double-click START-HERE
    3. If Windows shows "Windows protected your PC", click More info and then Run anyway
    4. Paste the address with :9584/private_ from step 4 (right-click in the window to paste) and press Enter
    5. If Claude Desktop is running, the program asks: May the program close Claude Desktop now? (y/n). Type the letter y (for yes) and press Enter. The program installs what is needed and starts Claude again.
    6. In Claude Desktop, check under Settings › Developer that home-assistant is listed as running
  8. 7

    Try it

    1. Start a new chat:
      Path 1: on claude.ai, in Claude Desktop or on your phone
      Path 2: in Claude Desktop
    2. Type one of these and press Enter:
    • Can you see my Home Assistant?
    • Give me a health check of my Home Assistant.

    The first time, Claude asks whether it may use Home Assistant. Click Allow.

Extra: MQTT and Zigbee2MQTT

Do you have a Zigbee dongle, e.g. Home Assistant Connect ZBT or SONOFF? Then you can install MQTT and Zigbee2MQTT with four clicks. Each button opens the right page in your own Home Assistant.

Does the button show the My Home Assistant page with http://homeassistant.local:8123 in the field? Delete :8123 so it says http://homeassistant.local (or the IP address, e.g. http://192.168.1.50), and click Save. This happens when you use a different browser or phone than in step 2, and only needs to be done once per browser.

  1. A. Install Mosquitto (MQTT)Click Install, turn on all the switches and click Start.
  2. B. Set up MQTTConfirm that you want to set up MQTT, choose "Use the official Mosquitto Mqtt Broker app" and click Finish when it says Success.
  3. C. Add Zigbee2MQTTClick Add when it asks if you want to add the repository.
  4. D. Install Zigbee2MQTTClick Install and turn on all the switches. Do NOT click Start! Claude starts it for you in the last step.

Last step: Plug the Zigbee dongle into your Home Assistant PC. Start a new chat with Claude, and write:

Write this to Claude (copy/paste)Set up Zigbee2MQTT with my dongle and start it. Ask me which dongle I have. Save the port and adapter type in the app's settings, and under env_vars add name Z2M_ONBOARD_NO_SERVER with value "1", so the onboarding page is skipped. Read the settings back and check that they are saved before you start the app. Afterwards, check in the log that it is connected to the dongle and MQTT, and that it does not say "Onboarding page is available".

Claude finds the port and adapter type by itself and starts Zigbee2MQTT for you. You do not have to go through a setup page in Zigbee2MQTT afterwards.

🎉

Congratulations, your smart home is ready!

Home Assistant is running, Claude is connected, and Zigbee2MQTT is ready for your devices. Well done!

Next step: Add your routers (devices with mains power) first, so your Zigbee mesh is strong before the battery devices join.

Try writing to Claude: "Create an automation that turns on the hallway light when the sun goes down"

Enjoy, from RepairGuyDK 🔧

If something goes wrong

Which path should I choose?

If you have Nabu Casa (Home Assistant Cloud), take Path 1. It is the easiest, and Claude also works on your phone and when you are away. If you do not have Nabu Casa, take Path 2. It is free, but only works in Claude Desktop on a PC at home. You can see whether you have Nabu Casa under Settings › Home Assistant Cloud:

If it shows that you are logged in and connected, you have Nabu Casa. Take Path 1.

If it invites you to control your home while you are away, you do not have Nabu Casa. Take Path 2.

The buttons open a page that does not respond

Then your browser has saved a wrong address for your Home Assistant, usually with :8123 at the end. Open my.home-assistant.io/redirect/_change, delete what is there, type the address without :8123 (e.g. http://homeassistant.local or http://192.168.1.50) and click Save. Then try the button again.

homeassistant.local does not open

Some routers and phones cannot find the name. Use the IP address shown on the screen of your Home Assistant PC. You can also find it in your router's list of connected devices.

I cannot find Get HACS or HA-MCP
  • Get HACS: press F5 in the App Store. If that does not help, click the three dots at the top right and choose Check for updates.
  • HA-MCP under Add integration: you forgot the restart in step 3. Restart Home Assistant and try again.
Claude cannot see my Home Assistant
  • Path 1: check that Remote access via webhook is ticked under the HA-MCP Server gear, that you copied the entire address with ui.nabu.casa, and that Remote access is turned on under Home Assistant Cloud. Delete the connector in claude.ai and add it again.
  • Path 2: check that Network access is set to Local network under the HA-MCP Server gear. Close Claude completely via File › Exit (also from the icon by the clock) and open it again. Your PC must be on the same network as Home Assistant. Run the RepairGuyDK program again with the address containing :9584. Then check in Claude Desktop under Settings › Developer that home-assistant is listed.
  • Both paths: check that HA-MCP is in the menu on the left in Home Assistant. If Claude can see your things but not change them, click the gear next to HA-MCP Server and check that Read Only Mode is turned off (grey).
    Read Only Mode in HA-MCP Server with the switch turned off, marked in red
Where is the Claude Desktop settings file? (Path 2)

The RepairGuyDK program finds the file by itself, so you normally do not need to look for it. If you want to see it, open Claude Desktop, go to Settings › Developer and click Edit Config. The file is called claude_desktop_config.json.

  • Newer versions of Claude Desktop for Windows: C:\Users\YourName\AppData\Local\Claude-Data\claude_... where the folder ends with a code that differs from PC to PC
  • Older versions and many guides online: %APPDATA%\Claude
  • AppData is a hidden folder. Type the address directly in the address bar in File Explorer, or turn on hidden items under View.

The file belongs to your Windows user, not your Claude account. If you switch between several Claude accounts on the same Windows user, they all get the same connection. To keep them separate, use a separate Windows user.

Is it safe?

HA-MCP starts fully closed until you open your path in step 4. The address contains a long secret key that HA-MCP has created itself. With Path 2, everything runs only on your own network. With Path 1, the connection is encrypted through Nabu Casa, and Claude must also sign in with your Home Assistant user before it gets access. Claude asks for permission before it uses Home Assistant. If you have shared the address by mistake, delete HA-MCP Server under Devices & services and add it again; then you get a new one.

Can I use ChatGPT instead?

Maybe, but it is not tested, and it takes more than with Claude. ChatGPT can only add your own connector with Plus or higher, not with free or Go. You also need to turn on Developer mode in ChatGPT in the browser. It only works with Path 1 (Nabu Casa), because ChatGPT cannot use the RepairGuyDK program in Path 2. OpenAI also limits what ChatGPT may change through such a connector on the cheaper plans. This guide is made and tested for Claude, which already works with the free account.

Is free Claude enough?

To try it out, yes. Free Claude works with Home Assistant, and with Path 1 you may add one custom connector. Free has a limit on how much you can use it per 5 hours. Home Assistant tasks use a lot, because Claude reads your devices, automations and logs. "Turn off the living room light" is a small task, while "make a dashboard" can use most of a free quota. When the limit is reached, Claude asks you to wait. That is not an error.

If you want to use Claude to build automations, dashboards or install things like Zigbee2MQTT, we recommend Claude Pro, which gives at least 5 times as much usage. See current prices at claude.com/pricing.

I have upgraded to Claude Pro. Do I need to change anything?

No. If you upgrade the same Claude account, everything keeps working right away. With Path 1 the connection is saved on your Claude account, and with Path 2 it is on your PC. An upgrade changes neither.

If you instead created a new Claude account for Pro, with Path 1 you need to add the connector again as in step 5. Path 2 still works, because it follows your PC. Feel free to close Claude Desktop completely via File › Exit and open it again after the upgrade.

Can I undo it?

Yes. Delete HA-MCP Server under Settings › Devices & services, and remove the connector in claude.ai. The RepairGuyDK program saves a backup of Claude's settings before it changes anything.

Script and guide made by RepairGuyDK · Home Assistant, smart home and AI