Posts

1) Intro - what this is going to achieve

Introduction This is a quick guide of how to set up Home Assistant so it can broacast speech using IFTTT, the example will use geolocation so when you enter an area it will cause Google Home to speak a phrase like "daddy's home". We are installing Home Assistant on a Windows PC in this case, the PC is always switched on.

2) Install Python

Image
Install Python The first thing you need to do is install Python 3.6.x, download the latest version from here . Choose the executable installer. When installing, make sure you tick both the options at the bottom, "Install launcher for all users" and "Add Python 3.6 to PATH" before choosing "Install Now" as seen here: Allow it to install and close the window once it's done.

3) Install Home Assistant

Image
Install Home Assistant Now we use Python to install Home Assistant. Click your Windows button so the Start Menu opens and type the following letters: cmd It will find a programme called "Command Prompt" with a black icon like this:  Click the icon to load the black command window. Type in the following and press return: pip3 install homeassistant This will download and install Home Assistant. Once completed, type the following: py -m homeassistant --open-ui Once done you can close the black command window. If it has worked, it will have opened your web browser and you can see Home Assistant. For this part, you need to know your longitude & latitude which you can get  here . You will also need your elevation, which can be found  here . Finally, you need your timezone, which can be found  here . Now, on your PC you need to navigate to this folder: c:\users\ NAME \AppData\Roaming\.homeassistant\ Replace " NAME " with your login name. Right click on 

4) Auto start Home Assistant when Windows starts

Auto start Home Assistant when Windows starts Open a programme on your PC called Task Scheduler. On the menu on the right choose "Create Task" Under the following tabs make the listed changes: General Enable: Run whether user is logged on or not Triggers New > change the first dropdown to "At Startup" Actions New > Start a Program In Program/script browse to:  C:\Users\NAME\AppData\Local\Programs\Python\Python36-32\python.exe (change NAME to your PC logon) In Add arguments enter: -m homeassistant Leave everything else as it is and click OK.

5) Forward the ports on your router & obtaining a static name

Forward the ports on your router here comes the tricky bit! Everyone's router is different. Totally different. So I cannot explain this part for you. What you need to do is forward port 8123 to your PC. I wish you luck finding out this info. Sorry. Obtaining a static name I would recommend opening a no-ip account and installing their Dynamic DNS software, it's free, you just have to confirm your chosen name every 4-6 weeks. This will give you a name to remember rather than your IP address which can change every so often.

6) Set Up IFTTT

Set Up IFTTT Install IFTTT app on your phone and sign in (you need the app running for geolocation to work). Go to create a new applet in the app or on the website. Under "This" choose location > you enter an area Search for the area you want and adjust the zoom to change the area it encompasses. Click "Create Trigger" Under "That" choose Webhooks Set the URL to: http:// 123.123.123.123 :8123/api/services/tts/google_say?api_password= ABC123 Change 123.123.123.123 to your external facing IP address or the name you chose when signing up to No-IP, change ABC123 to your API password you put in your configuration.yaml file. Set Method to "POST" Content Type to "appllication/json" Body needs to be: {"entity_id": "media_player.lounge_speaker","message":"Enter what you want it to say here"} Save the applet. Restart your PC You are done