Friday, August 30, 2019

Smart Home Edge Device Setup and Configuration

In the previous blog I listed down few edge devices and software packages and its specifications/features. In this blog I will explain the configuration steps before the sensors /thermostats /actuators will all communicate with OpenHab edge hub. 


Before I go into the details of how the devices are configured I would like to give you a system diagram with devices /components overlay.




Step 1. 



Installing Openhab

I used the instructions available on the site https://www.openhab.org/download/

  1. Add the repository key
  2. wget -qO - 'https://bintray.com/user/downloadSubjectPublicKey?username=openhab' | sudo apt-key add -
  3. Add the HTTPS transport for APT
  4. sudo apt-get install apt-transport-https
  5. Add the repository
  6. echo 'deb https://dl.bintray.com/openhab/apt-repo2 stable main' | sudo tee /etc/apt/sources.list.d/openhab2.list
  7. Update the package lists and install the openHAB distribution package
  8. sudo apt-get update && sudo apt-get install openhab2
  9. (Optional) Install the add-ons for offline use
  10. 🛈 You don't need the add-ons package if your machine has Internet access, openHAB will download add-ons online as necessary.
    sudo apt-get install openhab2-addons
  11. Navigate with a web browser to http://<ip-address>:8080
  12. Continue by following the First-time setup chapter of the New User Tutorial



Step 2. 



Z Wave Installation

To enable RaspberryPI to receive z wave messages from the door sensor we need plug the z-wave adaptor and install open z-wave control panel
To install the driver for receiving the z-wave and the control panel to manage the devices that listen to z-wave can be found here
https://lickthesalt.com/2016/04/11/compiling-open-zwave-control-panel-on-a-raspberry-pi-3/

Initialise  door sensor z-wave virtual device to receive messages from door sensor 
To configure a new device to listen to z-wave communication follow steps below . The process will initialise Z wave in open-zwave-controller.
  1. Stop HA - sudo service hass-daemon stop
  2. Confirm HA has stopped - sudo service hass-daemon status -1
  3. Start OZWCP
  4. cd open-zwave-control-panel
  5. sudo ./ozwcp -p 8888
  6. Open OZWCP your ip:8888
  7. Enter /dev/ttyACM0 into device field and click initialize button
  8. DONT NOT TICK THE USB CHECK BOX
  9. Check the driver path before you run the initiate
  10. You need to make sure that to reset the door sensor by pressing the reset button after having removed the batteries. Put the batteries on After resetting.
  11. Press the activation button three times in 1.5 seconds and take the sensor close to the controller
  12. Once the devices gets activates and added to the controller, kill the open-zwave-controller application
  13. Start Openhab application and add z-wave binding

Step 3. 



MQTT broker installation


MQTT messages are created using openhab binders for MQTT. This allows just to convert the messages from Z-wave devices into MQTT messages.

You can install the Mosquito Raspberry PI package using this link http://www.instructables.com/id/Installing-MQTT-BrokerMosquitto-on-Raspberry-Pi/

To setup MQTT messages using openhab, please use the link below.





Step 4



Openhab z-wave binder installation. 

Openhab does not necessarily bundle zwave binding that works with the HS1DS-Z HEIMAN door sensor. You can use kafar console to update the zwave binding. Below step helps you do just that.
  1. Install z-wave binding via paper ui
  2. Go to karaf console and uninstall the binding via console
  3. Search for the zwave binding. In my case it had id 198
  4. Uninstall the binding using this id
  5. Install newest snapshot got to '/usr/share/openhab2/addons' (if you installed with apt-get)
  6. cd /usr/share/openhab2/addons
  7. run command sudo wget https://openhab.ci.cloudbees.com/job/openHAB2-Bundles/lastSuccessfulBuild/artifact/bindings/org.openhab.binding.zwave/target/org.openhab.binding.zwave-2.0.0-SNAPSHOT.jar
  8. restart openhab sudo /bin/systemctl restart openhab2.service


Step 5



Openhab Energine binder 

Follow similar steps like above to install the Energine e-TRV binders.
The binder can be found at this site 

Step 6. 



Fire up openhab and using the paper UI ,  discover and configure the zwave adapter, door sensors and e-trv's. 





Next Steps

Once the installation and configuration are complete, you will be able to receive MQTT message from openhab in regular intervals set via mosquito configuration. 




In my next set of  blogs, I will discuss about how the messages are configured and how the whole architecture differs from  WOO reference architecture. 

2 comments:

  1. Thanks for sharing this wonderful knowledge about smart home. If you are looking for a professional company who offer services for SMART HOME SG Singapore, then you must choose FuturaHaus. We provide smart home services in All Singapore at reliable prices. To explore more about us Visit our website now!

    ReplyDelete
  2. Thanks for sharing this amazing knowledge about smart home. If you are looking for a professional company who offer services for SMART HOME SINGAPORE, then you must choose FuturaHaus.

    ReplyDelete

Smart Home Edge Device Setup and Configuration

In the previous blog I listed down few edge devices and software packages and its specifications/features. In this blog I will explain the c...