Remember ssh file to allow ssh without screen Update:
sudo apt-get update
sudo apt-get upgrade
Timezone:
apt-get install ntpdate
sudo /etc/init.d/ntp stop
sudo ntpd -q -g
sudo /etc/init.d/ntp start
sudo cp /usr/share/zoneinfo/Europe/Copenhagen /etc/localtime
sudo apt-get install python3 python3-venv python3-pip
sudo pip3 install homeassistant
Create secrets.yaml Generate ssl key (openssl req -new -x509 -sha256 -newkey rsa:4096 -nodes -keyout privkey.pem -days 730 -out fullchain.pem)
sudo apt-get install cython3 libudev-dev python3-sphinx python3-setuptools git
sudo pip3 install --upgrade cython==0.24.1
git clone https://github.com/OpenZWave/python-openzwave.git
cd python-openzwave
git checkout python3
PYTHON_EXEC=$(which python3) make build
sudo PYTHON_EXEC=$(which python3) make install
apt-get install libgnutls28-dev libgnutlsxx28
wget ftp://ftp.gnu.org/gnu/libmicrohttpd/libmicrohttpd-0.9.19.tar.gz
tar zxvf libmicrohttpd-0.9.19.tar.gz
mv libmicrohttpd-0.9.19 libmicrohttpd
cd libmicrohttpd
./configure
make
sudo make install
cd
git clone https://github.com/OpenZWave/open-zwave.git
cd open-zwave
make
cd
git clone https://github.com/OpenZWave/open-zwave-control-panel.git
cd open-zwave-control-panel
Modify make file
OPENZWAVE := ../open-zwave
LIBMICROHTTPD := /usr/local/lib/libmicrohttpd.a
Note that you may modify some more in the configuration file
sudo apt-get install nmap
sudo apt-get install pure-ftpd
# Links
sudo ln -s /srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/libopenzwave-0.3.2-py3.4-linux-armv7l.egg/config /srv/homeassistant/src/open-zwave-control-panel/config
sudo ln -s /home/homeassistant/.homeassistant/zwcfg_0xcc97b170.xml /srv/homeassistant/src/open-zwave-control-panel/zwcfg_0xcc97b170.xml
#Start control panel
cd /srv/homeassistant/src/open-zwave-control-panel/
sudo systemctl stop home-assistant.service
sudo ./ozwcp -p 8888
#Start home assistant
sudo systemctl start home-assistant.service
sudo pm2 startup systemd -u
https://home-assistant.io/components/recorder/ Install
# My SQL Server
sudo apt-get install mysql-server --fix-missing
sudo apt-get install python-mysqldb
sudo apt-get install && sudo pip3 install mysqlclient
sudo nano /etc/mysql/my.cnf - change bind-address to 0.0.0.0
sudo service mysql restart
mysql -uroot -hlocalhost -p
SQL Commands:
CREATE DATABASE homeassistant;
SET PASSWORD FOR 'root'@'localhost' = PASSWORD('');
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '' WITH GRANT OPTION;
FLUSH PRIVILEGES;
edit configure file and add this code:
--my-mqtt-user=) CPPFLAGS="-DMY_MQTT_USER=\"${optarg}\" $CPPFLAGS" ;; --my-mqtt-password=) CPPFLAGS="-DMY_MQTT_PASSWORD=\"${optarg}\" $CPPFLAGS" ;; after this code:
--my-signing-request-gw-signatures-from-all*) signing_request_signatures=true CPPFLAGS="-DMY_SIGNING_GW_REQUEST_SIGNATURES_FROM_ALL $CPPFLAGS" ;; this is about 408 number line
./configure --my-gateway=mqtt --my-controller-ip-address=127.0.0.1 --my-mqtt-publish-topic-prefix=mysensors-out --my-mqtt-subscribe-topic-prefix=mysensors-in --my-mqtt-client-id=mygateway1 --my-mqtt-user=mysensors --my-mqtt-password= --my-transport=nrf24 --my-rf24-irq-pin=15
sudo systemctl start mysgw.service
./bin/mysgw -d
start, stop: /etc/init.d/mosquitto start|stop debug: /usr/sbin/mosquitto -c /etc/mosquitto/mosquitto.conf
password: mosquitto_passwd -b pwfile mysensors
- Install homebridge
- cd. /usr/local/lib/node_modules
- sudo git clone https://github.com/sorenhl/homebridge-homeassistant
- cd homebridge-homeassistant && sudo npm install
- cp homebridge/config-sample.json /home/pi/.homebridge/config.json
- Copy from https://github.com/sorenhl/homebridge-homeassistant and remember to add dino.heidelarsen.dk in /etc/hosts to allow SSL certificate
- pm2 start /usr/local/bin/homebridge -n Homebridge"
sudo shutdown -h now sudo su -c '/srv/homeassistant/homeassistant_venv/bin/hass --script check_config' homeassistant