homeassistant

Home Assistant ustreamer

Video Capture AV USB card (ARKMICRO 18ec:5555) / dmesg

[141319.682908] usb 1-1.4: New USB device found, idVendor=18ec, idProduct=5555, bcdDevice= 1.00
[141319.682941] usb 1-1.4: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[141319.682955] usb 1-1.4: Product: USB2.0 PC CAMERA
[141319.682966] usb 1-1.4: Manufacturer: ARKMICRO
[141319.685776] usb 1-1.4: Found UVC 1.00 device USB2.0 PC CAMERA (18ec:5555)

TODO: Fix device permissions

chmod 0666 /dev/video0
 
# cat /etc/udev/rules.d/99-camera.rules
# DEVNAME="/dev/video0",MODE="0666"

Create container
https://hub.docker.com/r/mkuf/ustreamer

docker run -d \
  --name ustreamer \
  --restart always \
  -p 8082:8080 \
  --device /dev/video0:/dev/video0 \
  mkuf/ustreamer:latest

Stream
http://ha:8080/?action=stream

Debug

Install Home Assistant on Raspberry Pi

Install Home Assistant on Raspberry Pi
https://www.home-assistant.io/installation/raspberrypi/

# Install rpi-imager
sudo apt install rpi-imager
 
# Create Homeassistant SD-Card
# Other specific-purpose OS > Home assistants and home Automation > Home Assistant OS
 
# Connect to HA
http://YOUR_HOME_ASSISTANT_IP:8123/
 
# Create Home Assistant account
 
# Install SSH plugin in Add-on-Store
http://YOUR_HOME_ASSISTANT_IP:8123/hassio/addon/core_ssh/info
 
# Open SSH Web CLI
http://YOUR_HOME_ASSISTANT_IP:8123/hassio/ingress/core_ssh
 
# get wifi data from workstation
WIFI_SSID="$(nmcli dev wifi show-password | grep SSID | cut -d' ' -f2-)" 
WIFI_PASS="$(nmcli dev wifi show-password | grep Pass | cut -d' ' -f2-)"
echo ha network update wlan0 \
  --ipv4-method auto \
  --wifi-auth wpa-psk \
  --wifi-mode infrastructure \
  --wifi-ssid \'${WIFI_SSID}\' \
  --wifi-psk \'${WIFI_PASS}\'
 
# paste output to SSH online console 
 
# debug
ha network info

Enable SSH key to hypervisor (Raspberry Pi)
https://community.home-assistant.io/t/howto-how-to-access-the-home-assistant-os-host-itself-over-ssh/263352/6

Home Assistant

Install Home Assistant as Docker container
https://www.home-assistant.io/installation/linux#platform-installation

docker run -d \
  --name homeassistant \
  --privileged \
  --restart=unless-stopped \
  -e TZ=Europe/Berlin \
  -v homeassistant:/config \
  --network=host \
  ghcr.io/home-assistant/home-assistant:stable
 
# volume path
# /var/lib/docker/volumes/homeassistant

Configure
http://127.0.0.1:8123

Install HACS

sudo docker exec -it homeassistant bash
wget -O - https://get.hacs.xyz | bash -

Addons / Plugins
LocaTuya: https://github.com/rospogrigio/localtuya/

custom_zha_quirks
https://smarthomescene.com/reviews/tuya-zigbee-single-clamp-energy-meter-review/