воскресенье, 9 октября 2016 г.

Emergency launch of HA on Laptop

This article describes emergency start of HA on laptop in cas if main server is unavailable

First periodic SVN commitsh should be done:
folders:
/home/pi/.node-red
/etc/openhab/configurations

Execute svn commit command
  1. Laptop should have Node-RED, Mosquitto, Openhab and all it's bindings installed and running
  2. Checkout OpenHAB Configuration and Node-RED flows from SVN
  3. Change COM port for Z-Wave stick to COM3
  4. Run Node.js and start Node-RED
  5. Insert Z-wave USB Stick(upper right port for COM3). Lower Right port will be COM4.
  6. Run start.bat in OpenHAB folder

пятница, 7 октября 2016 г.

Moqsquitto MQTT Broker Setup and usage

Install Mosquitto

sudo apt-get install mosquitto mosquitto-clients python-mosquitto
 

Configuration File location

/etc/mosquitto

mosquitto.conf File contents

pid_file /var/run/mosquitto.pid

persistence true
persistence_location /var/lib/mosquitto/
connection_messages true
log_type all
log_dest file /var/log/mosquitto/mosquitto.log
log_dest syslog

include_dir /etc/mosquitto/conf.d
 

Create /var/log/mosquitto/mosquitto_log.sh

#!/bin/bash
# My first script
sleep 120
sudo ntpdate -s ntp.obspm.fr
mkdir -p /var/log/mosquitto
mosquitto_sub -v -t /# | xargs -d$'\n' -L1 sh -c 'date "+%D %T.%3N $0"' >> /var/log/mosquitto/mosq.log &
sudo systemctl restart homebridge



 
Change permissions chmod 777 mosquitto_log.sh

Add to start script

Add to /etc/rc.local

#Start MQTT Logging
/var/log/mosquitto/msquitto_log.sh &