Bỏ qua đến nội dung
Setting Up a Programming Environment for Home Assistant

Setting Up a Programming Environment for Home Assistant

To make it easier to follow and work with the instructions on my blog, you need to set up a system of plugins from the beginning. These are essential utilities if you want to deeply customize HASS features.

Install Visual Studio Code

Visual Studio Code (VS Code) is a powerful source code editor that helps you easily edit configuration files in Home Assistant. You will often need to adjust the configuration.yaml file, and this tool makes that easy.

Installation steps

  1. In the Home Assistant interface, go to Settings > Add-ons > Add-on store
  2. Search for "Visual Studio Code" or "Studio Code Server" and click the result
  3. Click the INSTALL button to install the add-on
  4. After installation is complete, you can enable options such as:
    • Start on boot
    • Watchdog (Automatically restarts if there is an issue)
    • Auto update
    • Show in sidebar
  5. Click the START button to start the add-on
  6. Check the logs to make sure everything is working correctly
  7. Click OPEN WEB UI to open VS Code in your browser

Accessing VS Code

You can access VS Code via a web browser in the following ways:

  • Use the URL: http://[device_IP_address]:8443
  • Or through the sidebar in the Home Assistant interface if you have enabled the "Show in sidebar" option

Install HACS (Home Assistant Community Store)

HACS is a community-built "app store" that allows you to install integrations, themes, and custom cards that are not available in the official Home Assistant.

Installation steps

Automatic installation

Go to Settings > Add-ons > Add-on Store > Manage add-on repositories. Add this repo: https://github.com/hacs/addons

Next, refresh and type Get HACS. Click it to install as usual. After that you can continue from step 5 of the manual installation. There is no need to type commands. If you encounter errors, you can follow these manual steps.

Manual installation

Open the Visual Code interface of Home Assistant that you installed in the previous step, and run the HACS installation command:

wget -O - https://get.hacs.xyz | bash -

Restart Home Assistant:

  1. In the container interface, select Action > Restart
  2. Or in the Home Assistant interface, go to Settings > System > Restart

Integrating HACS into the interface

  1. After restarting, go to Settings > Devices & Services > Add Integration and search for HACS
  2. Follow the steps to authenticate with GitHub:
    • Copy the device code and open the provided GitHub link
    • Log in to GitHub (if you are not already logged in)
    • Enter the copied device code and click Continue
    • Click Authorize HACS
  3. Return to Home Assistant and complete the setup process

After successful installation, you will see HACS appear in the Home Assistant menu.

Install Samba Share

Samba Share allows you to access Home Assistant folders from other computers on your LAN as a network drive.

Installation steps

  1. In the Home Assistant interface, go to Settings > Add-ons > Add-on store
  2. Search for "Samba share" and click the result
  3. Click the INSTALL button to install the add-on
  4. Configure Samba Share:
    • Set a username and password (this is the login information for accessing the network drive, not related to your Home Assistant account)
    • Configure allowed_hosts according to your home network IP range. For example: if Home Assistant has the IP address 192.168.0.130, you can set allowed_hosts to 192.168.0.0/16
    • Review the shared folders and disable any that are unnecessary
  5. Save the configuration and start the add-on

Accessing Samba Share from Windows

  1. Open This PC from the Start menu
  2. Right-click on Network in the left panel and select Map network drive
  3. In the folder field, enter the IP address of Home Assistant using the syntax \\IP_address
  4. Select Browse and choose the folder you want to connect to
  5. Enter the username and password configured in the Samba Share add-on
  6. Select Remember my credentials if you want to save the login information

Accessing Samba Share from macOS

  1. Open the Finder application
  2. Click the Go menu > Connect To Server
  3. Enter the Home Assistant address using the syntax smb://IP_address
  4. Click Connect and choose the drive you want to connect to
  5. Enter the username and password configured in the Samba Share add-on[6][10]

Samba Share allows you to access important folders such as config, share, media, backup, and other folders in Home Assistant.

Conclusion

With these three tools, you now have a basic but powerful Home Assistant environment to manage, customize, and expand your smart home system. Visual Studio Code helps you edit configuration professionally, HACS extends Home Assistant’s capabilities with community integrations, and Samba Share lets you easily manage files from other devices on your network.


Bạn thấy bài viết hữu ích?

Đăng ký để nhận thông báo khi có bài viết mới.

Kiểm tra hộp thư để xác nhận email!
Bạn đã đăng ký thành công vào Geek Playground
Tuyệt vời! Tiếp theo, hoàn tất thanh toán để có quyền truy cập đầy đủ vào Geek Playground
Chào mừng trở lại! Bạn đã đăng nhập thành công.
Thành công! Tài khoản của bạn đã được kích hoạt đầy đủ, bạn hiện có quyền truy cập vào tất cả nội dung.
Thành công! Thông tin thanh toán của bạn đã được cập nhật.
Cập nhật thông tin thanh toán không thành công.