Как установить home assistant на windows 10

Install Home Assistant on Windows

Install Home Assistant Operating System

Download the appropriate image

  • VirtualBox (.vdi)

  • KVM (.qcow2)

  • Vmware Workstation (.vmdk)

  • Hyper-V (.vhdx)

Follow this guide if you already are running a supported virtual machine hypervisor. If you are not familiar with virtual machines we recommend installation Home Assistant OS directly on a Raspberry Pi or an ODROID.

Create the Virtual Machine

Load the appliance image into your virtual machine hypervisor. (Note: You are free to assign as much resources as you wish to the VM, please assign enough based on your add-on needs).

Minimum recommended assignments:

  • 2 GB RAM
  • 32 GB Storage
  • 2vCPU

All these can be extended if your usage calls for more resources.

Hypervisor specific configuration

VirtualBox

KVM (virt-manager)

KVM (virt-install)

Vmware Workstation

Hyper-V

  1. Create a new virtual machine
  2. Select Type “Linux” and Version “Linux 2.6 / 3.x / 4.x (64-bit)”
  3. Select “Use an existing virtual hard disk file”, select the unzipped VDI file from above
  4. Edit the “Settings” of the VM and go “System” then “Motherboard” and select “Enable EFI”
  5. Then go to “Network” “Adapter 1” choose “Bridged Adapter” and choose your Network adapter

Please keep in mind that the bridged adapter only functions over a hardwired ethernet connection.
Using Wi-Fi on your VirtualBox host is unsupported.

6. Then go to «Audio» and choose «Intel HD Audio» as Audio Controller.

By default VirtualBox does not free up unused disk space. To automatically shrink the vdi disk image
the discard option must be enabled:

VBoxManage storageattach <VM name> --storagectl "SATA" --port 0 --device 0 --nonrotational on --discard on
  1. Create a new virtual machine in virt-manager
  2. Select “Import existing disk image”, provide the path to the QCOW2 image above
  3. Choose “Generic Default” for the operating system
  4. Check the box for “Customize configuration before install”
  5. Select your bridge under “Network Selection”
  6. Under customization select “Overview” -> “Firmware” -> “UEFI x86_64: …”. Make sure to select a non-secureboot version of OVMF (does not contain the word secure, secboot, etc.), e.g., /usr/share/edk2/ovmf/OVMF_CODE.fd.
  7. Click “Add Hardware” (bottom left), and select “Channel”
  8. Select device type: “unix”
  9. Select name: “org.qemu.guest_agent.0”
  10. Finally select “Begin Installation” (upper left corner)
virt-install --name hass --description "Home Assistant OS" --os-variant=generic --ram=2048 --vcpus=2 --disk <PATH TO QCOW2 FILE>,bus=sata --graphics none --boot uefi
  1. Create a new virtual machine
  2. Select “Custom”, make it compatible with the default of Workstation and ESX
  3. Choose “I will install the operating system later”, select “Linux” -> “Other Linux 5.x or later kernel 64-bit”
  4. Select “Use Bridged Networking”
  5. Select “Use an existing virtual disk” and select the VMDK file above,

After creation of VM go to “Settings” and “Options” then “Advanced” and select “Firmware type” to “UEFI”.

Hyper-V does not have USB support

  1. Create a new virtual machine
  2. Select “Generation 2”
  3. Select “Connection -> “Your Virtual Switch that is bridged”
  4. Select “Use an existing virtual hard disk” and select the VHDX file from above

After creation go to “Settings” -> “Security” and deselect “Enable Secure Boot”.

Start up your Virtual Machine

  1. Start the Virtual Machine
  2. Observe the boot process of Home Assistant Operating System
  3. Once completed you will be able to reach Home Assistant on homeassistant.local:8123. If you are running an older Windows version or have a stricter network configuration, you might need to access Home Assistant at homeassistant:8123 or http://X.X.X.X:8123 (replace X.X.X.X with your ’s IP address).

With the Home Assistant Operating System installed and accessible you can continue with onboarding.

Install Home Assistant Core

Install WSL

To install Home Assistant Core on Windows, you will need to use the Windows Subsystem for Linux (WSL). Follow the WSL installation instructions and install Ubuntu from the Windows Store.

As an alternative, Home Assistant OS can be installed in a Linux guest VM. Running Home Assistant Core directly on Windows is not supported.

This is an advanced installation process, and some steps might differ on your system. Considering the nature of this installation type, we assume you can handle subtle differences between this document and the system configuration you are using. When in doubt, please consider one of the other installation methods, as they might be a better fit instead.

Prerequisites

This guide assumes that you already have an operating system setup and have installed Python 3.10 (including the package python3-dev) or newer.

Install dependencies

Before you start, make sure your system is fully updated, all packages in this guide are installed with apt, if your OS does not have that, look for alternatives.

sudo apt-get update
sudo apt-get upgrade -y

Install the dependencies:

sudo apt-get install -y python3 python3-dev python3-venv python3-pip bluez libffi-dev libssl-dev libjpeg-dev zlib1g-dev autoconf build-essential libopenjp2-7 libtiff5 libturbojpeg0-dev tzdata

The above-listed dependencies might differ or missing, depending on your system or personal use of Home Assistant.

Create an account

Add an account for Home Assistant Core called homeassistant.
Since this account is only for running Home Assistant Core the extra arguments of -rm is added to create a system account and create a home directory.

sudo useradd -rm homeassistant

Create the virtual environment

First we will create a directory for the installation of Home Assistant Core and change the owner to the homeassistant account.

sudo mkdir /srv/homeassistant
sudo chown homeassistant:homeassistant /srv/homeassistant

Next up is to create and change to a virtual environment for Home Assistant Core. This will be done as the homeassistant account.

sudo -u homeassistant -H -s
cd /srv/homeassistant
python3 -m venv .
source bin/activate

Once you have activated the virtual environment (notice the prompt change to (homeassistant) [email protected]:/srv/homeassistant $) you will need to run the following command to install a required Python package.

python3 -m pip install wheel

Once you have installed the required Python package, it is now time to install Home Assistant Core!

pip3 install homeassistant==2023.2.2

Start Home Assistant Core for the first time. This will complete the installation for you, automatically creating the .homeassistant configuration directory in the /home/homeassistant directory, and installing any basic dependencies.

You can now reach your installation via the web interface on http://homeassistant.local:8123.

If this address doesn’t work you may also try http://localhost:8123 or http://X.X.X.X:8123 (replace X.X.X.X with your machines’ IP address).

When you run the hass command for the first time, it will download, install and cache the necessary libraries/dependencies. This procedure may take anywhere between 5 to 10 minutes. During that time, you may get “site cannot be reached” error when accessing the web interface. This will only happen for the first time, and subsequent restarts will be much faster.

Help us to improve our documentation

Suggest an edit to this page, or provide/view feedback for this page.

Update: новая статья

У новых пользователей часто возникает вопрос — можно ли установить Home Assistant на Windows?

Конечно можно! Проблема заключается в том, что не все зависимости Home Assistant легко установятся на любую сборку Windows. Об этом можно почитать тут.

На портале уже была статья о подобной установке. В своей версии я чуть подробнее опишу детали.

Идём на сайт python и скачиваем последнюю на момент написания статьи версию. Можно скачать как обычную, так и 64-битную версию.

В процессе установки Python я встречал следующие проблемы:

  • установка не стартовала на «голой» Windows 7 без важных обновлений — нужно обновить систему стандартным способом
  • установка не завершалась с недоступным сайтом python (из-за РКН) — нужно отключить опции download debug…

Вот у вас и установлен Python.

Далее нажимаем на клавиатуре win R и запускаем cmd

В запустившейся консоли вводим :

pip install homeassistant

Вот у вас и установлен последний Home Assistant.

На этом этапе у вас не должно возникнуть особых проблем. Python и HA должны установиться в практически любую систему.

Первый запуск Home Assistant

В той же консоли, что и ранее, просто вводим — hass.

Начнётся первый запуск HA. Он может быть достаточно долгим. HA будет скачивать и устанавливать разные библиотеки python, которые требуются конфигурации по умолчанию. А их не мало.

Плюс, если в процессе установки в вашей локальной сети обнаружатся поддерживаемые устройства — начнётся установка и их библиотек. В логе это отображается примерно так:

INFO (SyncWorker_1) [homeassistant.util.package] Attempting install of pychromecast==4.0.1

Вот на этом этапе вполне возможны проблемы и разные ошибки в консоли.

Терпеливо ждите пока HA делает свои дела. В идеале в конце лога вы должны увидеть строчку:

INFO (MainThread) [homeassistant.core] Starting Home Assistant

Далее попытайтесь открыть в любом браузере страницу:

http://localhost:8123/Вполне возможно у вас ничего не откроется. Это нормально.

План 2

Нажимайте в консоли Ctrl C, это принудительно остановит HA. Если не получится — закрывайте консоль и запускайте её заново.

И снова вводите в консоли — hass. И снова ждём строчку Starting Home Assistant и пробуем открыть в браузере:

http://localhost:8123/

План 3

Если со второй попытки страница так и не открылась — останавливаем HA и открываем папку с конфигами. Путь до неё показывается сразу после ввода команды hass. Это должно быть что-то вроде:

C:UsersAlexeyAppDataRoaming.homeassistant

Только с именем вашего пользователя. Проще вбить этот адрес сразу в проводнике Windows.

Теперь правим файл configuration.yaml.

Заменяем всё его содержимое на 3 простые строки:

config: frontend: system_health:

Это минимальный набор модулей, необходимый для старта HA и отображения главной страницы. Сильно сократит перечень зависимостей и повысит шансы старта.

Снова запускаем hass и пробуем открыть страницу.

PS

Это не все проблемы с которыми можно столкнуться. Но, надеюсь, вам хватит советов, описанных в статье.

На данный момент инструкция неактуальна. Текущие варианты установки можете посмотреть на официальном сайте HA.

В данной статье будет пошагово описан процесс установки home assistant на ПК под управлением Windows 10.

Важно отметить, что операционная система Windows не является основной для HA, что проявляется в неполной работоспособности программного обеспечения, в связи с чем установку HA на Win10 рекомендуется производить только для ознакомления с возможностями ПО.

Итак, приступим.

      1. Первым делом нам нужно установить Python. Идем на официальный сайт, выбираем последнюю версию, проматываем страницу вниз и выбираем нужный нам файл (например Windows x86-64 executable installer). Скачиваем и запускаем.
      2. При установке выбираем Customize installation -> на второй вкладке оставляем только pip -> на третьей выбираем Add Python to environment variables.
        Установка python для home assistant
      3. После того, как Python установится запускаем командную строку: нажимаем Win и R, в появившемся поле вводим cmd и нажимаем Ок.
      4. Вводим в командной строке pip install homeassistant, нажимаем Enter и ждем пока все установится. В случае ошибок внимательно читаем и делаем что там будет написано. В моем случае не было Visual C++ 14.0. Для исправления – скачиваем Build Tools для Visual Studio с официального сайта, устанавливаем и перезагружаем ПК.
        ошибка при установке HA visual c++ 14.0 is required python
      5. Программа установлена и для запуска осталось ввести команду hass в командной строке. На данном этапе может появляться много ошибок, возможно придется прервать запуск (Ctrl+C) и запустить заново. Также брандмауэр может попросить разрешить доступ. Разрешаем. В самом конце запуска в консоли должна появиться строчка со следующим содержанием: INFO (MainThread) [homeassistant.core] Starting Home Assistant.
      6. Далее запускаем браузер и вводим localhost:8123. Если все сделано правильно, то откроется окно регистрации учетной записи. Если ничего не получилось, то попробуйте еще раз выполнить пятый пункт.
      7. Поздравляю, мы установили Home Assistant на ПК под управлением Windows 10.

      Авторизация в Home Assistant

Ссылки на другие уроки по настройке Home Assistant.

В последнее время, мне как-то надоедает включать свою домашнюю виртуализацию, базирующуюся на Debian 10 + Proxmox 6 и работать с VM из-под браузера. Может конечно если что-то масштабное, то да. А вот с целью побыстрее обкатать то можно на рабочем месте использовать Virtualbox (я против использования Hyper-V)

Итак, рабочая Windows 10 Pro (Version 10.0.18363.592)

Железо:

  • Intel® Core™ i3-2120 CPU @ 3.30GHz
  • RAM: 8Gb
  • HDD: 250 SSD Samsung
  • Motherboard: Asus P8H61-M LX3 R2.0

Шаг №1: На рабочую Windows 10 Pro устанавливаю VirtualBox 6.1.12 (VirtualBox-6.1.12-139181-Win.exe)

Шаг №2: Скачиваю с официального сайта Home Assistant на момент (05.08.2020) написания данной заметки vmdk файл hassos_ova-4.11.vmdk.gz (его вес 243 395 КБ), распаковываю получается файл hassos_ova-4.11.vmdk (его вес 752 128 КБ)

Шаг №3: Создаю VM через Virtualbox

Virtualbox – Машина – Создать

  • Имя: srv-ha
  • Папка машины: C:VM
  • Тип: Linux
  • Версия: Other Linux (64-bit)

И нажимаю "Экспертный режим", указываю количество выделяемой данной VM оперативной памяти, к примеру 1024 и Жесткий диск выбираю "Использовать существующий виртуальный жесткий диск""Выбрать образ виртуального жесткого диска"Добавить – выбираю распакованный в C:VMhassos_ova-4.11.vmdk и нажимаю "Открыть""Выбрать" — и нажимаю "Создать"

Создаю VM через Virtualbox для Home Assistant

После пока VM еще выключена изменять (через меню "Настроить" на VM) тип сетевого адаптера с

  • Адаптер 1: Intel PRO/1000 MT Desktop (NAT)

На "Сетевой мост".

После запускаю VM путем нажатия на кнопку "Запустить"

На заметку: Если после запуска идет надпись в консоли VM "FATAL: No bootable medium found! System halted", то это значит нужно выключить VM: Машина – Завершить работу, открыть опять "Настроить" и в меню "Система" — вкладка "Материнская плата" и отменить галочкой

  • Включить EFI (только специальные ОС): включить галочкой

И нажимаю ОК, а затем нажимаю "Запустить". Вижу, как бегут строки загрузки VM

Виртуальная машина загружается, ожидаю...

После в консоли нажимаю клавишу Enter и вижу приглашение на авторизацию:

homeassistant login: указываю учетную запись root

И нажимаю клавишу Enter

После вижу приглашение:

Welcome on Home Assistant command line

ha > В этой консоли нужно ввести слово "login":

# набираю команду nmcli и вижу свой IP адрес, полученный от моего DHCP-сервиса в локальной сети

Отображение текущего IP адреса у Вашего Home Assistant под Virtualbox

Шаг №4: Теперь зная этот адрес я могу в своей локальной сети обратиться к сервису Home Assistant посредством браузера через URL строку: http://IP&DNS:8123 (http://192.168.10.185:8123)

http://192.168.10.185:8123/onboarding.html — создаю первый раз учетную запись пользователя

  • Имя: ekzorchik
  • Логин: ekzorchik
  • Пароль: 712mbddr@
  • Подтвердите пароль: 712mbddr@

И нажимаю "Создать учетную запись"

Именую свой Home Assistant: к примеру, как ekzhome

  • Часовой пояс: Europe/Moscow

И нажимаю "Далее" - "Готово"

После чего передо мной развернутый из заводского образа разработчиков система домашней автоматизации под Virtualbox операционной системы Windows 10 Pro. Когда у меня выдается свободные минуты я разбираю на работе что-то полезное для себя, как процесс самообразования:

Home Assistant успешно развернут внутри Virtualbox и готов к эксплуатации

Итого я в шагах задокументировал для себя, как под Virtualbox быстро и легко развернуть Home Assistant дабы иметь тестовый полигон настройки чтобы в последствии переносить только реально работающие решения и не засорять боевую систему. Так делаю я, да это почти двойная работа, но что в эксплуатации не должно страдать от тестов. На этом моя заметка завершена, с уважением автор блога Олло Александр aka ekzorchik.


Содержание

  1. Как установить умный дом Home Assistant
  2. Запускаем Home Assistant на Windows (Portable)
  3. Устанавливаем Home Assistant на Windows
  4. Установка Home Assistant
  5. Первый запуск Home Assistant
  6. Windows
  7. Install Home Assistant Operating System
  8. Download the appropriate image
  9. Create the Virtual Machine
  10. Hypervisor specific configuration
  11. Start up your Virtual Machine
  12. Install Home Assistant Core
  13. Install WSL
  14. Install dependencies
  15. Create an account
  16. Create the virtual environment
  17. Как установить Home Assistant в Virtualbox на Windows 10

Как установить умный дом Home Assistant

Это статья написана для напоминания, что умный дом стал намного ближе, чем мы думали.

Home Assistant-это open-source платформа для автоматизации, работающая на Python 3. Позволяет отслеживать и контролировать все устройства в доме и автоматизировать действия. Идеально может работать на одноплатном компьютере Raspberry PI.

137783341d63404d8673be8d05760052

Что такое умный дом можно почитать в википедии тут и тут.

Давайте по порядку:

1. Центральное ядро

Умный дом нуждается в центральном контроллере (хаб, сервер и т.д.). Это связующее звено между всеми элементами умного дома и пользователем. Бывают распределенные системы без центрального контроллера, но все равно нужен один сборщик информации, который покажет пользователю все актуальные новости каждого устройства

ПК-отличный вариант, если требуется большая нагрузка на сервер, т.к. производительности даже старых ноутбуков хватит вполне (только если вы не будете крутить 4К видео или использовать 10 камер с HEVC кодированием). Из минусов- в 95% случаев активное охлаждение и чтобы подключить обычное реле всегда приходится использовать дополнительные костыли.

Специализированные контроллеры — отличный вариант, если вам нужна надежность и отказоустойчивость. Вероятность отказа промышленного контроллера (при правильных руках) приближается к вероятности появления зомби апокалипсиса. Но есть и минус- программировать и настраивать могут либо те, кто уже автоматизировал несколько конвейеров, либо человек в мозгу которого не нейроны а релейные схемы. И чаще всего интерфейс у них, мягко говоря, аскетичный. К сожалению, я не такой умный, поэтому это вариант точно не для меня.

image loader

И тут мы приходим к самому современному варианту — это дешевые одноплатные компьютеры на базе ARM архитектуры. Сейчас их выбор просто огромен, но самый популярный родоначальник Raspberri pi. Из плюсов маленькое энергопотребление, есть пользовательские выводы и удовлетворительная производительность для запуска несложных программ.

Есть еще много экзотических вариантов автоматизации своего очага, например, кровать-будильник на Всемирной выставке 1851 года (изобретатель Теофиль Картер). Или любимое извращенство- ардуино с шилдами (прощу прощение за несерьезный мем)

fdf057a26c504747b3f280234a9fd07e

2. Внешние датчики, контроллеры, элементы управления.

Эта тема настолько обширная, что описать все многодикообразие в данной статье не представляется возможным, поэтому оставим это для будущих статей. Вкратце, есть:

— DIY решения и ардуиноподбные решения
— Китайские решения (пример Sonoff)
— Дорогие красивые решения (пример nest)

Тоже вынесем сие обсуждение в отдельную тему. Сегодня мы будем рассматривать только одну из множества открытых платформ. Обзоры еще будут. Сразу отвечу на вопросы, почему именно она:

а) Огромное количество поддерживаемых сервисов,
б) Легко и бесплатно установить,
в) Приятный интерфейс.

4. Сторонние сервисы

Помогают подключить разные существующие решения и автоматизировать действия на смартфонах и ПК. Типичный пример IFTTT.

Что делать если я не умею программировать или у меня есть деньги?
Отдельно стоят решения современных экосистем от Samsung, Xiaomi, Amazon, Apple, Google и т.д. Соглашусь, что порой их решения выглядят намного красИвее, но средняя заработная плата русского человека примерно 500$, что не позволяет ощутить всю гамму вкусов.

Рекомендуется к приобретению:

1. Raspberry Pi 3 (вероятно подойдут и более старые) 35$
2. MicroSD на 16ГБ не ниже 10 класса( чем быстрее, тем лучше) с адаптером к компьютеру 7$
3. Зарядник MicroUSB на 5В и больше чем 2А 0$ (подошел от старого телефона)
4. Ваше драгоценное время. Бесценно.
5. Опционально монитор с HDMI

После записи, извлекаем флешку и вставляем в распберри пи.

ОБЯЗАТЕЛЬНО НАДО ВСТАВИТЬ В МАЛИНУ ИНТЕРНЕТ-ШНУР.

При подаче питания должна загореться красная лампочка и зеленая начать хаотично мигать. Ждем с кружкой чая 10 минут.

После этого нам надо найти уже веб интерфейс нашей системы умного дома. Для этого есть несколько способов:

1) Посмотреть через hdmi нашу командную строку и найти там IP вида 192.168.1.х ( или любого другого)
2) посмотреть в настройках роутера какой DHCP сервер присвоил адрес новому устройству
3) Воспользоваться сканером сети (например, Advanced IP Scanner Portable)

После этого открываем браузер (не программу для скачивания браузеров, а именно браузер)
И вводим наш IP + :8123 (у меня это 192.168.1.101:8123)

И вуаля! Наша система загрузилась!

image loader

На официальном сайте все хорошо описано (но на английском) поэтому, если интересно, смогу написать несколько примеров как это делать в реальной жизни.

Все шаги я записал на видео, поэтому не стесняемся и заходим на видео.

Дорогие читатели, напишите в комментариях, что еще очень хочется увидеть?

Источник

Запускаем Home Assistant на Windows (Portable)

У меня уже была статья про установку Home Assistant на Windows.

В этом варианте его не нужно устанавливать:

Портативная версия Home Assistant под Windows. В комплекте уже есть:

PS: не стоит рассматривать HassWP, как боевое решение системы умного дома на века. Он будет полезен скорее для ознакомления и для экспериментов.

sprut

На Win10 не хочет работать

Для работы на Win10 необходимо установить Visual studio c компонентами C++

какой-то совсем не портативный вариант получается, это как за дрезиной тянуть два вагона запчастей

очень интересный вариант.
очень правильное направление.

скажите, кто-ниубудь продолжает разработку этого бандла? Может быть на коммерческой основе?

Источник

Устанавливаем Home Assistant на Windows

Конечно можно! Проблема заключается в том, что не все зависимости Home Assistant легко установятся на любую сборку Windows. Об этом можно почитать тут.

На портале уже была статья о подобной установке. В своей версии я чуть подробнее опишу детали.

Установка Home Assistant

На первом экране выбираем Customize installation.

На втором нам вполне хватит только pip. Остальные выключаем.

И последние галочки про precompile и debug. Возможно они помогут при установке хитрых зависимостей Home Assistant, но это не точно 🙂

Я люблю устанавливать Python в корень диска. Так проще его найти и можно избежать проблем с кривыми путями.

В процессе установки Python я встречал следующие проблемы:

Далее нажимаем на клавиатуре win R и запускаем cmd

В запустившейся консоли вводим :

На этом этапе у вас не должно возникнуть особых проблем. Python и HA должны установиться в практически любую систему.

Первый запуск Home Assistant

Начнётся первый запуск HA. Он может быть достаточно долгим. HA будет скачивать и устанавливать разные библиотеки python, которые требуются конфигурации по умолчанию. А их не мало.

Терпеливо ждите пока HA делает свои дела. В идеале в конце лога вы должны увидеть строчку:

Далее попытайтесь открыть в любом браузере страницу:

Только с именем вашего пользователя. Проще вбить этот адрес сразу в проводнике Windows.

Теперь правим файл configuration.yaml.

Заменяем всё его содержимое на 3 простые строки:

Это минимальный набор модулей, необходимый для старта HA и отображения главной страницы. Сильно сократит перечень зависимостей и повысит шансы старта.

Снова запускае м hass и пробуе м открыть страницу.

Это не все проблемы с которыми можно столкнуться. Но, надеюсь, вам хватит советов, описанных в статье.

Источник

Windows

Install Home Assistant Operating System

Download the appropriate image

Follow this guide if you already are running a supported virtual machine hypervisor. If you are not familiar with virtual machines we recommend installation Home Assistant OS directly on a Raspberry Pi or an ODROID.

Create the Virtual Machine

Load the appliance image into your virtual machine hypervisor. (Note: You are free to assign as much resources as you wish to the VM, please assign enough based on your add-on needs)

Minimum recommended assignments:

All these can be extended if your usage calls for more resources.

Hypervisor specific configuration

After creation of VM go to “Settings” and “Options” then “Advanced” and select “Firmware type” to “UEFI”.

Start up your Virtual Machine

With the Home Assistant Operating System installed and accessible you can continue with onboarding.

Install Home Assistant Core

Install WSL

To install Home Assistant Core on Windows, you will need to use the Windows Subsystem for Linux (WSL). Follow the WSL installation instructions and install Ubuntu from the Windows Store.

As an alternative, Home Assistant OS can be installed in a Linux guest VM. Running Home Assistant Core directly on Windows is not supported.

This guide assumes that you already have an operating system setup and have installed Python 3.8 (including the package python3-dev ) or newer.

Install dependencies

Install the dependencies:

Create an account

Create the virtual environment

First we will create a directory for the installation of Home Assistant Core and change the owner to the homeassistant account.

Next up is to create and change to a virtual environment for Home Assistant Core. This will be done as the homeassistant account.

Once you have installed the required Python package it is now time to install Home Assistant Core!

If this address doesn’t work you may also try http://localhost:8123 or http://X.X.X.X:8123 (replace X.X.X.X with your machines’ IP address).

When you run the hass command for the first time, it will download, install and cache the necessary libraries/dependencies. This procedure may take anywhere between 5 to 10 minutes. During that time, you may get “site cannot be reached” error when accessing the web interface. This will only happen for the first time, and subsequent restarts will be much faster.

Источник

Как установить Home Assistant в Virtualbox на Windows 10

В последнее время, мне как-то надоедает включать свою домашнюю виртуализацию, базирующуюся на Debian 10 + Proxmox 6 и работать с VM из-под браузера. Может конечно если что-то масштабное, то да. А вот с целью побыстрее обкатать то можно на рабочем месте использовать Virtualbox (я против использования Hyper-V )

Итак, рабочая Windows 10 Pro (Version 10.0.18363.592)

Шаг №1: На рабочую Windows 10 Pro устанавливаю VirtualBox 6.1.12 (VirtualBox-6.1.12-139181-Win.exe)

Шаг №2: Скачиваю с официального сайта Home Assistant на момент ( 05.08.2020 ) написания данной заметки vmdk файл hassos_ova-4.11.vmdk.gz (его вес 243 395 КБ ), распаковываю получается файл hassos_ova-4.11.vmdk (его вес 752 128 КБ )

Шаг №3: Создаю VM через Virtualbox

Virtualbox – Машина – Создать

How to install Home Assistant in Virtualbox on Windows 10 001

После пока VM еще выключена изменять (через меню «Настроить» на VM ) тип сетевого адаптера с

На «Сетевой мост».

После запускаю VM путем нажатия на кнопку «Запустить»

How to install Home Assistant in Virtualbox on Windows 10 002

После в консоли нажимаю клавишу Enter и вижу приглашение на авторизацию:

homeassistant login: указываю учетную запись root

И нажимаю клавишу Enter

После вижу приглашение:

Welcome on Home Assistant command line

ha > В этой консоли нужно ввести слово «login»:

How to install Home Assistant in Virtualbox on Windows 10 003

Шаг №4: Теперь зная этот адрес я могу в своей локальной сети обратиться к сервису Home Assistant посредством браузера через URL строку: http://IP&DNS:8123 (http://192.168.10.185:8123 )

http://192.168.10.185:8123/onboarding.html — создаю первый раз учетную запись пользователя

И нажимаю «Создать учетную запись»

Именую свой Home Assistant : к примеру, как ekzhome

How to install Home Assistant in Virtualbox on Windows 10 004

Итого я в шагах задокументировал для себя, как под Virtualbox быстро и легко развернуть Home Assistant дабы иметь тестовый полигон настройки чтобы в последствии переносить только реально работающие решения и не засорять боевую систему. Так делаю я, да это почти двойная работа, но что в эксплуатации не должно страдать от тестов. На этом моя заметка завершена, с уважением автор блога Олло Александр aka ekzorchik.

Источник

I’m going to install Home Assistant on Windows using VirtualBox. It may sound complicated, but it is not and I will show you everything step-by-step.

Home Assistant on Windows using VirtualBox Guide

I decided to move my Home Assistant installation from raspberry to a desktop PC to test is it going to be faster and more stable. It doesn’t matter If you are getting started with a fresh Home Assistant installation or just like me you want to migrate to a more powerful machine. This guide is tailored for you!

I’m will use VirtualBox on Windows 10, but you can use Linux or MacOS as your VirtualBox host and all of the steps that you will see in this video will be pretty much the same.

So let’s go:

Download and install VirtualBox for your OS

Nothing fancy here, just go to VirtualBox website then download and install the package for your Operating System. In my case this is Winodws.

If you have any difficulties with this step check my video above for detailed instructions.

Download Home Assistant Image file

Open the following link https://www.home-assistant.io/hassio/installation/ and download the VDI file under “As a virtual appliance (x86_64/UEFI)” bullet.

This is the virtual disk image that contains everything we need to start our Home Assistant on Windows.

Configure and install Home Assistant

To prevent yourself from issues in the future with not enough virtual storage, because by default Home Assistant VirtualDisk is 6GB only it is recommended to execute these several steps first.

Add the downloaded Home Assistant VDI image to Virtual Media Manager.

Home Assistant on Windows using VirtualBox Guide 1

You will need VirtualBox 6 or higher to have this Virtual Media Manager option.

You can increase the size to whatever is suitable for you. In this example the size will be increased to 100GB.

Increasing the initial size of the Home Assistant virtual disk to prevent disk space issues in the future.

Increasing the initial size of the Home Assistant virtual disk to prevent disk space issues in the future.

Apply the changes and you should have something similar (of course your VDI version will be different, newer not 3.13)

Increased Home Assistant Virtual Disk Size to avoid no free disk space in the future.

Increased Home Assistant Virtual Disk Size to avoid no free disk space in the future.

Next, create New Virtual Machine in VirtualBox application.

Clicking on the new button

Click on the new button.

After that type a name for you virtual machine and choose either Other Linux 32-bit or 64-bit depending of your system.

Choose Name and "Other Linux" here

Choose Name and “Other Linux” here

On the next dialog select the amount of RAM that you want to dedicate for this virtual machine. Absolute minimum should be 512MB.

Selecting the amount of RAM for the Home Assistant Virtual Machine

Selecting the amount of RAM for the Home Assistant on Windows Virtual Machine

The good think about this setting is that you can increase or decrease it at later stage if there is such need.

For the hard disk select the “Use an existing virtual hard disk file”.

Home Assistant on Windows using VirtualBox Guide 2

On the next dialog click on the “Add” button

Home Assistant on Windows using VirtualBox Guide 3

To add the VDI file just click Add.

At the end you should see something similar like the picture below, if you resize your VDI the digit under Virtual Size should mach your desired size.

Home Assistant Operating System image file added to VirtualBox

Home Assistant Operating System image file added to VirtualBox

Your final step here is to click the “Create” button.

Before you click “Start” button

Next we have to change some settings in VirtualBox to run our Home Assistant on Windows.

Click on the gear-wheel with the label “Settings” inside VirtualBox window.

In the “System” section under “Motherboard” tab click on “Enable EFI” option.

Home Assistant on Windows using VirtualBox Guide 4

In the “System” section under “Motherboard” tab click on “Enable EFI” option.

Then click on the Network tab and change from Nat Network to Bridged Adapter – this will allow using your home network IP. 

Selecting Bridged Adapter

Selecting Bridged Adapter

Of course you can increase your virtual processors/cores if your host system allows that, but I don’t see point to put here more than 2 processor. You can find this section again in System -> Processors.

When you are ready with everything click “OK”

Now you can freely click “Start” button (BIG green arrow pointed at right) to start Home Assistant on Windows as a Virtual Machine.

Performing one of the most important task

Now it is time to perform one of the most important parts. Without doing it you are putting the whole installation at risk, so be very careful when you are executing this.

Just look below this text and smash the “Subscribe” button to get my free Getting Started Smart Home Guide and to receive my articles every week via email. Thank you. 🙏

Setting a static IP from Home Assistant (Optional Step)

This step is optional. It is recommended if you are using AdGuard. If you don’t know what AdGuard is – check my video article about it.

Open you Home Assistant and go to:

Supervisor > System > Change IP address > Static

Enter the IP that you wish to set. For example: 10.0.0.2/24.

As Gateway type the IP of your router. The DNS is usually your router, or some public DNS service like 8.8.8.8. And if you use AdGuard you should add the AdGuard IP.

Setting a Static IP of Home Assistant

Setting a Static IP of Home Assistant

To test if everything is OK open in a new browser/tab the configured by you address on port 8123. For example: http://10.0.0.2:8123.

Using Home Assistant Snapshot for migration (Optional Step)

I’m going to use Home Assistant Snapshot functionality to migrate all of my data and configurations from my Raspberry Pi (old machine) to this new fresh installation. If you don’t have anything to migrate from – go directly to the next step/heading.

I will open my Home Assistant installation on the Raspberry Pi (old machine). And I will go to “Supervisor” in the lower left part of the screen and then on “SNAPSHOTS” tab.

Creating a Home Assistant Snapshot

Create a full snapshot or use already existing one if you have such.

Then click on you snapshot that you want to migrate and choose “DOWNLOAD SNAPSHOT” button.

Next go to your new HOST (where you want to migrate everything) and again click on “Supervisor” button, but before you click the Snapshots – click on the “ADD-ON STORE”.

Installing the "samba" add-on

Search and install “Samba” add-on.

Open and install this add-on. Don’t forget to add username and password under Config section. You will need them to access the snapshot that we created earlier.

Click "SAVE" when you update your Samba Configuration.

Click “SAVE” when you update your Samba Configuration.

After you save your changes scroll up a bit and click on the “START” button.

Now you have to open that shared folder. Depending of your Operating system you can do one of the following:

Access shared folder from Windows

In Windows you can press WINDOWS + R buttons simultaneously and in the Run dialog you have to enter:

\YOUR_NEW_HA_IP

In my case this is

\10.0.0.15

Access shared folder from macOS

To open a shared folder in macOS, open the Finder and press COMMAND + k, then type something like smb://10.0.0.15 and don’t forget to change the IP.

Access shared folder from Linux

If you are using Linux the universal way is from Terminal using smbclient by typing the following:

smbclient //YOUR_NEW_HA_IP/ -U <user>

Remember to login successfully you have to enter the credentials that you configure in the samba add-on within Home Assistant.

When you open the shared folder find “backup” folder and paste inside the snapshot that you downloaded from your old machine.

pasting snapshot inside the home assistant backup folder

paste inside the snapshot that you downloaded from your old machine.

Head back to Supervisor > Snapshots menu in the Home Assistant of your new/target machine and click “refresh” button in the upper right corner.

You should see your snapshot under the “Available snapshot” section.

Restoring Home Assistant snapshot

Click on it and then select “RESTORE SELECTED”.

The only thing left is to wait a bit for the process to finish. It can take up to 20min so be patient please.

Auto Start VirtualBox and Home Assistant after Windows restart

I’m going to configure VirtualBox to automatically start Home Assistant when windows reboots.

Go to your VirtualBox window and right click on your Home Assistant virtual machine and select “Create Shortcut on Desktop”

Creating a shortcut on desktop of our Home Assistant virtual machine

Creating a shortcut on desktop of our Home Assistant on Windows virtual machine

Then open windows explorer or Run dialog (WINDOWS + R) and type:

shell:startup

this will open a system startup folder in which everything pasted there will try to auto start after restarting Windows.

And we are going to do exactly that. Just paste the created shortcut of your Home Assistant on Windows virtual machine inside this system startup folder.

This is not enough for auto starting VirtualBox and HomeAssistant, because your windows user have to successfully login in order the things inside the startup folder to be executed.

We will fix that “issue” in the next section.

Auto Log in Windows after restart

I’m going to enable auto login feature in Windows, so when the computer restarts our account will be automatically logged in.

And the VirtualBox will auto start Home Assistant virtual machine if you execute the previous step in this tutorial.

Press WINDOWS + R and type

netplwiz

In the window that will be displayed uncheck the “User must enter a username and password to use this computer.”

Uncheck "User must enter a username and password to use this computer." option
Uncheck “User must enter a username and password to use this computer.” option

Then click OK and enter your user password twice and you are ready.

What if netplwiz is not working?

If the above check in netplwiz is not visible for you (and there is a big chance for that if you are using Windows 10 version 1909 or above). Follow these steps:

  • Go to windows search (start menu) and type: passwordless sign-in
Home Assistant on Windows using VirtualBox Guide 5

Then, Click on the result!

  • After that disable the following option if it’s enabled.
Disable this option to activate the check in netplwiz.
Disable this option to activate the check in netplwiz.
  • Finally execute the netplwiz procedure exactly as described above.

Set your Windows Power Options correctly

Don’t forget to set your power options right to avoid unwanted sleep of your computer after several working hours.

To check if everything is alright open windows control panel and search for “power options” and click on “Change power-saving settings” and then change when the computer sleeps. Last find the option “Put the computer to sleep” and from the dropdown menu select – Never.

Resize Home Assistant Virtual Disk

The following steps are only needed If for whatever reason your Home Assistant Virtual Disk size that you already have is not enough.

How Do I know that my Home Assistant Virtual Disk have not enough space?

You will understand that you have disk space issues when for example you receive warnings in your Home Assistant logs, that your disk is full. Or you cannot update your Home Assistant and/or you can’t create new snapshots anymore. Only if you face any of these symptoms above you will know that it is time to resize your VDI file.

And here is how you can do it.

  • Shut down the Home Assistant virtual machine – ensure that the state is set to Powered Off and not to Saved.
  • Open command prompt and go to the folder where Virtual Box is installed (C:Program FilesOracleVirtualBox by default) by type the following:
cd “C:Program FilesOracleVirtualBox”
  • Then type the following command and don’t forget to replace the full path to your Home Assistant image (VDI file) and to change the size you want to enlarge the image to in Megabytes.
VBoxManage modifymedium disk “C:FULL_PATH_TO_YOUR_HOME_ASSISTANT_IMAGE.vdi” --resize 81920
  • This process doesn’t enlarge the partition on the Home Assistant virtual hard disk, so you won’t have access to the new space just yet.  You can use a GParted live CD to resize your virtual machine’s partition.
  • Simply boot the GParted ISO image in your virtual machine and you’ll be taken to the GParted partition editor. GParted will be able to enlarge the partition on the Home Assistant virtual hard disk.
  • Once GParted is booted, right-click the partition you want to enlarge and select Resize/Move.
  • Drag the slider all the way to the right to use all the available space for the partition. Click the Resize/Move button after you’ve specified the space you want to use.
  • Finally, apply your changes and enlarge the partition.
  • After the resize operation completes, restart your virtual machine and remove the GParted ISO file.
  • You will now have a resized Home Assistant on Windows.

Question for You

What kind of device are you using for your main home server?

Raspberry PI, some kind of desktop or laptop or maybe enterprise grade server. 

If you are feeling lazy like me these days just put one word in the comments like: raspberry or desktop and I will know for what are you talking about.

That doesn’t mean that you cannot put the full  configuration specification if you wish. It will be interesting to see that as well.

Support my Work

Any sort of engagement on this site does really help out a lot with the Google algorithm, so make sure you hit the subscribe If you enjoy this article.

Also feel free to add me on Twitter by searching for @KPeyanski. 

You can find me on my Discord server as well. This is the invite link.

I really hope that you find this information useful and you now know how to install Home Assistant on Windows using VirtualBox . 

Thank you for watching, stay at home, stay safe and see you next time.

Install Home Assistant Operating System

{% assign release_url = «https://github.com/home-assistant/operating-system/releases/download» %}

{% if site.installation.types[page.installation_type].board %}

Follow this guide if you want to get started with Home Assistant easily or if you have little to no Linux experience.

{% if page.installation_type == ‘raspberrypi’ %}

Suggested Hardware

We will need a few things to get started with installing Home Assistant. Links below lead to Amazon US. If you’re not in the US, you should be able to find these items in web stores in your country.

  • Raspberry Pi 4 (Raspberry Pi 3 is ok too, if you have one laying around). Raspberry Pi are currently hard to come by, use RPilocator to find official distributors with stock.
  • Power Supply for Raspberry Pi 4 or Power Supply for Raspberry Pi 3
  • Micro SD Card. Ideally get one that is Application Class 2 as they handle small I/O much more consistently than cards not optimized to host applications. A 32 GB or bigger card is recommended.
  • SD Card reader. This is already part of most laptops, but you can purchase a standalone USB adapter if you don’t have one. The brand doesn’t matter, just pick the cheapest.
  • Ethernet cable. Required for installation. After installation, Home Assistant can work with Wi-Fi, but an Ethernet connection is more reliable and highly recommended.

{% endif %}

{% if page.installation_type == ‘odroid’ %}

Suggested Hardware

We will need a few things to get started with installing Home Assistant. Links below lead to Ameridroid. If you’re not in the US, you should be able to find these items in web stores in your country.

To get started we suggest the ODROID N2+, it’s the most powerful ODROID. It’s fast and with built-in eMMC one of the best boards to run Home Assistant. It’s also the board that powers our Home Assistant Blue.

  • ODROID N2+
  • Power Supply
  • CR2032 Coin Cell
  • eMMC Module
  • Case

If unavailable, we also recommend the ODROID C4 or ODROID XU4.

{% endif %}

{% if page.installation_type == ‘tinkerboard’ %}

Suggested Hardware

We will need a few things to get started with installing Home Assistant. Links below lead to Amazon US. If you’re not in the US, you should be able to find it in web stores in your country.

  • Asus Tinkerboard S

{% endif %}

{% if page.installation_type == ‘generic-x86-64’ %}

Prerequisites

This guide assumes that you have a dedicated generic x86 PC (typically an Intel or AMD-based system) available to exclusively run Home Assistant Operating System. The system must be 64-bit capable and able to boot using UEFI. Pretty much all systems produced in the last 10 years support the UEFI boot mode.

Summary

You will need to write the HAOS (Home Assistant OS) disk image directly to your boot media, and configure your x86 to use UEFI boot mode when booting from this media.

Configure the BIOS on your x86-64 hardware

To boot Home Assistant OS, the BIOS needs to have UEFI boot mode enabled and Secure Boot disabled. The following screenshots are from a 7th generation Intel NUC system. The BIOS menu will likely look different on your systems. However, the options should still be present and named similarly.

  1. To enter the BIOS, start up your x86-64 hardware and repeatedly press the F2 key (on some systems this might be Del, F1 or F10).
    Enter BIOS using F2, Del, F1 or F10 key

  2. Make sure the UEFI Boot mode is enabled.
    Enable UEFI Boot mode

  3. Disable Secure Boot.
    Disable Secure Boot mode

  4. Save the changes and exit.

  • The BIOS configuration is complete.

As a next step, we need to write the Home Assistant Operating System image to the target boot medium. The HAOS has no integrated installer. This means the Operating System is not copied automatically to the internal disk.

  • The «boot medium» is the medium your x86-64 hardware will boot from when it is running Home Assistant.
  • Typically, an internal medium is used for the x86-64 hardware. Examples of internal media are S-ATA hard disk, S-ATA SSD, M.2 SSD, or a non-removable eMMC.
  • Alternatively, an external medium can be used to boot HAOS such as a USB SDD (not recommended).

To install the HAOS internally on your x86-64 hardware, there are 2 methods:

  1. Copying the HAOS disk image from your Desktop computer onto your boot medium (e.g. by using a USB to S-ATA adapter). This is not an option for a non-removable eMMC on your x86-64 hardware, of course.
    To use this method, follow the steps described in the procedure below: Write the image to your boot media.
  2. Copying a live operating system (e.g. Ubuntu) onto a USB device. Then, insert this USB device into your x86-64 hardware and start the Ubuntu.
  • To use this method, follow the instructions of your Live distribution (e.g., this Ubuntu guide). Once you booted the live operating system, follow the steps described in the procedure below: Write the image to your boot media.

{% details «Ubuntu dependency’s for Etcher» %}

When installing Etcher on an Ubuntu system you may need to install the fuse
dependency, you can do so with the following commands:

sudo add-apt-repository universe
sudo apt update
sudo apt install libfuse2

{% enddetails %}

{% endif %}

Write the image to your boot media

  1. Attach the Home Assistant boot media ({{site.installation.types[page.installation_type].installation_media}}) to your computer
    {% if page.installation_type == ‘odroid’ %}
    If you are using a Home Assistant Blue or ODROID N2+, you can attach your device directly.
    {% endif %}

  2. Download and start Balena Etcher. (You may need to run it with administrator privileges on Windows).

  3. Select «Flash from URL»
    Screenshot of the Etcher software showing flash from URL selected.

  4. Get the URL for your {{site.installation.types[page.installation_type].board}}:
    {% if site.installation.types[page.installation_type].variants.size > 1 %}
    {% tabbed_block %}
    {% for variant in site.installation.types[page.installation_type].variants %}

  • title: {{ variant.name }}
    content: |

    {{release_url}}/{{site.data.version_data.hassos[variant.key]}}/haos_{{ variant.key }}-{{site.data.version_data.hassos[variant.key]}}.img.xz
    

    {% if variant.key == «odroid-n2» %}
    Guide: Flashing Odroid-N2 using OTG-USB
    {% elsif variant.key == «rpi4» or variant.key == «rpi3» %}
    (64-bit is recommended)
    {% endif %}

{% endfor %}
{% endtabbed_block %}
{% else %}

{% assign board_key = site.installation.types[page.installation_type].variants[0].key %}
{{release_url}}/{{site.data.version_data.hassos[board_key]}}/haos_{{ board_key }}-{{site.data.version_data.hassos[board_key]}}.img.xz

{% endif %}

Select and copy the URL or use the «copy» button that appear when you hover it.

  1. Paste the URL for your {{site.installation.types[page.installation_type].board}} into Balena Etcher and click «OK»
    Screenshot of the Etcher software showing the URL bar with a URL pasted in.
  2. Balena Etcher will now download the image, when that is done click «Select target»
    Screenshot of the Etcher software showing the select target button highlighted.
  3. Select the {{site.installation.types[page.installation_type].installation_media}} you want to use for your {{site.installation.types[page.installation_type].board}}
    Screenshot of the Etcher software showing teh targets available.
  4. Click on «Flash!» to start writing the image
    Screenshot of the Etcher software showing the Flash button highlighted.
  5. When Balena Etcher is finished writing the image you will get this confirmation
    Screenshot of the Etcher software showing that the installation has completed.

Start up your {{site.installation.types[page.installation_type].board}}

{% if page.installation_type == ‘generic-x86-64’ %}

  1. If you used your desktop system to write the HAOS your boot media, install the boot media ({{site.installation.types[page.installation_type].installation_media}}) in the generic-x86-64 system.
  • If you used a live operating system (e.g. Ubuntu), shut down the live operating system and make sure to remove the USB flash drive you used for the live system.
  1. Make sure an Ethernet cable is plugged in for network.

  2. Power the system on.

    • Wait for the Home Assistant welcome banner to show up in the console of the generic-x86-64 system.

If the machine complains about not being able to find a bootable medium, you might need to specify the EFI entry in your BIOS.
This can be accomplished either by using a live operating system (e.g. Ubuntu) and running the following command (replace <drivename> with the appropriate drive name assigned by Linux, typically this will be sda or nvme0n1 on NVMe SSDs):

efibootmgr --create --disk /dev/<drivename> --part 1 --label "HAOS" 
   --loader 'EFIBOOTbootx64.efi'

Or else, the BIOS might provide you with a tool to add boot options, there you can specify the path to the EFI file:

{% else %}

  1. Insert the boot media ({{site.installation.types[page.installation_type].installation_media}}) you just created.
  2. Attach an Ethernet cable for network.
  3. Attach the power cable.
    {% endif %}
  4. In the browser of your Desktop system, within a few minutes you will be able to reach your new Home Assistant on homeassistant.local:8123.
  • If you are running an older Windows version or have a stricter network configuration, you might need to access Home Assistant at homeassistant:8123 or http://X.X.X.X:8123 (replace X.X.X.X with your {{site.installation.types[page.installation_type].board}}’s IP address).

{% else %}

Download the appropriate image

  • VirtualBox (.vdi)
    {% if page.installation_type == ‘macos’ %}
  • KVM (.qcow2)
    {% endif %}
    {% if page.installation_type == ‘windows’ or page.installation_type == ‘linux’ %}
  • KVM (.qcow2)
  • Vmware Workstation (.vmdk)
    {% elsif page.installation_type == ‘alternative’ %}
  • KVM/Proxmox (.qcow2)
  • VMware ESXi/vSphere (.ova)
    {% endif %}
    {% if page.installation_type == ‘windows’ %}
  • Hyper-V (.vhdx)
    {% endif %}

Follow this guide if you already are running a supported virtual machine hypervisor. If you are not familiar with virtual machines we recommend installation Home Assistant OS directly on a Raspberry Pi or an ODROID.

Create the Virtual Machine

Load the appliance image into your virtual machine hypervisor. (Note: You are free to assign as much resources as you wish to the VM, please assign enough based on your add-on needs).

Minimum recommended assignments:

  • 2 GB RAM
  • 32 GB Storage
  • 2vCPU

All these can be extended if your usage calls for more resources.

Hypervisor specific configuration

{% tabbed_block %}

  • title: VirtualBox
    content: |

    1. Create a new virtual machine
    2. Select Type «Linux» and Version «Linux 2.6 / 3.x / 4.x (64-bit)»
    3. Select «Use an existing virtual hard disk file», select the unzipped VDI file from above
    4. Edit the «Settings» of the VM and go «System» then «Motherboard» and select «Enable EFI»
    5. Then go to «Network» «Adapter 1» choose «Bridged Adapter» and choose your Network adapter

    Please keep in mind that the bridged adapter only functions over a hardwired ethernet connection.
    Using Wi-Fi on your VirtualBox host is unsupported.

    6. Then go to «Audio» and choose «Intel HD Audio» as Audio Controller.

    By default VirtualBox does not free up unused disk space. To automatically shrink the vdi disk image
    the discard option must be enabled:

    VBoxManage storageattach <VM name> --storagectl "SATA" --port 0 --device 0 --nonrotational on --discard on
  • title: KVM (virt-manager)
    content: |

    1. Create a new virtual machine in virt-manager
    2. Select «Import existing disk image», provide the path to the QCOW2 image above
    3. Choose «Generic Default» for the operating system
    4. Check the box for «Customize configuration before install»
    5. Select your bridge under «Network Selection»
    6. Under customization select «Overview» -> «Firmware» -> «UEFI x86_64: …». Make sure to select a non-secureboot version of OVMF (does not contain the word secure, secboot, etc.), e.g., /usr/share/edk2/ovmf/OVMF_CODE.fd.
    7. Click «Add Hardware» (bottom left), and select «Channel»
    8. Select device type: «unix»
    9. Select name: «org.qemu.guest_agent.0»
    10. Finally select «Begin Installation» (upper left corner)
  • title: KVM (virt-install)
    content: |

    virt-install --name hass --description "Home Assistant OS" --os-variant=generic --ram=2048 --vcpus=2 --disk <PATH TO QCOW2 FILE>,bus=sata --graphics none --boot uefi

{% if page.installation_type == ‘windows’ or page.installation_type == ‘linux’ %}

  • title: Vmware Workstation
    content: |

    1. Create a new virtual machine
    2. Select “Custom”, make it compatible with the default of Workstation and ESX
    3. Choose “I will install the operating system later”, select “Linux” -> “Other Linux 5.x or later kernel 64-bit”
    4. Select “Use Bridged Networking”
    5. Select “Use an existing virtual disk” and select the VMDK file above,

    After creation of VM go to “Settings” and “Options” then “Advanced” and select “Firmware type” to “UEFI”.

{% elsif page.installation_type == ‘alternative’ %}

  • title: VMware ESXi/vSphere
    content: |
    Use the “E1001” or “E1001E” virtual network adapter. There are confirmed mDNS/Multicast discovery issues when using VMware’s “VMXnet3” virtual network adapter.
    {% endif %}
    {% if page.installation_type == ‘windows’ %}

  • title: Hyper-V
    content: |

    Hyper-V does not have USB support

    1. Create a new virtual machine
    2. Select “Generation 2”
    3. Select “Connection -> “Your Virtual Switch that is bridged”
    4. Select “Use an existing virtual hard disk” and select the VHDX file from above

    After creation go to “Settings” -> “Security” and deselect “Enable Secure Boot”.
    {% endif %}

{% endtabbed_block %}

Start up your Virtual Machine

  1. Start the Virtual Machine
  2. Observe the boot process of Home Assistant Operating System
  3. Once completed you will be able to reach Home Assistant on homeassistant.local:8123. If you are running an older Windows version or have a stricter network configuration, you might need to access Home Assistant at homeassistant:8123 or http://X.X.X.X:8123 (replace X.X.X.X with your {{site.installation.types[page.installation_type].board}}’s IP address).

{% endif %}

With the Home Assistant Operating System installed and accessible you can continue with onboarding.

{% include getting-started/next_step.html step=»Onboarding» link=»/getting-started/onboarding/» %}

Оглавление:
— Умный дом, вопрос цены.
— Установка Home-assistant.
— Настойка Home-assistant.
— GPIO — датчики и реле в Home Assistant
— GPIO — ИК управление в Home Assistant.
— GPIO — BME280 взамен DHT11 в Home Assistant
— GPIO — дисплей LCD1602 I2C в Home Assistant.

Вообще пока есть только желание посмотреть к чему всё это приведет. Так что буду использовать то, что под рукой, стараясь ничего не покупать. Все настраивал из под Kubuntu.

С чего все начинается, конечно выбор железа для сервера…

Home-assistant построен на Python3 и способен работать на различных компьютерах, в т.ч. на Raspberry Pi. Из образа, полноценная Операционная Система Home Assistant ориентирована на Raspberry Pi4, ну по минимуму Pi3.

Полный размер

Raspberry Pi4

Если эффект будет положительным, то потом соберу на Orange Pi PC 2 , есть в наличии.

Полный размер

Orange Pi PC 2: загрузка устройства с USB. ARM Cortex-A53 = 4 ядра, 700 МГц 64-битный.

А пока решил попробовать собрать вообще на Raspberry Pi 1 B+, есть в наличии. Главная идея не перегружать, может зашевелится

Полный размер

Raspberry Pi1 B+, Процессор 1 ядро 700 МГц 32-битный, RAM 512 МБ LPDDR2 SDRAM.

Устанавливать сервер Home-assistant буду на Debian для Raspberry от DietPi OS.

DietPi OS

ДиетаPi очень интересная вещь на самом деле — ставится ядро и потом, через удобное меню, можно заточить под многое. А без меню вообще под всё

В связи с тем, что SD карта в таком режиме умрет очень быстро, надо использовать внешний накопитель подключенный по USB. У меня есть HDD 2,5’ 150гБ 700mA и SSD 500Гб 400mA, остановился на SSD (объем излишен конечно), но у него ток потребления ниже.

Программой balenaEtcher на чистый SSD залил DietPi_RPi-ARMv6-Bullseye.img

Прошивка поддерживает Raspberry Pi 1 B+

Для Raspberry Pi 1 B+ пришлось делать хитрый ход конем, для загрузки OC с USB — подробно тут.
* На чистой карте SD создал раздел для загрузки = Fat32 128miB, с флагами boot и lba.

Полный размер

Пример разметки

*Скопировал загрузочный раздел с накопителя SSD на карту SD, для этого:
— Смотрим как разделы называются: sudo fdisk -l
Диск /dev/sdd: 476,96 GiB ***накопитель SSD***
/dev/sdd1 * 8192 270335 262144 128M c W95 FAT32 (LBA)
/dev/sdd2 270336 2097151 1826816 892M 83 Linux
Диск /dev/sdg: 7,37 GiB ***карта SD***
/dev/sdg1 * 2048 264191 262144 128M c W95 FAT32 (LBA)

— Копируем загрузчик c SSD на карту SD : sudo dd if=/dev/sdd1 of=/dev/sdg1

* На SSD удаляем загрузочный раздел и увеличиваем рабочий.

Полный размер

Финальная разметка SSD

* Открываем на карте SD в редакторе файл cmdline.txt и меняем значение root на /dev/sda2:
root=/dev/sda2 rootfstype=ext4 rootwait fsck.repair=yes net.ifnames=0 logo.nologo console=serial0,115200 console=tty
* Вставляем карту SD в Raspberry Pi1 B+, а к его USB подключаем SSD.

Зато теперь система на SSD, а карта SD с разделом загрузки и практически вечная.

Пора установить DietPi OS, а для этого нужен интернет. Все было б просто с роутером, но под рукой немного другой набор… К персональному компу подключен модем, а к нему по LAN Raspberry Pi.

Настраиваем подключение:
Раздача инета на Raspberry в Kubuntu делается элементарно, единственно что сделал это отключил IPv6.

В настройках Kubuntu надо просто правильно выбрать направление.

Теперь осталось, через терминал 🔳, определить IP адрес Raspberry 🤔:
— Если нет Nmap, то устанавливаем его : sudo apt install nmap
— Определяем пул адресов IPv4: ip -4 addr
— Ищем устройство, в моем случае пул адресов 10.42.0.1/24:
sudo nmap -sn 10.42.0.1/24
Nmap scan report for 10.42.0.55 (Raspberry Pi Foundation)

Нужный адрес: 10.42.0.55🤗

Наконец добрались, через терминал 🔳 заходим на Raspberry и начинаем настройку DietPi OS:
sudo ssh root@10.42.0.55
password: dietpi

Как только первый раз попадем в систему автоматически запустится обновление DietPi, а потом пойдут вопросы:
collect anonymous usage statistics, отправка статистики в DietPi = 0 отказаться.
global software password, смена глобального пароля
serial/UART console, взаимодействия с системой без экрана или сети = «Yes» не подключать
DietPi-Software, настройка DietPi и установка программ.

Первоначально настроил в DietPi-Software (dietpi-software — можно вызывать в терминале):
* DietPi-Config=>Language/Regional Options:
— Выставил Locale : [ru_RU.UTF-8] и Timezone : [Europe/Moscow]
* DietPi-Config=>SSH Server
— Заменил Dropbear на OpenSSH Server.

Для доступа к файловой системе — проводником FileZilla.

* Browse Software :

Ничего не Выбрал

Осталось дело за малым, пора переходить к установке сервера Home-assistant.
Итак есть три варианта установки 🤔:
* Из образа не пройдет (ОС Home Assistant) — нет под это железа
* Вариант с контейнером (Home Assistant Core) — тяжеловат получится
* Единственное что остается (Home Assistant Core) 🤫 — установка пакетами

Установка Home Assistant в терминале 🔳:
1. Установка зависимостей:
— Рекомендованные:
sudo apt-get install -y python3 python3-dev python3-venv python3-pip bluez libffi-dev libssl-dev libjpeg-dev zlib1g-dev autoconf build-essential libopenjp2-7 libtiff5 libturbojpeg0-dev tzdata
— Пришлось добавить к рекомендуемым:
sudo apt-get install -y libxcb-util-dev libpcap-dev
— Обновление python:
sudo pip install —upgrade pip
2. Создаем учетную запись для Home Assistant (после запятых убрать пробелы):
sudo useradd -rm homeassistant -G dialout, gpio, i2c
3. Создаем виртуальную среду:
sudo mkdir /srv/homeassistant
sudo chown homeassistant:homeassistant /srv/homeassistant
sudo -u homeassistant -H -s
cd /srv/homeassistant
python3 -m venv .
source bin/activate

Обновление python:
pip install —upgrade pip
4. Добавляем необходимые пакеты Python:
python3 -m pip install wheel hass-nabucasa pyopenssl
5. Устанавливаем Cargo — менеджер пакетов языка программирования Rust.
В идеале, надо бы перезагрузить Raspberry 🤔.
6. Посмотреть и выбрать релиз можно тут, устанавливаем Home Assistant Core!
pip3 install homeassistant==2022.9.7
7. При первом запуске Home Assistant, будет завершена установка, в терминале 🔳:
hass

Проверяем — заходим в браузере по вычисленному ранее адресу на порт 8123:
10.42.0.55:8123

Сервер поднялся 🤩.

Добавляем Home-assistant в автозагрузку.
Для этого в Raspberry создадим файл:
sudo nano /etc/systemd/system/home-assistant@homeassistant.service
Cо следующим содержимым:
[Unit]
Description=Home Assistant
After=network-online.target

[Service]
Type=simple
User=%i
WorkingDirectory=/home/%i/.homeassistant
ExecStart=/srv/homeassistant/bin/hass -c «/home/%i/.homeassistant»
RestartForceExitStatus=100

[Install]
WantedBy=multi-user.target

*** Чтобы автоматически перезапустить службу Home Assistant после сбоя, в [Service] добавить:
Restart=on-failure
RestartSec=5s

И включим Home Assistant в качестве сервиса, используем терминал 🔳:
sudo systemctl —system daemon-reload
sudo systemctl enable home-assistant@homeassistant
sudo systemctl start home-assistant@homeassistant

Сервер Home-assistant, после включения Raspberry Pi1 B+, стартует через 2 минуты.

****Актуальное в терминале 🔳******
— Выключение Raspberry немедленно: sudo shutdown -h now
— Перезапуск Raspberry: reboot
— Обновление DietPi OS: dietpi-update
— Перезапуск сервера Home-assistant:
sudo systemctl stop home-assistant@homeassistant
sudo systemctl start home-assistant@homeassistant

— Обновление сервера Home-assistant можно посмотреть тут.

Понравилась статья? Поделить с друзьями:
  • Как установить hogs of war на windows 10
  • Как установить hive os на windows 10 x64
  • Как установить hitman absolution на windows 10
  • Как установить hidden city на windows 10
  • Как установить hds honda на windows 7 64 bit