Home Assistant Configuration

Home Assistant Configuration

In the first part I described how I installed Home Assistant on the host Fujitsu S920.
Well, here I will continue with the configuration of the home assistant.

(Started on 12 Dec. 2022)

Set Up Tuya Integration in Home Assistant

Before HA configuring, you should go to the Tuya IoT Platform and create a cloud develop project.

Create a cloud Project:
Register and create a Tuya developer account and create an account on the Tuya Cloud.
After creating the tuya account, go to the Cloud Management page under IoT Platform -> Cloud -> Development  and create a cloud Project.

On the Home Assistant Integrations page in the Setting panel, click on the + button in the lower right and search for Tuya and fill all fields.
The ACCESS_ID and ACCESS_KEY are located on Tuya project page under Cloud/Overview

Install Home Assistant mobile apps on Phone

Note: Don’t forget to renew your Tuya developer license here from time to time!

Setup secure remote access to Home Assistant by using DuckDNS and NGINX

  1. Create an acount on www.duckdns.org and choose a domain [something.duckdns.org]
  2. Install the DuckDNS add-on from the Home Assistant from Add-on Store and complete DuckDNS add-on’s configuration
    Go to Configuration and click the three dots at the top of screen and choose Edit in YAML from the list.

    domains:
    - something.duckdns.org
    token: xxx
    aliases: []
    lets_encrypt:
    accept_terms: true
    algo: secp384r1
    certfile: fullchain.pem
    keyfile: privkey.pem
    seconds: 300
    
  3. Set up a port forwarding on your FRITZ!Box (Router)
    under Internet in the left menu and select Permit Access from drop-down list and forward the Port xxxx (e.g. 9123) externally to allows access to Hassio
  4. In Home Assistant, install the add-on NGINX Home Assistant SSL proxy

    Click on add-on’s Configuration page and enter domain name just you created before and update the port to xxxx e.g. 9123
domain: something.duckdns.org
hsts: max-age=31536000; includeSubDomains
certfile: fullchain.pem
keyfile: privkey.pem
cloudflare: false
customize:
active: true
default: nginx_proxy_default*.conf
servers: nginx_proxy/*.conf
  • Click the folder icon in the upper left sidebar of the file editor window to open the file browser.
  • Then search an click the configuration.yaml file (in the /config/ folder) to load it into the main file editor window.

Edit configuration.yaml as follow:

# Load frontend themes from the themes folder
frontend:
  themes: !include_dir_merge_named themes

http:
  use_x_forwarded_for: true
  trusted_proxies:
    - 192.168.1.0/24 # Add the IP address of the proxy server
    - 172.21.0.0/24 # Nginx Proxy Manager
  ip_ban_enabled: true
  login_attempts_threshold: 3

panel_iframe:
  esphome:
    title: ESPHome
    icon: mdi:chip
    url: http://192.168.178.xxx:6052
    require_admin: true

lovelace:

Using their own web server, create a file called nginx_proxy_default_fix_ingress.conf under /share folder

location /api {
    proxy_connect_timeout 60;
    proxy_read_timeout 60;
    proxy_send_timeout 60;
    proxy_intercept_errors off;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection $connection_upgrade;
    proxy_set_header Host $host:8126;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_pass http://homeassistant.local.hass.io:8123/api;
}
  • In case of any changes, you should verify the changes by running a configuration check.
    in oder to do that, Navigate to Developer Tools -> YAML and then click on the Check configuration button.
  • Finally and in the end you update home assistant URL  to new external URL like (something.duckdns.org) under Settings > System > Network.
    Now you can access the Home Assistent interface internally via http and externally via https. For example https://something.duckdns.org:9123

Home Assistant 403 Forbidden Error After Restart
After restarting Home Assistant I faced a 403: Forbidden error when accessing using to HA through the dynamic DNS url, i.e.: https://xxx.duckdns.org:8123. If I tried with the internal ip I managed to access without facing any error so I thought was something external. Just open the file ip_bans.yaml and remove all the items there.
You should see there the new ip as it tried to access.

Once ip_bans.yaml file it’s empty restart HA going to Configuration > Settings. Then click to check configuration and if everything is fine click to restart.

Installing the Terminal

The next thing that is needed for me is Terminal.
It allows me to log in to Hass.io by using the web terminal.

  • Install the Terminal from Setting/add-on.
  • Start the Terminal add-on
  • Check the logs of the “Terminal” add-on to see if everything went well.

Install ESPHome Docker using the command line on Debian

sudo docker run -d --name="esphome" --net=host -p 6052:6052 -p 6123:6123 -e TZ=Europe/Berlin -v /usr/share/hassio/homeassistant/esphome:/config esphome/esphome

If necessary, you can install ESPHome on a Windows computer via the command line

apt install python3 python3-pip
python3 --version
Python 3.9.15
pip3 install esphome

example:
esphome logs sonoff.yaml
esphome compile sonoff.yaml
esphome run sonoff.yaml --device COM10

Add ESPHome to the Home Assistant instance via the user interface

Installing HACS community store

It allows to customize the Home Assistant with plugins and themes from community

Requirements:

  1. Request A GitHub account
  2. execute the command “cd /config & mkdir custom_components & cd custom_components”.
    Next run the HACS download script: (https://hacs.xyz/docs/configuration/basic)

    wget -O - https://raw.githubusercontent.com/hacs/get/main/get | bash -
    
  3. Go to Home Assistant \Setting \ Devices & Services and click on Integration, search for  HACS and install and submit
  4.  added the following code to the configuration.yaml and rebooted.
    frontend:
      themes: !include_dir_merge_named themes
    

Install Mushroom and Mushroom Theme from the HACS Frontend

To create Custome Card and design

Install Alarmo from the HACS Store

It allows creating an alarm system for Heating Room.

  • Go into HACS, Integrations, and click on Explore & download repositories.
    Search for Alarmo and click on it and download
  • After completion, restart Home Assistant.
  • Go to Settings, Devices & Services, and click on Add integration.
    Search for Alarmo and click on it. click on Finish.

TODO:

Installation of eWeLink Home Assistant Add-on

Open the HassOS dashboard, switch to the Add-on Store tab.
Click the vertical ellipsis (three vertical dots) in the upper right corner, select Repositories in the pop-up menu, enter the official add-on address of eWeLink: https://github.com/CoolKit-Technologies/ha-addon in the Manage add-on repositories modal box, click ADD. After closing the modal box, you can see the newly added eWeLink add-on on the Add-on Store page.

Click the eWeLink Smart Home card to open the add-on information page, click INSTALL and wait for the installation to complete, click START to enable the “eWeLink Smart Home” add-on.

Create backup by making a backup.  (Setting / System/ Backups)
Examples – Home Assistant (home-assistant.io)


<- Home Assistant on Futjitsu Futro S920

Measurement of  flow & return temperatures ->

Leave a Reply

Your email address will not be published. Required fields are marked *

*