swa72 / home-assistant

13 stars 1 forks source link
home-assistant homeassistant

home-assistant

My first attempt at running a home automation system was a Shelly device integrated to HomeKit - worked nicely. Then I fiddled around with running https://homebridge.io/ on my Raspberry 4, moved over to https://hoobs.org/ and realized that there must be something better. Luckily I found Home Assistant.

My goal

Have a nice and easy interface for the house on the iPad (no need for my wife and kids to access any of the Home Assistant stuff). Have an advanced interface to the house for myself.

This file is intended for me to document the quirks I had during setup and for others to learn and avoid them.

My setup

How to access HA from the outside?

The fritzbox forwards port 443 to the Raspberry running HA.

DuckDNS

lets_encrypt:
  accept_terms: true
  certfile: fullchain.pem
  keyfile: privkey.pem
token: ##replaceme##
domains:
  - xxx.duckdns.org
aliases: []
seconds: 300

NGINX Home Assistant SSL proxy

domain: xxx.duckdns.org
certfile: fullchain.pem
keyfile: privkey.pem
hsts: max-age=31536000; includeSubDomains
cloudflare: false
customize:
  active: false
  default: nginx_proxy_default*.conf
  servers: nginx_proxy/*.conf

Network
Container   Host    Description
443/tcp      443
80/tcp      80

Also make sure to include http.yaml in configuration.yaml with

use_x_forwarded_for: true
trusted_proxies:
  - 172.30.33.0/24
  - 127.0.0.1
  - ::1

Using this setup, I can access HA locally with http://homeassistant-eth:8123/ and remotely with https://xxx.duckdns.org/. This is particularly important as local devices may not be able to use HTTPS, so I can still use HTTP locally.

AdGuard Home

ssl: true
certfile: fullchain.pem
keyfile: privkey.pem

DSS VoIP Notifier

- service: hassio.addon_stdin
  data_template:
    addon: 89275b70_dss_voip
    input: {"call_sip_uri":"sip:**614@192.168.178.1:5060","message_tts":"Hallo Stefan"}

MariaDB

SSH & Web Terminal

ssh:
  username: hassio
  password: ''
  authorized_keys: ##replaceme##
  sftp: false
  compatibility_mode: false
  allow_agent_forwarding: false
  allow_remote_port_forwarding: false
  allow_tcp_forwarding: false
zsh: true
share_sessions: false
packages: []
init_commands: []

Backup to Google Drive

Samba share

workgroup: WORKGROUP
username: ##replaceme##
password: ##replaceme##
interface: ''
allow_hosts:
  - 10.0.0.0/8
  - 172.16.0.0/12
  - 192.168.0.0/16
  - 'fe80::/10'
veto_files:
  - ._*
  - .DS_Store
  - Thumbs.db
  - icon?
  - .Trashes
compatibility_mode: false

deCONZ

HACS: Alexa Media Player

Amazon Echo Dot and Spotify

alias: Spotify setup
description: ''
trigger:
  - platform: homeassistant
    event: start
condition: []
action:
  - service: media_player.select_source
    target:
      entity_id: media_player.spotify_swa72
    data:
      source: Stefans Echo Dot
mode: single

Note that spotify_swa72 is my media player. You can simply add another media player to lovelace. Or use a script to play a certain playlist

alias: Spotify play playlist
sequence:
  - service: media_player.play_media
    data:
      media_content_id: >-
        https://open.spotify.com/playlist/37i9dQZF1DXaIrEwuQ3hyy?si=887717bbbc1f46e9
      media_content_type: playlist
    target:
      entity_id: media_player.spotify_swa72
mode: single

motionEye

Reolink E1 pro camera

Reolink RLC-511WA camera

ftp add-on

port: 21
data_port: 20
banner: Welcome to the Hass.io FTP service.
pasv: true
pasv_min_port: 30000
pasv_max_port: 30010
pasv_address: ''
ssl: false
certfile: fullchain.pem
keyfile: privkey.pem
implicit_ssl: false
max_clients: 5
users:
  - username: camera
    password: ## some password ##
    allow_chmod: false
    allow_download: false
    allow_upload: true
    allow_dirlist: true
    addons: false
    backup: false
    config: false
    media: true
    share: true
    ssl: false
log_level: debug

Fritzbox smart home

Fritzbox Tools

Fritzbox call monitor

Influxdb

Grafana

Useful stuff

Template

Push automation to github

- id: l1k3
  alias: push HA configuration to GitHub repo
  trigger:
    - at: '23:23'
      platform: time
  action:
    - service: shell_command.push_to_github
  mode: single

And there is an entry in my configuration.yaml file with

shell_command:
  push_to_github: /config/gitpush.sh

notepad++ tips

Garage

Naming conventions for shelly devices

Too many homekit bridges

Using MQTT explorer

Deprecated stuff

HACS: iCloud3 Device Tracker (deprecated, no longer in use)

Glances (deprecated, no longer in use)

log_level: info
process_info: false
refresh_time: 10
ssl: false
certfile: fullchain.pem
keyfile: privkey.pem
influxdb:
  enabled: false
  host: ##replaceme##
  port: 8086
  username: glances
  password: '!secret glances_influxdb_password'
  database: glances
  prefix: localhost
  interval: 60

Backup to Samba Drive (deprecated, no longer in use)

host: 192.168.178.1
share: FRITZ.NAS
target_dir: CCCOMA_X64F\ha
username: ##replaceme##
password: ##replaceme##
keep_local: 14
keep_remote: all
trigger_time: '00:00'
trigger_days:
  - Mon
  - Tue
  - Wed
  - Thu
  - Fri
  - Sat
  - Sun
exclude_addons: []
exclude_folders: []
backup_name: '{type} Snapshot {version} {date}'