Rasberry Pi, Z-Wave and Domoticz: Setup Part 2
This article is about using Z-Wave with a Raspberry Pi. Z-Wave and ZigBee are the two big wireless players in the Home Automation automation market. A single z-wave wireless controller can communicate with a large number of devices. These devices include outlet switches, power meters, alarm sensors, remote controlled light bulbs and other accessories.
The USB stick on the left is a Z-Wave Z-Stick S2 that acts as an interface between a computer and a network of wireless devices. It can be controlled via COTS software open source libraries like openzwave. The outlet on the right is a Z-Wave wireless controlled outlet that reports back power consumption and state.
I received this controller / switch pair at the Microsoft Build conference a couple years back. They were one of the "prizes" you could buy when you earned conference credits for running through the labs. I really had no idea what they were for a couple years until I took the time to do some research.
The Raspberry Pi can be an ideal Home Automation host that lets people use web interfaces or mobile apps to control devices via the USB Z-Wave controller. I recommend using the Raspberry Pi 3 as a control device because it has the most capacity headroom.
The picture at the right is a Raspberry Pi V1 Running Domoticz Home Automation software with a Z-Wave USB control dongle and a PiFace digital I/O daughter board.
A Z-Wave stick control dozens of wireless devices. The PiFace Digital I/O daughter-board supports direct connection of up to 8 digital input and 8 digital output devices.
The USB stick on the left is a Z-Wave Z-Stick S2 that acts as an interface between a computer and a network of wireless devices. It can be controlled via COTS software open source libraries like openzwave. The outlet on the right is a Z-Wave wireless controlled outlet that reports back power consumption and state.
I received this controller / switch pair at the Microsoft Build conference a couple years back. They were one of the "prizes" you could buy when you earned conference credits for running through the labs. I really had no idea what they were for a couple years until I took the time to do some research.
The Raspberry Pi can be an ideal Home Automation host that lets people use web interfaces or mobile apps to control devices via the USB Z-Wave controller. I recommend using the Raspberry Pi 3 as a control device because it has the most capacity headroom.
The picture at the right is a Raspberry Pi V1 Running Domoticz Home Automation software with a Z-Wave USB control dongle and a PiFace digital I/O daughter board.
A Z-Wave stick control dozens of wireless devices. The PiFace Digital I/O daughter-board supports direct connection of up to 8 digital input and 8 digital output devices.
About Domoticz
Domoticz is an open source Home Automation dashboard that can be installed on a Raspberry Pi. It is one of several automation platforms that run on the Raspberry Pi under Linux. Domoticz supports dozens of automation hardware controllers, Z-Wave, hardware boards, LAN based controllers, etc. Each controller can manage one or multiple individual devices, depending on the controller type and the device type.it. Each device can have multiple switches, monitors, outputs or inputs.
Domoticz provides a web interface that can configure new hardware (controllers), identify associated devices and their features. Those mappings are then managed and controlled through a set of dashboards.
Main Menu
The Domoticz consists of 3 main parts
- Setup: The main utility menu with some interesting sub menus.
- Hardware: Attached controllers like the ZWave USB stick or a PiFace.
- Devices: Controlled endpoints like switches and utility monitors.
- Configured Devices
- Switches: Exactly what it sounds like
- Temperature: Thermometers.
- Weather: Weather stations
- Utility: power and current monitoring
- Dashboard: Unified view across types
Installation Preconditions
- You have a Raspberry Pi running the standard Raspberry Pi O/S. I installed the full version mostly because I'm too lazy to put together the thinnest custom pac
- kage needed.
- You have a Z-Wave controller stick or add on board for the Raspberry Pi.
- Your Z-Wave controller is paired with one or more devices. There are instructions online that show how to pair devices with out using a computer.
- Your Raspberry Pi has an internet connection that can be used to install and update software.
- Your Raspberry Pi has had all updates installed.
- Decide if you want the Raspberry Pi to use static or dynamic IP addresses. The Domoticz wiki recommends static IPs to make the web UI easier to find. The system will work with either.
Installing Domoticz
I tend to use an HDMI display for this but you could do everything through SSH or command line instead. You need to know the Raspberry Pi's IP address. Either set a static IP, use some type of dynamic DNS or look up the address on the screen hooked to the Pi's HDMI port.
- Plug the Z-Stick into a USB port on the Raspberry Pi.
- The "first" Z-Stick is accessible via device /dev/ttyUSB0 .
- Install Domoticz using the Domoticz project guide. Use "the easy way". The installer will most of the heavy lifting. You don't have to manually compile anything.
- The recommended install command looks something like
sudo curl -L install.domoticz.com | sudo bash - Record the URL provided at the end of the installation process. That is the web address of the Domoticz Admin page.
- Connect to Domoticz using the address from you got at the end of the installation. My Raspberry on a dynamic IP can currently reached with the following
- http://192.168.1.123:8080/#/Dashboard
Configuring Z-Wave
Hardware Controllers
Lets configure a Z-Wave stick hardware device in Domoticz and identify device nodes like switches and outlets.
- Connect to Domoticz with with your web browser using the URL found above. Your screen should look like that:
- Click on the "setup your Hardware" link.
- This will take you to the "Nodes" screen where you can see devices controlled by this Z-Wave stick. The picture below shows two digital switches and their controller. These particular switch "nodes" are multi-function. We will see later that they can measure power usage in addition to acting as switches.
Controlled Devices
We next add the switches and other controlled nodes to the their appropriate sections.
- Add the functions to the appropriate Domoticz panel, Switch, Temperature, Weather or Utility by clicking on the green arrow on the right hand side of that device's row. Domoticz will automatically select the correct menu. The green arrows will turn to blue arrows for functions/features that have been enabled in the GUI
- Enter the name of the device in the panel that pops up after clicking on the green arrow.I took the default settings in this picture.
- Click on the Switches main menu item. You should see the just-added switches in the panel. Switches are operated by clicking on the light bulb icon.
Accessing a Switch
The previous sections configured a switch socket. That device can be enabled and disabled in the GUI via- Setup-->Devices
- In the Switches menu
- In the Dashboard
Useful links
- Install the Linix OS
- https://www.raspberrypi.org/documentation/installation/installing-images/windows.md
- https://www.raspberrypi.org/downloads/raspbian/
- Install Domoticz
- https://www.domoticz.com/wiki/Installing_and_running_Domoticz_on_a_Raspberry_PI
- Open Z-Wave library
- https://github.com/openzwave/
- blah blah blah
Comments
Post a Comment