Home Assistant 101 - Home Automation for Beginners

Oct 25, 2024
home assistant

 

Home Assistant 101 Guide

Home Assistant 101

Installation Options

Supplies List

IoT Devices (recommended)

Raspberry Pi Install

Step 1

Step 2

  • Insert the SD card, power it up, and connect your Ethernet cable.

Virtual Machine Install (Proxmox)

Follow this link to install Home Assistant on a VM: https://forum.proxmox.com/threads/guide-install-home-assistant-os-in-a-vm.143251/

The Setup

Once powered on, Home Assistant should automatically be accessible at homeassistant.local:8123 via mDNS. If this doesn’t work, check your router for the assigned IP address and access Home Assistant at ipaddress:8123.

Adding IoT Devices

To get started with automating your home, you'll want to add some IoT devices through integrations. Integrations are what make it possible for Home Assistant to communicate with your devices, giving you centralized control over everything.

What Are Integrations?

Integrations are the link between Home Assistant and your IoT devices, services, or protocols. For example, an integration can connect Home Assistant to your Zigbee network, letting you control lights, plugs, and other smart devices.

Here’s how you add an integration:

  1. From your Home Assistant dashboard, navigate to Settings.
  2. Select Devices & Services.
  3. Click the Add Integration button and search for the device type or brand you want to add.

If you're using Philips Hue lights, you can use the Philips Hue integration for added convenience. Simply search for 'Philips Hue' in the integrations list, and follow the prompts to connect your lights. This method allows for seamless control of your Philips Hue lights directly within Home Assistant.

Devices, Entities, and Helpers

Home Assistant’s structure can be broken down into devices, entities, and helpers. Here’s what they mean:

  • Devices: Physical hardware added to Home Assistant, like light switches, thermostats, or smart plugs.
  • Entities: Individual controllable features of a device. For instance, a smart bulb might have entities for brightness, color, and power state.
  • Helpers: Tools to enhance control and automation. For example, a helper can be a slider for adjusting brightness or a toggle for setting modes. Helpers make automation more flexible and dynamic.

Automations

Automations let you create rules for how your devices should react to various events. For example, you can make your lights turn on when motion is detected or set your thermostat to adjust based on the time of day.

Automations in Home Assistant have three key components:

  1. Trigger: What starts the automation (e.g., a sensor detecting movement).
  2. Condition: Conditions that must be met before the action occurs (e.g., only after sunset).
  3. Action: What happens when the automation is triggered (e.g., lights turn on).

To create an automation:

  1. Go to Settings > Automations & Scenes.
  2. Click Add Automation.
  3. Use the wizard to select your triggers, conditions, and actions.

Scenes

Scenes allow you to control multiple devices with one command, setting them to specific states simultaneously. For instance, a "Movie Night" scene could dim your lights, lower the blinds, and set your thermostat—all at once.

To create a scene:

  1. Navigate to Settings > Automations & Scenes.
  2. Select Scenes and click Add Scene.
  3. Set the desired states for each device in the scene.

Dashboards and Customization

Your dashboard is what you see when you log into Home Assistant. It provides a snapshot of all your devices and allows you to control them. You can fully customize this dashboard to suit your needs.

To customize your dashboard:

  1. From the Home Assistant main screen, click the Edit Dashboard button.
  2. Add cards to represent your devices, entities, or scenes.
  3. Rearrange the layout to match your preferences.

With Home Assistant, you have complete control over how your smart home functions. From integrations and automations to custom scenes and dashboards, it’s all about building an experience that suits you.

 

 

Automation Examples

 

alias: opt_detect
description: Detecting if there is a compromised bathroom.
triggers:
- trigger: state
entity_id:
- binary_sensor.guest_bathroom_proximity_motion
from: "on"
to: "off"
conditions:
- condition: or
conditions:
- condition: state
entity_id: binary_sensor.guest_bathroom_door_opening
state: "on"
actions:
- action: input_boolean.turn_on
metadata: {}
data: {}
target:
entity_id: input_boolean.opt_switch
mode: single

 

alias: opt_detect_off
description: ""
triggers:
- trigger: state
entity_id:
- binary_sensor.toilet_lid_opening
from: "off"
to: "on"
- trigger: state
entity_id:
- binary_sensor.guest_bathroom_door_opening
from: "on"
to: "off"
conditions:
- condition: state
entity_id: binary_sensor.toilet_lid_opening
state: "on"
enabled: false
- condition: state
entity_id: binary_sensor.guest_bathroom_door_opening
state: "off"
- condition: state
entity_id: input_boolean.opt_switch
state: "on"
actions:
- action: input_boolean.turn_off
metadata: {}
data: {}
target:
entity_id: input_boolean.opt_switch
mode: single

 


alias: opt_run
description: This automation runs Operation Toilet when the opt_switch is on.
triggers:
- trigger: state
entity_id:
- input_boolean.opt_switch
from: "off"
to: "on"
conditions: []
actions:
- action: media_player.turn_on
metadata: {}
data: {}
target:
entity_id:
- media_player.living_room1225
- media_player.g
- action: media_player.select_source
metadata: {}
data:
source: Plex
target:
entity_id:
- media_player.living_room1225
- media_player.g
- action: light.turn_on
metadata: {}
data:
rgb_color:
- 245
- 0
- 0
brightness_pct: 100
target:
entity_id:
- light.master_lights
- light.the_downstairs
- action: switch.turn_on
metadata: {}
data: {}
target:
entity_id: switch.unifi_network_operation_toilet
- parallel:
- repeat:
sequence:
- action: media_player.play_media
metadata:
title: ALERT - Toilet Message (2024)
thumbnail: >-
https://10-7-1-21.ed7aa413e3314a13881f5073b93f4030.plex.direct:32400/library/metadata/9971/thumb/1728925664?X-Plex-Token=o-7nQbcnLs9H2gtmEA8c
media_class: movie
children_media_class: null
navigateIds:
- {}
- media_content_type: library
media_content_id: plex://71fbca2a8bf590614f63142155d1be9ae7a762b5/11
data:
media_content_id: plex://71fbca2a8bf590614f63142155d1be9ae7a762b5/9971
media_content_type: movie
target:
entity_id: media_player.master_bedroom_plex
- action: media_player.play_media
metadata:
title: ALERT - Toilet Message (2024)
thumbnail: >-
https://10-7-1-21.ed7aa413e3314a13881f5073b93f4030.plex.direct:32400/library/metadata/9971/thumb/1728925664?X-Plex-Token=o-7nQbcnLs9H2gtmEA8c
media_class: movie
children_media_class: null
navigateIds:
- {}
- media_content_type: library
media_content_id: plex://71fbca2a8bf590614f63142155d1be9ae7a762b5/11
data:
media_content_id: plex://71fbca2a8bf590614f63142155d1be9ae7a762b5/9971
media_content_type: movie
target:
entity_id: media_player.living_room_plex_2
enabled: true
- wait_for_trigger:
- trigger: state
entity_id:
- media_player.master_bedroom_plex
from: null
to: idle
- trigger: state
entity_id:
- media_player.living_room_plex_2
from: null
to: idle
while:
- condition: state
entity_id: input_boolean.opt_switch
state: "on"
- alias: Flash Lights Red
repeat:
sequence:
- action: light.turn_on
metadata: {}
data:
flash: short
target:
entity_id:
- light.master_lights
- light.downstairs_ceiling
- delay:
hours: 0
minutes: 0
seconds: 2
milliseconds: 0
while:
- condition: state
entity_id: input_boolean.opt_switch
state: "on"
mode: single

 

 

alias: opt_return_to_normal
description: Returns everything to normal when opt switch is turned off.
triggers:
- trigger: state
entity_id:
- input_boolean.opt_switch
from: "on"
to: "off"
conditions: []
actions:
- delay:
hours: 0
minutes: 0
seconds: 10
milliseconds: 0
- action: switch.turn_off
metadata: {}
data: {}
target:
entity_id: switch.unifi_network_operation_toilet
- action: media_player.turn_off
metadata: {}
data: {}
target:
entity_id:
- media_player.living_room1225
- media_player.g
- action: light.turn_on
metadata: {}
data:
kelvin: 2298
target:
entity_id:
- light.master_lights
- light.downstairs_ceiling
mode: single