Running Home Assistant on windows

I don’t have a computer running Linux for the moment (if we exclude a few virtual ones).
And i wanted to use both bluetooth, RFXtrx and with no way of adding them to my virtual machines that was reliable, I set out to add the needed functionality on my own.

Now sadly i don’t know python so all the code is written in c# but once compiled its like any .exe file if you have .net framework 4.6.2 installed (Included in Windows 10 Anniversary).

The following where problems i wanted to solve

  1. I found no official way to run Home Assistant as a Windows service.
  2. I wanted to use the Mi flora component but it was dependent on gatttool.
  3. Use IIS as reverse proxy and add multiple logins (while not requiring me to login when in connected to the local wifi at home).

I have solved all problems and my code can be found on github Home-Assistant-Windows-Tools.

One last thing to get the mi flora component to work please edit .homeassistant\deps\miflora\miflora_poller.py
and change

            with Popen(cmd,
                       shell=True,
                       stdout=PIPE,
                       preexec_fn=os.setsid) as process:

to

            with Popen(cmd,
                       shell=True,
                       stdout=PIPE) as process:

in 2 places.

I hope this helps some else!

2 Likes

Haha thanks. I run HASS on Windows and just use a batch file that runs at system startup. It checks for updates and then launches, changing colors in the CMD window so I can tell at a glance if it’s still updating.

There’s some program available that will take any batch file and run it as a service on Windows but I haven’t bothered to wrap it into there yet–I like seeing the output on screen.

@echo off
color 37
c:
cd c:\python35
pip3 install --upgrade homeassistant
color 97
py -m homeassistant --open-ui
1 Like