Thanks to visit codestin.com
Credit goes to github.com

Skip to content

jacklty/homeassistant

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 

Repository files navigation

  • This mini motherboard shares the same form size with Raspberry-pi 3B but with a faster cpu and much more memory.
  • The official website provide either ubuntu image and raspbian image
    • raspbian seems less bulky and works pretty well with all hw components as well as Home Assistant Core
    • Highly recommended to use a faster micro sd-card or use eMMC Module (IO is pretty slow)

Before...

  • update hostnames in these files and reboot
    • /etc/hostname
    • /etc/hosts
    • Or hostnamectl set-hostname new-hostname and confirm with hostnamectl

Wifi Cudy AC650 and Asusconumer AC600 + BT

Build & Install the Device Driver for rtl8821cu

git clone https://github.com/morrownr/8821cu-20210118
cd 8821cu-20210118
./ARM64_RPI.sh
sudo ./install-driver.sh
# reboot accordingly
  • install bluetooth packages
    • apt-get install -y bluez bluez-tools blueman
      • systemctl status bluetooth.service
  • Why the user can see any bluetooth devices?
    • the user might not have access to bluetooth (need to be in the bluetooth group)
      • gpasswd -a homeassistant bluetooth
      • gpasswd -a pi bluetooth
    • You should be able use bluetoothctl to list and scan
      • lsusb should show you the usb bt receiver and you should see bt firmware loading in dmesg

Configure wifi connection

  • Reference: https://wiki.archlinux.org/title/wpa_supplicant
  • Scan for SSIDs iwlist wlan0 scans
  • Create a file named /etc/wpa_supplicant/wpa_supplicant.conf with following content
    country=US
    update_config=1
    ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
    
    network={
      ssid="Fishy NNetwork"
      psk=".........."
      proto=RSN
      key_mgmt=WPA-PSK
    }
    
    network={
      ssid="FishyLake"
      psk=".........."
      proto=RSN
      key_mgmt=WPA-PSK
    }
    
  • wpa_supplicant -B -i wlan0 -c /etc/wpa_supplicant.conf
  • To restart wlan0: ifdown wlan0 && ifup wlan0
  • Check status: interface wlan0

ASUS BT500 Firmware

  • The firmware for this bluetooth dongle very likely is missing on raspbian
  • run lsusb and you would see the ASUS BT500 device (but not working)
  • run dmesg and you will see firemware missing for that bluetooth dongle

How to get the missing firmware?

Home Assistant Core via systemd

Install Home Assistant Core

  • Follow the official doc
  • Additional packages
    • apt-get install -y ffmpeg for Ring Integration

Systemd unit

  • cat /etc/systemd/system/home-assistant\@homeassistant.service
[Unit]
Description=Home Assistant
After=network-online.target

[Service]
Type=simple
User=%i
WorkingDirectory=/home/%i/.homeassistant
ExecStart=/srv/homeassistant/bin/hass -c "/home/%i/.homeassistant"
RestartForceExitStatus=100
Restart=on-failure
RestartSec=5s

[Install]
WantedBy=multi-user.target

Custom Integration

MQTT and Mosquitto

  • apt-get install -y mosquitto mosquitto-client
  • systemctl status mosquitto

Secure Mosquitto (MQTT Broker)

  • Make the server only accessible locally with password
  • add /etc/mosquitto/conf.d/default.conf
    per_listener_settings true
    
    listener 1883 localhost
    allow_anonymous true
    
    listener 8883 0.0.0.0
    allow_anonymous false
    
    password_file /etc/mosquitto/passwd
    
  • add /etc/mosquitto/passwd
    fishylake:<secret>
    
    • run mosquitto_passwd -U passwd && chgrp mosquitto /etc/mosquitto/passwd && chmod 640 /etc/mosquitto/passwd
    • run systemctl restart mosquitto to reload the config
  • Test mqtt

Radio SDR rtl-433

Midea Dehumidifier

  • You would need to have the devices first added to the Midea Air App via a cloud account (not with Apple ID or facebook)
    • User: [email protected]
    • Password: <Hint: first date of internet and plain old password>
    • You can always share them later to different Midea Accounts/Users
  • As with Core, you need to install it manually
    # As the `homeassistant` user
    sudo -u homeassistant -H -s
    cd ~
    # Obtain the custom integration for Midea
    git clone https://github.com/nbogojevic/homeassistant-midea-air-appliances-lan
    mkdir -p ~/.homeassistant/custom_components
    # Copy the custom integration to Home Assistant Config folder
    cp -R homeassistant-midea-air-appliances-lan/custom_components/midea_dehumidifier_lan ~/.homeassistant/custom_components
    
  • Restart Home Assistant to pick up new integration

Misc.

piVPN

  • curl -L https://install.pivpn.io | bash
    
  • Why OpenVPN over WireGuard? Router integration is still lacking for WireGuard, so we should stick with OpenVPN for now.
  • iptables rules can be found in /etc/iptables/rules.v4
    • make sure the postrouting rules are using the correct inet otherwise clients can't access the internet (or local network)

ddclient and google domain

  • apt-get install ddclient
    
  • Obtain the credentail for specific dynamic dns record (at the very bottom on domains.google.com)
    # /etc/ddclient.conf
    
    protocol=googledomains \
    use=web, web=https://domains.google.com/checkip \
    login=... \
    password=... \
    fishylake.compulty.com
    

How to manually update DDNS?

# Obtain the corresponding credential of the DDNS record.
curl "https://${LOGIN}:${PASSWORD}@domains.google.com/nic/update?hostname=fishylake.compulty.com&myip=$(curl ipconfig.io)"

Let's Encrypted

  • sudo apt install certbot
    sudo certbot certonly --manual --preferred-challenges dns -d fishylake.compulty.com
    # follow the instruction to update the TXT record to complete the verification
    

Amazon Smart Thermostat thru Homebridge

Homebridge

https://github.com/homebridge/homebridge/wiki/Install-Homebridge-on-Debian-or-Ubuntu-Linux

curl -sSfL https://repo.homebridge.io/KEY.gpg | sudo gpg --dearmor | sudo tee /usr/share/keyrings/homebridge.gpg  > /dev/null
echo "deb [signed-by=/usr/share/keyrings/homebridge.gpg] https://repo.homebridge.io stable main" | sudo tee /etc/apt/sources.list.d/homebridge.list > /dev/null
sudo apt-get update
sudo apt-get install homebridge
systemctl status homebridge

Login to the web interface by going to http://:8581.

Install Plugin: homebridge-alexa-smarthome

To bring Alexa enabled devices into homebridge, we need homebridge-alexa-smarthome

  • In homebrdige Web UI, look for homebridge-alexa-smarthome and install it.
  • Configure the plugin as following
    • Proxy Client Host: <HOST_IP>
    • Proxy port: 9876
  • It then restarts and open http://<HOST_IP>:9876 and complete the login (amazon account + otp)
  • Now all devices (alexa registered) will show up (e.g. smart thermostats)

Key Error

InfluxDB Cloud and Grafana

InfluxDB Cloud

Create a bucket

  • create dbrp mapping for influxql
    • influx v1 dbrp create --db homeassistant --rp autogen --org fishylake --bucket-id 5dc17125e0b5ba2b --default
    • now we have database mapping called homeassistant to the newly created bucket

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages