DEV Community

ChungWei Wei
ChungWei Wei

Posted on • Originally published at kmp.tw on

[IOT] Raspberry Install Home Assistant

Install Dependency

apt-get install -y python3 python3-dev python3-venv python3-pip libffi-dev libssl-dev libjpeg-dev zlib1g-dev autoconf build-essential libopenjp2-7 libtiff5 libturbojpeg0-dev tzdata
Enter fullscreen mode Exit fullscreen mode

Create HA User

useradd -rm homeassistant
Enter fullscreen mode Exit fullscreen mode

Create Virtual ENV

mkdir /srv/homeassistant
chown homeassistant:homeassistant /srv/homeassistant

# Change User
sudo -u homeassistant -H -s
cd /srv/homeassistant
python3 -m venv .
source bin/activate
Enter fullscreen mode Exit fullscreen mode

Install HomeAssistant And Package

python3 -m pip install wheel
pip3 install homeassistant
Enter fullscreen mode Exit fullscreen mode

Use hass To Start HA Process

hass
Enter fullscreen mode Exit fullscreen mode

Use Browser Visit http://ha:8123

Trouble Shoot

If You Get When You Run hass

(homeassistant) homeassistant@raspberrypi:~ $ hass
Traceback (most recent call last):
  File "/srv/homeassistant/bin/hass", line 10, in <module>
    sys.exit(main())
.
.
.
.
ImportError: cannot import name 'contextfilter' from 'jinja2' (/srv/homeassistant/lib/python3.7/site-packages/jinja2/__init__.py)
Enter fullscreen mode Exit fullscreen mode

Sulotions

(homeassistant) homeassistant@raspberrypi:~ $ pip uninstall jinja2
Uninstalling Jinja2-3.1.1:
  Would remove:
    /srv/homeassistant/lib/python3.7/site-packages/Jinja2-3.1.1.dist-info/*
    /srv/homeassistant/lib/python3.7/site-packages/jinja2/*
Proceed (y/n)? y
  Successfully uninstalled Jinja2-3.1.1
(homeassistant) homeassistant@raspberrypi:~ $ pip install jinja2==3.0.3
Enter fullscreen mode Exit fullscreen mode

Hot sauce if you're wrong - web dev trivia for staff engineers

Hot sauce if you're wrong · web dev trivia for staff engineers (Chris vs Jeremy, Leet Heat S1.E4)

  • Shipping Fast: Test your knowledge of deployment strategies and techniques
  • Authentication: Prove you know your OAuth from your JWT
  • CSS: Demonstrate your styling expertise under pressure
  • Acronyms: Decode the alphabet soup of web development
  • Accessibility: Show your commitment to building for everyone

Contestants must answer rapid-fire questions across the full stack of modern web development. Get it right, earn points. Get it wrong? The spice level goes up!

Watch Video 🌶️🔥

Top comments (0)

Image of Timescale

PostgreSQL for Agentic AI — Build Autonomous Apps on One Stack ☝️

pgai turns PostgreSQL into an AI-native database for building RAG pipelines and intelligent agents. Run vector search, embeddings, and LLMs—all in SQL

Build Today

👋 Kindness is contagious

Engage with a wealth of insights in this thoughtful article, valued within the supportive DEV Community. Coders of every background are welcome to join in and add to our collective wisdom.

A sincere "thank you" often brightens someone’s day. Share your gratitude in the comments below!

On DEV, the act of sharing knowledge eases our journey and fortifies our community ties. Found value in this? A quick thank you to the author can make a significant impact.

Okay