This are my notes to install home-assistant on a raspberry-pi 3. At the end, this is a multipart how-to for installing home-assistant and mosquitto (MQTT) with a NodeMCU and some magnetic contacts.
Copy Raspbian Lite to an SD Card on Mac OSX (use rdisk is faster):
sudo dd if=Downloads/2017-11-29-raspbian-stretch-lite.img of=/dev/rdisk4 bs=4m conv=sync
Enable SSH (create a file named ssh on the SD-Card):
touch /Volumes/boot/ssh
Put the SD-Card into your raspberry and boot it up.
Login and change password of user pi and root:
passwd
sudo passwd root
Configure WLAN:
wpa_passphrase “YourWLANSSID” “yourWLANPassword”
Configure WLAN in /etc/wpa_supplicant/wpa_supplicant.conf:
country=CH
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
ssid=”YourWLANSSID”
#psk=”yourWLANPassword” <<<<<—– REMOVE THIS COMMENTED LINE!
psk=131e1e221f6e06e3911a2d11ff2fac9182665c004de85300f9cac208a6a80531
}
You have a fixed IP? (preferred!)
Edit /etc/dhcpcd.conf and set the hostname inside this file.
Add config for your interface:
interface wlan0
static ip_address=192.168.0.XXX/24
static routers=192.168.0.XXX
static domain_name_servers=XXX.XXX.XXX.XXX, XXX.XXX.XXX.XXX
static domain_search=some.domain.com
static domain_name=some.domain.com
Use raspi-config to configure your raspberry hostname and partition then reboot.