Windows 10 logon disable

Уровень сложностиСредний

Время на прочтение8 мин

Количество просмотров51K

Несмотря на огромное количество текстов по установке Home Assistant, решил написать свой.

В первую очередь для себя, чтобы при повторной установке не рыться в бесконечном количестве ссылок.

Home Assistant развивается, часть мануалов устарела, часть содержит ошибки, часть написана Очень Умными Парнями, живущими в Линуксе и которые пишут что-то вроде: «сделай три раздела, два для систем и один для хомяка, и при установке систем подключай раздел с хомяком к каждой, только не форматируй его постояннo» (с). Это подлинная цитата, причём одна из самых понятных.

Мой текст написан виндузятником для себя и для людей, которые видят командную строку максимум раз в пару дней и не обязаны помнить все ключи команд линкуса. Описан весь процесс, собранный по многим мануалам. На часть мануалов приведена ссылка.

Итак.

В качестве подопытного был выбран ноутбук Acer Aspire E15. Тупо был. Был куплен бэушным семь лет назад за 10 тыс. рублей для разъездного менеджера по принципу: если потеряет – чтобы было не жалко. То есть, он был изрядно устаревшим уже тогда. Потом лежал на антресолях, всеми забытый. Думаю, в каждой мало-мальской приличной фирме такого хлама найдется с десяток штук и вам его подарят за пару пива знакомому сисадмину. Если нет знакомого сисадмина, то авито в помощь. Все равно в итоге получится в те же деньги или чуть дешевле и лучше, чем приличный одноплатник.  Плюсом вы получите нормальный процессор, жесткий диск вместо вечно умирающей флешки и, если повезёт, не совсем дохлую батарею вместо источника бесперебойного питания.

На моём ноуте был проводной Ethernet, кто-то (возможно даже я) уже позаботился дорастить память до 8Gb вместо 4 и воткнуть древний SATA SSD диск на 256 Gb. Для работы с Windows  так себе, но для моих целей – за глаза.

Способ установки — виртуальная машина на Debian. Попробую объяснить, почему.

1. Немного пояснений

1.1. Почему всё-таки, хоть плохонький, но PC, я объяснил выше. Основное – это желание иметь полноценный жесткий диск. Наличие у ноута своего экрана и клавиатуры – тоже плюс в тех редких случаях, когда удалённый доступ почему-либо невозможен.

1.2. С другой стороны, для одного HA, такой машины, всё таки, жирновато, поэтому хочется, если уж затевать такую пьянку, повесить на него функции домашнего NAS на внешнем диске и DLNA сервера, чтобы смотреть скачанные с торрентов купленные на официальных сервисах кино долгими зимними вечерами. Чуть позже добавится маленький Apache и VPN сервер.

1.3. Можно тупо поставить HASSOS, как операционную систему. Тогда DLNA и NAS можно запустить, как плагины. Я попробовал — мне не понравилось. Во-первых очень заморочная установка, во-вторых нужные мне плагины показались мне довольно кривыми.  В третьих, сама операционка и мои права в ней усечены до крайности.  Для Raspberry пойдет, для полноценного ноута – так себе.

1.4. Можно поставить как контейнер в докере. В таком случае вы автоматически лишаетесь плагинов. Среди них есть очень даже полезные. Можно, конечно, каждый из них ставить отдельными контейнерами. По мне – тот еще гемор.

1.5. Более продвинутый вариант – тот же докер в режиме Supervised. Моя предыдущая установка была именно такая. Плагины работают. Не все, правда, но почти все. Но с какого-то обновления пошли необъяснимые проблемы с совместимостью, перестал обновляться супервизор. Стал рыться – проблема не у меня одного. Возникает спорадически у разных людей. Лечение – полная переустановка. Или «Обновитесь до последней версии». А у меня какая??? Я тебя ставил 10 минут назад. Бесит, короче.

1.6. Ну и чисто эстетически мне перестал нравится docker. Постоянная борьба с логами, которые он пишет в самые затейливые места и тихо засирает диск, проблемы с совместимостью пакетов. Нельзя, как в Windows, поставить пакет, а потом его просто удалить. Обязательно либо остаются хвосты по всему диску, либо удаляемый пакет забирает с собой что-то важное. То есть – штука одноразовая. Короче, после очередного раунда безуспешной борьбы, я решил, что у меня есть более важные занятия в жизни, чем разбираться в докере и его причудах. Память позволяет, диск позволяет, процессор позволяет. Итак: виртуальная машина с HASSOS живёт, никому не мешает и ей никто не мешает. В остальной памяти делаю, что хочу.     

2. Предварительные ласки

2.1. Загружаем образ Debian с официального сайта. Можно любой другой дистрибутив Linux. Лично мне нравится Debian своей незамутненностью. Он не пытается быть похожим на винду, как многие, ибо все равно получается плохо. Такой чистый брутал. Стабильный. Ну и много литературы по нему, конечно. Внимание. Некоторые команды отличаются в разных дистрибутивах. Всё, что написано далее – написано про Debian 12.

2.2. Скачиваем с официального сайта последнюю версию Rufus. Вставляем флешку, все настройки по умолчанию, выбираем только что скачанный образ — делаем загрузочную флешку.

3. Установка

3.1. На ноуте, нажинаем F2 при загрузке, проверяем настройки загрузки. В параметрах должно стоять UEFI, флешка первой в порядке загрузки. Корректируем при необходимости.

3.2. Для некоторых дистрибутивов  (например для HASSOS) требуется отключить безопасную загрузку, но соответствующий пункт меню подсвечен серым и не выбирается. Для того, чтобы его активировать, нужно установить пароль супервизора. После этого выбор режима безопасной загрузки становится активным. К счастью, Debian 12 такого не требует. Оставляем, как есть. Если безопасный режим всё-таки выключен, то ИМХО лучше включить.

3.3. Запускается загрузка. Выбираем установку в графическом режиме. Красноглазые поборники расовой чистоты пингвинов конечно фыркнут, но графический режим чисто визуально приятнее. 

3.4. Выбор языка. Выбираем русский, страну, раскладку клавиатуры, часовой пояс. Далее пароли администратора, имя и пароли пользователя и т.п.

3.5. Сетевые карты установились автоматически, но иногда приходится бежать за драйвером. На этот случай полезно иметь под рукой второй компьютер и еще одну флешку.

3.6. Спрашивает про разметку диска. Я весь диск отдал целиком, с разделами по умолчанию. Переспросила — уверен ли я. Уверен. Все данные на диске уничтожены. Плакать поздно.

3.7. Выбор софта. Я оставляю выбор по умолчанию, оболочку Gnome по причинам, указанным в п.1.1, добавляю к умолчанием еще SSH сервер. После этого можно идти пить чай. Что-то устанавливается сразу, что-то подкачивается из интернета и тоже устанавливается. Процесс небыстрый.

3.8. Перезагрузка. Вынимаем флешку. После перезагрузки нелишне проверить в биосе порядок загрузки.  Правим при необходимости.

4. Настраиваем вход через терминал

4.1. Идем в настройки роутера, ищем нового клиента, в настройках DHCP прописываем ему статический адрес. Передергиваем DHCP, убеждаемся, что ваш компьютер переподключился по новому адресу. Выписываем адрес на листочек, запоминаем.

4.2. Теперь можно заходить на него со своего рабочего компьютера по SSH через PuTTY или что-у-вас-там-вместо-телнета.

4.3. Свой логин и пароль, введенные ранее в п.2.4., надеюсь, помним?

5. Включаем себя в группу sudo

5.1. Заходим под рутом. Другой вариант – заходить под своим логином , далее уходить в root командой su –

usermod  -aG sudo ИмяПользователя

5.2. Возвращаемся обратно

su –  «Имя пользователя»

4.3. Проверяем. Например:

sudo ls -la /root

6. Лично мне иногда удобно пользоваться графическим удаленным рабочим столом. Настраиваем его. Опционально.

5.1. Включаем

sudo apt install xrdp

5.2. В Windows набираем «Подключение к удаленному рабочему столу». Получаем примерно это.

5.3. Вводим адрес из п. 3.1. Подключаемся.

Видим что-то вроде этого

Видим что-то вроде этого

7. Убираем засыпание Debian

7.1. Убираем общие засыпания.

sudo systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target

7.2. Поскольку у нас ноутбук, нам надо убирать засыпание при закрытии крышки

sudo nano /etc/systemd/logind.conf

7.3. В секции [Login] Находим строчки HandleLidSwitch=  и HandleLidSwitchDocked=

7.4. Ставим ignore

HandleLidSwitch=ignore

HandleLidSwitchDocked=ignore

7.5. Не забываем раскомментировать.

7.6. Сохраняем, выходим,

7.7. Рестарт службы

sudo systemctl restart systemd-logind.service

8. Полезности

8.1 Файл менеджер mc. Опционально. Иногда удобно.

sudo apt install mc

8.2. Пакет управления сетью. Потребуется для следующих шагов.

sudo apt install ethtool

9. Если несмотря на ИБП питание выключилось, а с ним выключился компьютер, полезно иметь возможность разбудить компьютер по сети

9.1. При загрузке, заходим в BIOS. Проверяем в биосе, что WOL включен. Если не включен – включаем.

9.2. Смотрим список сетевых интерфейсов

ip a

9.3. Находим название проводного интерфейса. Обычно это eth0, но бывают варианты. У меня enp3s0

9.4. Делаем временный WOL

sudo ethtool --change enp3s0 wol g

9.5. Проверяем

sudo ethtool enp3s0

9.6. Смотрим вывод. Ищем строчку wake-on: g. Если есть, то всё в порядке.

9.7. Запихиваем это в автозагрузку. Для этого:

9.8. Узнаем путь к ethtool

which ethtool

9.9. Смотрим вывод. У меня оно хранится в /usr/sbin/ethtool

9.10. Создаём файл wol.service в  /etc/systemd/system

sudo nano /etc/systemd/system/wol.service

9.11. В него вписываем:

[Unit]

Description=Enable Wake On Lan

[Service]

Type=oneshot

ExecStart = /usr/sbin/ethtool --change enp3s0 wol g

[Install]

WantedBy=basic.target

9.12. Запускаем службу

sudo systemctl daemon-reload

sudo systemctl enable wol.service

9.13. Проверяем

sudo shutdown

9.14. Будим машину удобным для вас способом. В интерфейсе кинетике для есть специальная кнопочка.

9.15. Если все работает, настраиваем автозапуск будилки на роутере или на другом внешнем устройстве гарантированно запасающемся по сбою питанию. На Keenetic это делается через opkg

10. Устанавливаем виртуальную машину.

(сперта https://g-soft.info/linux/10968/kak-ustanovit-virtualbox-7-0-v-debian/)

10.1. Проверяем зависимости, большая часть уже на месте, те, которых не хватает, устанавливаем.

sudo apt install dirmngr ca-certificates software-properties-common apt-transport-https curl -y

10.2. Необходимо импортировать ключ GPG (GNU Privacy Guard). Ключ GPG является частью системы криптографии с открытым ключом, которая позволяет убедиться в том, что устанавливаемые пакеты являются подлинными и получены из официального репозитория VirtualBox

curl -fSsL https://www.virtualbox.org/download/oracle_vbox_2016.asc | gpg --dearmor | sudo tee /usr/share/keyrings/virtualbox.gpg > /dev/null

10.3. Добавляем репозиторий Virtialbox

echo "deb [arch=$( dpkg --print-architecture ) signed-by=/usr/share/keyrings/virtualbox.gpg] http://download.virtualbox.org/virtualbox/debian $(lsb_release -cs) contrib" | sudo tee /etc/apt/sources.list.d/virtualbox-7.list

10.4. Обновляем список репозиториев

sudo apt update

10.5. Установка Virtual Box

sudo apt install virtualbox-7.0 linux-headers-$(uname -r) -y

10.6. Добавляем пользователя в группу

sudo usermod -aG vboxusers alexl

10.7. Находим значок VirtialBox. Запускаем, проверяем

11. Установка Home assistant.

подсмотрено здесь: https://ivan.bessarabov.ru/blog/how-to-install-home-assistant-in-virtualbox)

11.1. Скачиваем vdi образ с официального сайта https://www.home‑assistant.io/installation/alternative

11.2. Разархивируем

11.3. Открываем виртуальную машину

11.4. На правой панели жмём Создать

11.5. Пишем название (лучше без пробелов)

11.6. Образ ISO оставляем пустым

11.7. Тип: Linux

11.8. Версия: Linux 2.6 / 3.x / 4.x (64-bit).

11.9. Вкладка Оборудование: сколько не жалко, но не менее 2 процессоров и не менее 2GB RAM

11.10. Ставим галку EFI

11.11. Вкладка Жесткий диск: ставим использовать существующий виртуальный диск. Выбираем наш скачанный образ

11.12. Создать машину

11.13. Идем в опции сети. Меняем NAT на bridge

11.14. Запускаем

12. Настройка доступа из сети

12.1. Идем в роутер, видим новое устройство. Это виртуальная машина. Прописываем ей статический адрес

12.2. В настройках роутера прописываем доменное имя на этот адрес и порт 8123

13. Прописываем автозапуск виртуальной машины при перезагрузке.

(https://redos.red-soft.ru/base/arm/os-virtual/virtualbox/virtualbox-autostart/)

13.1. Создаем новую службу

sudo nano /etc/systemd/system/vbox@.service

13.2. Прописываем туда

Description=Virtual Box Guest %I

After=network.target vboxdrv.service

Before=runlevel2.target shutdown.target

[Service]

User=свой юзернайм

Group=vboxusers

Type=forking

Restart=no

TimeoutSec=5min

IgnoreSIGPIPE=no

KillMode=process

GuessMainPID=no

RemainAfterExit=yes

ExecStart=/usr/bin/VBoxManage startvm %i --type headless

ExecStop=/usr/bin/VBoxManage controlvm %i acpipowerbutton

[Install]

WantedBy=multi-user.target

13.3. Реинициализируем службы.

systemctl daemon-reload

13.4. %1 в первой строке – это параметр, куда вставляется имя или идентификатор вашей виртуальной машины. Имя вы знаете из п. 10.5, но идентификатор использовать правильнее. Узнаем его

VBoxManage list vms

13.5. Находим нужную машину, копируем идентификатор, вставляем в следующую команду

sudo systemctl status vbox@идентификатор

13.6. Что‑то вроде:

sudo systemctl status vbox@cea2060b-61a1-44a1-b5df-f9a6b0b82f43

13.7. Если ошибки нет, смотрим статус. После @будет ваш идентификатор.

sudo systemctl status vbox@cea2060b-61a1-44a1-b5df-f9a6b0b82f43

13.8. Если все норм, добавляем в автозагрузку. (идентификатор меняем на свой)

sudo systemctl enable vbox@cea2060b-61a1-44a1-b5df-f9a6b0b82f43

14. Финальная настройка

14.1. Заходим по вашему адресу, например:

http://192.168.0.15:8123

14.2. Или, как у меня

https://Hassio.mydomen.keenetic.pro

14.3. Вводим пароль, логин

14.4. Ждём

14.5. Настраиваем параметры места.

14.6. Пользуемся!

I will show you how to create Home Assistant Wake on Lan (WoL) switch to turn on your desktop computer. As well as how to use Home Assistant RPC shutdown add-on to turn off a Windows PC with a click of button.

Home Assistant Wake On Lan & Home Assistant RPC Shutdown (HOW-TO)

Using Home Assistant you can control many things and probably you already doing this, but after you read this you will add your computer to the list. Let start this!

Table of Contents

What is Wake on LAN (WoL)?

Wake on Lan is a standard that allows a computer to be awakened by a network message called magic packet. To use the Wake On LAN, your computer should support this feature and it have to be always connected to your network. You can use Wake on LAN regardless of the installed Operating System as this feature is usually controlled by the motherboard of your device.

After you finish reading this you will be able to create a Home Assistant Wake on LAN Switch, Script or Automation that will awaken any device that supports WoL.

What is RPC Shutdown?

On the opposite side to turn off a Windows PC from Home Assistant you will need the Home Assistant RPC Shutdown add-on. The RPC Shutdown add on is available in the Add-On store in Home Assistant and you can install it with 1 click.

If you don’t have Home Assistant yet, or your Home Assistant is without the Supervisor menu (Add-on store) check these two tutorials of mine and you will have everything that is needed in no time:

  • Home Assistant Supervised 👉 LINK
  • Home Assistant OS 👉 LINK

How to Enable Wake On Lan in BIOS?

First of all you have to check that the device that you want to turn on remotely support the Wake On Lan functionality. Check your motherboard manual or enter in the BIOS (usually by hitting the Del, button or a specific functions keys during the startup of your system).

Every motherboard vendor is having different place and even different wording for the Wake On Lan feature, so you’ll have to search for it a bit in the BIOS menus or in the manuals.

Home Assistant Wake On Lan & Home Assistant RPC Shutdown (HOW-TO) 1

Wake On LAN in AMI BIOS
Home Assistant Wake On Lan & Home Assistant RPC Shutdown (HOW-TO) 2

Wake on LAN in Lenovo BIOS
Home Assistant Wake On Lan & Home Assistant RPC Shutdown (HOW-TO) 3

Wake on LAN in Award BIOS
To unlock Home Assistant Wake On Lan you have to enable Wake On Lan feature in the BIOS

Enable Wake on Magic Packet in Windows 10

Sometimes it is necessary to enable wake on magic packet option on your network adapter in Windows and this is how I did it in Windows 10.

Right click on the Start menu > Device Manager > Network Adapters > right click on your network adapter and select Properties > Advanced > Wake on magic packet > Enabled.

Enable Wake On Magic Packet in Windows 10 Device Manager data-lazy-src=

Enable Wake On Magic Packet in Windows 10 Device Manager > Network Adapters before Adding Home Assistant Wake On Lan switch \ script \ automation.

It is time to add and configure the Home Assistant Wake on Lan integration.

Add the following text in configuration.yaml file and you will have the Wake on LAN platform enabled in your Home Assistant.

# configuration.yaml entry
wake_on_lan:

You will need to restart your Home Assistant before start using the Wake on LAN integration, but don’t do that yet. We will add the Home Assistant Wake On LAN switch in the next section and we will restart afterwards.

Add Home Assistant Wake on LAN switch

Only adding the things described in the above section in Home Assistant configuration is not enough. You may want to have a switch, script or automation in Home Assistant that will wake a specific PC or multiple PCs. This is what you can do for a Home Assistant Wake on LAN switch:

First, you will need the MAC address of the PC of your interest. You can get the MAC address either from your router interface or from the Windows command prompt using the ipconfig /all command.

Getting the MAC / Physical Address using ipconfig /all command to add the value in the Home Assistant Wake On Lan switch

Getting the MAC / Physical Address using ipconfig /all command to add the value in the Home Assistant Wake On Lan switch

Second, you have to add the following YAML in the configuration.yaml file using text editor or add-on like File Editor.

# configuration.yaml entry
switch:
  - platform: wake_on_lan
    mac: 20:cf:30:32:f7:89
    name: “a3-pc” 

Make sure that you do the following things:

  • If you already have switch: section in your configuration.yaml file add only the last 3 lines under your existing section.
  • Change the mac: value with your MAC address.
  • Change the name: to something meaningful for you (e.g. hostname of the device)
  • Save the changes and restart Home Assistant.

Test the Home Assistant WoL switch

Let’s quickly test if the Home Assistant Wake on LAN switch can actually wake our PC.

You can add a button to the Home Assistant Lovelace UI by click on the three dot menu in the upper right corner > Edit Dashboard > Add Card > Button Card > as entity select your newly created switch (i.e. switch.a3_pc) > Save

Adding the Home Assistant WoL Switch as button card

Adding the Home Assistant WoL Switch as button card

Before the actual test you have to put your computer to sleep. If you shut it down the Wake on LAN may or may not work.

I have to put my Windows PC to sleep to be able to use Wake On LAN successfully from Home Assistant.

And now when your PC fell asleep 💤 and you have a Button card with your WoL switch in Home Assistant – you can just press it and your PC will rise from the dead. 🎉

Home Assistant RPC Shutdown add-on 

Okay Wake on LAN Is working, but what if you want to turn off a Windows PC from Home Assistant? The Home Assistant RPC shutdown add-on available in the Home Assistant store will save the day. Let’s install it

Open your Home Assistant and press, the “c” button to invoke the search bar, type add-on and choose Navigate Add-On store. Then search for RPC Shutdown or save the hassle and click on the link below, which will lead you to the same place.

Home Assistant Wake On Lan & Home Assistant RPC Shutdown (HOW-TO) 4

Click on the Install button to have your RPC Shutdown add-on.

After the installation we will need the IP, username and password of the windows machine to configure properly the RPC shutdown add-on. This is an example configuration for my Windows PC, of course you can add multiple computers as well (just add more aliases).

computers:
  - alias: a3-pc
    address: 10.0.0.45
    credentials: smash%thelike
    delay: 0
    message: >-
      Home Assistant is shutting down this PC. This cannot be canceled. Please
      save your work!

Make sure that you do the following changes under the Configuration tab in RPC shutdown add-on:

  • Change the alias: with something meaningful for you (e.g. hostname of the device)
  • Change the address: value with the IP address of the computer that you want to wake (Get it from your router interface or use again the ipconfig /all command from Windows command prompt)
  • Change the credentials: values with your Windows user & pass (i.e. user%pass)
  • Save the changes and start the RPC shutdown add-on from the Info tab.

Add Home Assistant RPC Shutdown switch

To test if the shutdown of a Windows PC from Home Assistant is working – we will edit our switch that we created in the Add Home Assistant Wake on LAN switch section above.

Go back to your configuration.yaml file and add another 6 lines under the existing WoL switch, so your code at the end should look similar to the one below.

# Example configuration.yaml entry
switch:
  - platform: wake_on_lan
    mac: 20:cf:30:32:f7:89
    name: “a3-pc” 
    host: 10.0.0.45
    turn_off:
      service: hassio.addon_stdin
      data:
        addon: core_rpc_shutdown
        input: a3-pc

The things that you have to change here are the following:

  • The value of the host: parameter with the IP of the machine that you want to shutdown.
  • The value of the input: parameter, where the value should be exactly the same as the alias in the RPC shutdown configuration. In my case the value everywhere is my windows pc hostname (a3-pc).
  • Save the changes and restart Home Assistant.

After Home Assistant has started – you can try to shutdown the Windows PC (a.k.a the victim) by pressing the same button that wake our PC earlier in the Home Assistant UI.

If your computer shut down correctly – you are done with this guide and you don’t have to do anything else, except you can show off in the comments section below.

If your computer doesn’t want to shutdown, check the RPC Shutdown Logs section and continue reading.

What If RPC shutdown is not working?

If you see any of the errors below in the RPC shutdown log section:

Could not initialise pipe winreg. Error was NT_STATUS_OBJECT_NAME_NOT_FOUND
Shutdown of remote machine failed result was: WERR_CALL_NOT_IMPLEMENTED
Home Assistant Wake On Lan & Home Assistant RPC Shutdown (HOW-TO) 5

Shutdown of remote machine failed result was: WERR_CALL_NOT_IMPLEMENTED
Home Assistant Wake On Lan & Home Assistant RPC Shutdown (HOW-TO) 6

Could not initialise pipe winreg. Error was NT_STATUS_OBJECT_NAME_NOT_FOUND

Also the Home Assistant RPC shutdown is not working – you have to do several extra steps. Namely to start a Remote Registry service, to create a WMI firewall rule and to add a local policy in your Windows registry.

Don’t worry it is easy, not that easy as subscribing to my newsletter, but I will show you all of the steps.

Start Remote Registry Service in Windows

Click on Start menu > select Run > Type services.msc and click OK > In the Services window search for Remote Registry service > Double click on it and set the Startup type: to Automatic > Click Apply > Finally start the service by click on Start button.

Start Remote Registry Service in windows if Home Assistant RPC Shutdown is not working

You can try again to shutdown your PC from Home Assistant after you start the Remote Registry service, but most probably you will fail, so keep reading.

Allow WMI in Windows Firewall

We have to create a simple Firewall Rule. Here is how:

Click on the Start button and type “allow” > Click on the Allow an app through Windows Firewall result > in the opened window scroll down until you see Windows Management Instrumentation (WMI) > Click on Change settings button and tick the checkbox under the Private column > finally click OK button.

Allow Windows Management Instrumentation (WMI) in Windows Firewall

Allow Windows Management Instrumentation (WMI) in Windows Firewall

You can try again to shutdown your PC from Home Assistant after you allow the Windows Management Instrumentation (WMI) in the Windows Firewall, but most probably you will fail, so keep reading.

Adding Local Policy in Windows Registry

It is Time to edit the Windows registry just a little bit :

Add a 32-bit DWORD named “LocalAccountTokenFilterPolicy” with a value of “1” (without quotes) under the following path in the windows registry: HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Windows/CurrentVersion/Policies/System

Or download and start the following LATFP.reg file that I made, which is doing the exact same thing 👉 LINK

Adding the LocalAccountTokenFilterPolicy 32bit DWORD will allow most probably allow the Home Assistant RPC Shutdown

Adding the LocalAccountTokenFilterPolicy 32bit DWORD will allow most probably allow the Home Assistant RPC Shutdown

After this last step you can try again the Home Assistant RPC Shutdown and this time it should work. Congratulations 🥂

Support My Work

If you want to secure this site existence you can become one of my Patreons where you will receive early access to my content, exclusive content and depending of the tier – free access to my paid Smart Home Guide.

Of course there are other support options available and you can check them here 👉 LINK

With that being said, stay safe and don’t forget – Home Smart, but not hard!

Thank you for watching and I will see you in my next article.

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:\Users\Alexey\AppData\Roaming\.homeassistant

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

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

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

config: frontend: system_health:

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

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

PS

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

robotics-university.com | Hello my friends, hope you always in good condition. Today I will continue talking about Internet of Things (IoT) or in proper is Home Automation. Two topic that is the most popular talked by peoples on the last several years. 

Today, I will talk about Home Assistant, Open source home automation that puts local control and privacy first. Powered by a worldwide community of tinkerers and DIY enthusiasts. Perfect to run on a Raspberry Pi or a local server [1]. 

In order you can use it, you have to install it on your Raspberry Pi single board computer (SBC) or on your computer local server. But on this article, I will give you guide to install Home Assistant on the local server of Windows 10 computer. 

Step 1: Visit the Home Assistant Official Website 

First, visit the Home Assistant official website (https://www.home-assistant.io/), then select “Get Started” menu to get the installation guidance (See figure 1 and figure 2). 

Figure 1. The Home Assistant official website front-page 

Figure 2. Installation guide of Home Assistant 

Read the guidance and follow the Home Assistant installation steps there. But unfortunately, there is available installation guide on Raspberry Pi SBC only. If you have Raspberry Pi, follow the guidance. But if you don’t have and want to install Home Assistant on Windows 10 computer, please continue reading this article. 

Step 2: Download and Install the Latest Version of Python 

For your information: To install Home Assistant on Raspberry Pi SBC or Windows 10 computer, installed Python on your devices are needed. Python on Raspberry Pi is ready to use in default, but on Windows 10 computer isn’t, so for your Windows 10 computer, you have to install Python first before installing Home Assistant. 

Get the latest Python installer file from the Python official website by click this link, here (See figure 3). Save it into a folder/directory in your computer. 

Figure 3. Python download page 

To start install Python on your computer, just double-click the execute (exe) file, see figure 4. 

Figure 4. Python installer file (exe) on a file storage directory 

If an installation section window as displayed on figure 5 opened, before you click “Install Now” option, don’t forget to check on “Add Python x.x to PATH” 

Figure 5. Python installation section window 

After you have clicked “Install Now” option, the Python installation will run (See figure 5). Wait until the process complete (See figure 6 and figure 7). 

Figure 6. Python installation is in progress 

Figure 7. Python installation was complete 

If the installation process has been completed (See figure 7), press “Close” button as the end of the Python installation step. 

Step 3: Install Home Assistant Using Command Prompt Window 

To install Home Assistant on a Widows 10 computer, it can do with aided by command prompt window (See figure 8). 

Figure 8. Step to open Command prompt windows 

Type “cmd” into the search box of your Windows 10 computer then press enter key or you can use shortcut-key, Windows key + R, then press enter key. The opened command prompt window shown on figure 9. 

Figure 9. Command Prompt windows 

A. Command to install Home Assistant 

To get started install Home Assistant on your windows computer, type the command below: 

pip3 install homeassistant 

Before you press enter key of your keyboard, make sure that your computer connects with internet network. 

Figure 10. The Home Assistant installation is on process 

Once you press enter key on keyboard, the Home Assistant installation process will run (See figure 10). 

Figure 11. The Home Assistant installation process has done 

After a while, the installation process will be end (See figure 11) 

B. Command to check Home Assistant package information 

To make sure that Home Assistant has installed on your Windos 10 computer, you can check it. Type this command below to do so: 

pip3 show homeassistant 

Figure 12. The Home Assistant package information 

Once you type the command above and then press enter key, on command prompt window will show package information of installed Home Assistant on your computer (See figure 12). 

C. Command to open Home Assistant User Interface (UI) 

Next, in order you can create an account on Home Assistant, you have to open the web-based user interface (UI). To do so, type the command below, then press enter key on your keyboard. 

hass —open-ui 

Figure 13. Command to install Home Assistant user interface (UI) 

Once you press enter key, on your internet browse will open Home Assistant web-based user interface (Sign-up page) automatically (See figure 14). 

Figure 14. Home Assistant web-based user interface (Sign-up page) 

Looks at on the Home Assistant web-based user interface! “127.0.0.1“ is my computer IP address. Your computer IP address may be different (see figure 14). 

Note: 

When you run hass —open-ui command to open Home Assistant web-based user interface (UI), but there is error occur, type this command below: 

C:\Users\admin\appdata\local\programs\python\python38-32\python.exe -m homeassistant (Change “admin” with your computer username) or type enough python -m homeassistant 

After that if Home Assistant web-based user interface (See figure 14) not open automatically, open it with type on your internet browser one of the web-page URL below manually: 

URL 1 = http://homeassistant.local:8123

URL 2 = http://homeassistant:8123 (for older version windows) 

URL 3 = http://X.X.X.X:8123 (replace X.X.X.X with your computer IP address) 

If there is no error occur again, the Home Assistant web-based user interface will open for you. 

Yeah … great! 

If you have reached on this point, its means that Home Assistant has installed on your Windows 10 computer now. Congratulation! 

Next, you have to create account on Home Assistant web-based user interface (Onboarding) before you awaken your own home automation projects. 

Sources 

About
Taufiq D.S. Suyadhi

В последнее время, мне как-то надоедает включать свою домашнюю виртуализацию, базирующуюся на 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:\VM\hassos_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.

Понравилась статья? Поделить с друзьями:
0 0 голоса
Рейтинг статьи
Подписаться
Уведомить о
guest

0 комментариев
Старые
Новые Популярные
Межтекстовые Отзывы
Посмотреть все комментарии
  • Windows 10 hybrid sleep
  • Как блокировать программе доступ в интернет windows 10
  • Установка windows 7 на macbook air 2010 late
  • Сетевой драйвер lenovo b560 windows 10
  • Saitek rumble pp22 драйвера для windows 10