This is my homeassistant config, just simple and easy to try.
I use homeassistant as the central controlling node of my home. It is used to:
- Control light, air purifier, humidifier, etc
- Use sensors to detect realtime temperature/humidity/air_condition, etc
- Automation
The initial HA screenshot is as below:
-
We can choose Raspbian/Hassbian/Mossbian/Hass.io to install. The detailed difference between them is shown in https://home-assistant.cc/installation/raspberrypi/. I use raspberry Pi 3B+ and choose hassbian.
-
Download hassbian image, and balenaEtcher burn tool.
-
Burn hassbian image into SD card, which is then inserted to Raspberry Pi.
Refer:
https://www.home-assistant.io/docs/installation/raspberry-pi/
https://www.home-assistant.io/getting-started/)
# sudo hassbian-config upgrade hassbian-script
# sudo hassbian-config install homeassistance
# sudo raspi-config
select network options-> Wi-fi -> Wifi name -> WiFi password -> OK
Advanced option -> A1 Expand Filesystem->OK-finish
# reboot
I want to access HA from outside, so I need to use openvpn to connect HA to the IPv6 Internet. You can use any other VPN to solve the connection problem.
Since HA supports IPv6 not very well, I use nginx to proxy IPv6 requests. Refer https://www.home-assistant.io/docs/ecosystem/nginx/ for more details.
I use letsencrypt to secure my HA service:
sudo apt-get install certbot python-certbot-nginx
sudo certbot --nginx
Refer:
https://certbot.eff.org/lets-encrypt/debianbuster-nginx
https://www.home-assistant.io/docs/ecosystem/nginx/
(refer https://github.com/timofurrer/w1thermsensor)
sudo vim /boot/config.txt; scroll down to the bottom of the file, and add the line:
dtoverlay=w1-gpio
Finally reboot the Raspberry Pi so that the changes take effect.
sudo modprobe w1-gpio
sudo modprobe w1-therm
sudo apt-get install python-w1thermsensor
ls /sys/bus/w1/devices/
find the file 28-xxxxxxxxxxxx and fill in read_temp_ds18b20.py
python read_temp_ds18b20.py
cd Adafruit_Python_DHT
python setup.py install
python /home/pi/temperature/read_temp_dht22.py
python /home/pi/humidity/read_humidity.py
First we should exchange serial ports, and allocate UART0/ttyAMA0 over GPIOs. The method is to add a line in /boot/config.txt:
dtoverlay=pi3-miniuart-bt
and reboot the raspberry Pi.
Then we should be able to read the data from PMS5003:
python3 /home/pi/plantower/read_g5_sensor.py
If it runs well, we can add it in crontab, and fetch data in HA configuration file.
Refer:
https://github.com/raspberrypi/firmware/blob/master/boot/overlays/README https://blog.csdn.net/asukasmallriver/article/details/76851375
I use broadlink MP1 to turn on/off air purifier/humidifier and broadlink RM to turn on/off airconditioner, etc.
refer: https://www.home-assistant.io/integrations/broadlink/
Add following code to configuration.yaml:
homekit:
auto_start: true
After restart HA, it will show a pairing code, which should be paste to your iOS device.
We can customize ui-lovelace.yaml.
For icons we can refer https://cdn.materialdesignicons.com/4.5.95/
- Connect with Xiaodu Speaker(control light, etc.)
- Hot water circulation system
- Smart curtain....
- always reboot. --> should use original cable.
- homekit not available --> debugging