Skip to content

Complete Home-Assistant configuration based on Docker and Postgress. Using Rapsberry and Azure.

Notifications You must be signed in to change notification settings

srozemuller/hassio-config

Repository files navigation

Home Automation with Docker and Postgres on RaspberryPI and AzureVM.

In the basics my environment has the following configuration

hassioversion reposize lastcommit

Local

Devices:
RPI with Raspbian Buster::

VM: Ubuntu 18.04 size B2s, standard, 2vCPU, 4GB mem

Setup Azure IPsec

https://docs.microsoft.com/en-en/azure/vpn-gateway/vpn-gateway-howto-site-to-site-resource-manager-portal

For setting up the VPN on the Raspberry I used the following steps:

Update first


$ apt update && sudo apt upgrade -y

$ apt install strongswan -y

Set kernel parameters


$ cat >> /etc/sysctl.conf << EOF

net.ipv4.ip_forward = 1

net.ipv4.conf.all.accept_redirects = 0

net.ipv4.conf.all.send_redirects = 0 EOF

$ sysctl -p /etc/sysctl.conf

Generate preshared key


$ openssl rand -base64 64

We will setup our VPN Gateway in Site A (Paris), first to setup the /etc/ipsec.secrets file:


$ cat /etc/ipsec.secrets # source destination [ExternalIP] [RemoteExternalIP] : PSK "xxxxx"

Now to setup our VPN configuration in /etc/ipsec.conf:


cat /etc/ipsec.conf

# basic configuration

config setup charondebug="all"

uniqueids=yes

strictcrlpolicy=no

# connection to azure

conn home-to-azure

authby=secret left=%defaultroute

leftid=ExternalIP

leftsubnet=localsubnet/24

right=azureExternalIP

rightsubnet=azureLocalsubnet/24

ike=aes256-sha2_256-modp1024!

esp=aes256-sha2_256!

keyingtries=0

ikelifetime=1h

lifetime=8h

dpddelay=30

dpdtimeout=120

dpdaction=restart

auto=start

Firewall settings


sudo iptables -t nat -A POSTROUTING -s AzureLocalSubnet/24 -d localSubnet/24 -j MASQUERADE

Start the service (on boot)


$ sudo ipsec restart

$ sudo systemctl enable strongswan

Status


$ sudo ipsec status

Used Hass.io components & cards

Cards

Components

Icons: http://materialdesignicons.com/

Screenshots

LightTheme LightTheme-SystemInfo LightTheme-HeatingInfo DarkTheme DarkTheme-SystemInfo DarkTheme-HeatingInfo

About

Complete Home-Assistant configuration based on Docker and Postgress. Using Rapsberry and Azure.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages