首页 智能家居homeassistant正文

树莓派上的安装homeassistant方法一

仁镜 homeassistant 2019-11-26 21:23:46 1810 0 homeassistant智能家居

在一块仅安装了raspbian(树莓派的官方操作系统)的树莓派上,通过一条命令,下载安装启动homeassistant

curl -O https://raw.githubusercontent.com/home-assistant/fabric-home-assistant/master/hass_rpi_installer.sh && sudo chown pi:pi hass_rpi_installer.sh && bash hass_rpi_installer.sh

这条命令可以尝试一下,但一次成功概率不高(过程中碰到问题,对于新手来说会比较复杂),而且在初始的时候就装了太多不太需要的东西,建议使用常规的方法进行安装使用。

hass_rpi_installer.sh文档内容如下:

#!/usr/bin/env bash
# Home Assistant Raspberry Pi Installer Kickstarter
# Copyright (C) 2017 Jonathan Baginski - All Rights Reserved
# Permission to copy and modify is granted under the MIT License
# Last revised 1/30/2017
## Run pre-install apt package dependency checks ##
while getopts ":n" opt; do
  case $opt in
    n)
    me=$(whoami)
    
    sudo apt-get update
    
    PKG_PYDEV=$(dpkg-query -W --showformat='${Status}
' python-dev|grep "install ok installed")
    echo Checking for python-dev: $PKG_PYDEV
    if [ "" == "$PKG_PYDEV" ]; then
      echo "No python-dev. Setting up python-dev."
      sudo apt-get --force-yes --yes install python-dev
    fi
    PKG_PYPIP=$(dpkg-query -W --showformat='${Status}
' python-pip|grep "install ok installed")
    echo Checking for python-pip: $PKG_PYPIP
    if [ "" == "$PKG_PYPIP" ]; then
      echo "No python-pip. Setting up python-pip."
      sudo apt-get --force-yes --yes install python-pip
    fi
    PKG_GIT=$(dpkg-query -W --showformat='${Status}
' git|grep "install ok installed")
    echo Checking for git: $PKG_GIT
    if [ "" == "$PKG_GIT" ]; then
      echo "No git. Setting up git."
      sudo apt-get --force-yes --yes install git
    fi
    
    PKG_LIBSSL_DEV=$(dpkg-query -W --showformat='${Status}
' libssl-dev|grep "install ok installed")
    echo Checking for libssl-dev: $PKG_LIBSSL_DEV
    if [ "" == "$PKG_LIBSSL_DEV" ]; then
      echo "No libssl-dev. Setting up libssl-dev."
      sudo apt-get --force-yes --yes install libssl-dev
    fi
    PKG_LIBFFI_DEV=$(dpkg-query -W --showformat='${Status}
' libffi-dev|grep "install ok installed")
    echo Checking for libffi-dev: $PKG_LIBFFI_DEV
    if [ "" == "$PKG_LIBFFI_DEV" ]; then
      echo "No libffi-dev. Setting up libffi-dev."
      sudo apt-get --force-yes --yes install libffi-dev
    fi
    PKG_APT_LISTCHANGES=$(dpkg-query -W --showformat='${Status}
' apt-listchanges|grep "install ok installed")
    echo Checking for apt-listchanges: $PKG_APT_LISTCHANGES
    if [ "install ok installed" == "$PKG_APT_LISTCHANGES" ]; then
      echo "apt-listchanges installed. Removing."
      sudo apt-get --force-yes --yes remove apt-listchanges
    fi
sudo pip install --upgrade pip
sudo pip install --upgrade setuptools
sudo pip install pycrypto
sudo pip install cryptography
sudo pip install packaging
sudo pip install appdirs
sudo pip install six
sudo pip install fabric
    
    git clone https://github.com/home-assistant/fabric-home-assistant.git
    ( cd /home/$me/fabric-home-assistant && fab deploy_novenv -H localhost 2>&1 | tee installation_report.txt )
    exit
      ;;
    ?)
      echo "Invalid option: -$OPTARG" >&2
      ;;
  esac
done
me=$(whoami)
sudo apt-get update
PKG_PYDEV=$(dpkg-query -W --showformat='${Status}
' python-dev|grep "install ok installed")
echo Checking for python-dev: $PKG_PYDEV
if [ "" == "$PKG_PYDEV" ]; then
  echo "No python-dev. Setting up python-dev."
  sudo apt-get --force-yes --yes install python-dev
fi
PKG_PYPIP=$(dpkg-query -W --showformat='${Status}
' python-pip|grep "install ok installed")
echo Checking for python-pip: $PKG_PYPIP
if [ "" == "$PKG_PYPIP" ]; then
  echo "No python3-pip. Setting up python-pip."
  sudo apt-get --force-yes --yes install python-pip
fi
PKG_GIT=$(dpkg-query -W --showformat='${Status}
' git|grep "install ok installed")
echo Checking for git: $PKG_GIT
if [ "" == "$PKG_GIT" ]; then
  echo "No git. Setting up git."
  sudo apt-get --force-yes --yes install git
fi
PKG_LIBSSL_DEV=$(dpkg-query -W --showformat='${Status}
' libssl-dev|grep "install ok installed")
echo Checking for libssl-dev: $PKG_LIBSSL_DEV
if [ "" == "$PKG_LIBSSL_DEV" ]; then
  echo "No libssl-dev. Setting up libssl-dev."
  sudo apt-get --force-yes --yes install libssl-dev
fi
PKG_LIBFFI_DEV=$(dpkg-query -W --showformat='${Status}
' libffi-dev|grep "install ok installed")
echo Checking for libffi-dev: $PKG_LIBFFI_DEV
if [ "" == "$PKG_LIBFFI_DEV" ]; then
  echo "No libffi-dev. Setting up libffi-dev."
  sudo apt-get --force-yes --yes install libffi-dev
fi
PKG_APT_LISTCHANGES=$(dpkg-query -W --showformat='${Status}
' apt-listchanges|grep "install ok installed")
echo Checking for apt-listchanges: $PKG_APT_LISTCHANGES
if [ "install ok installed" == "$PKG_APT_LISTCHANGES" ]; then
  echo "apt-listchanges installed. Removing."
  sudo apt-get --force-yes --yes remove apt-listchanges
fi
sudo pip install --upgrade pip
sudo pip install --upgrade setuptools
sudo pip install pycrypto
sudo pip install cryptography
sudo pip install packaging
sudo pip install appdirs
sudo pip install six
sudo pip install fabric
git clone https://github.com/home-assistant/fabric-home-assistant.git
( cd /home/$me/fabric-home-assistant && fab deploy -H localhost 2>&1 | tee installation_report.txt )
exit


版权声明

1.本站大部分下载资源收集于网络,不保证其完整性以及安全性,请下载后自行测试。
2.本站资源仅供学习和交流使用,版权归资源原作者所有,请在下载后24小时之内自觉删除。
3.若作商业用途,请购买正版,由于未及时购买和付费发生的侵权行为,与本站无关。
4.若内容涉及侵权或违法信息,请联系本站管理员进行下架处理,邮箱ganice520@163.com(本站不支持其他投诉反馈渠道,谢谢合作)

本文链接:http://apod.cc/index.php/post/133.html

发表评论

评论列表(0人评论 , 1810人围观)
☹还没有评论,来说两句吧...