Zwave power metering into Node-red

Getting started

In this tutorial we will go through how to make a custom z-wave controller using a raspberry pi with a Razberry card. Then we will collect data from one or more Fibaro meter plugs and get the data into Node-red.

Hardware and software needed

Download the Image for Razberry.

Download link: Razberry Image. We need to flash one of the SD cards with this install first so we can configure and associate the Fibaro plugs with the Razberry card. More info about Razberry can be found on their homepage.

Write the Razberry image to the Micro SD card

Download and use Pi filler (Mac) or Image Writer (PC).

On Mac start without the SD card inserted, start Pi filler, select image and follow instructions.

In Windows you will probably need to run as Administrator. Choose image and your SD card, hit the Write button.

Here is even a link to a tutorial from the people behind Razberry.

Run the Pi with the Razberry install

Insert the Micro SD your just installed Razberry on into the Pi. Connect it to power (miscro usb) and to your local network with a lan cable. If everything is done correctly you should after 1 minute be able to go to https://find.z-wave.me and find the ip address/link of your Z-wave Smart Home Interface.

Login with: admin and use the password: admin

Add Fibaro meter plug

Click in the top-right corner on the settings icon, then select Devices. Next select Z-wave and +Add new, Fibaro Icon, choose to Include device: Fibaro Metering Wall Plug. Before you start the inclusion which adds a Fibaro Plug to the Razberry card you will need to put it in factory reset mode. How to do this can be seen in this Youtube movie from Fibaro.. Once that is done you can hit the green "Start inclusion" button.

If it says "Device found but the configuration is not complete" and a green "Retry" button. Ignore this. Click "Elements" in the top menu. You should be able to see that the plug has been added. Check that it works by altering the state of the red Fibaro Group (2.0) Switch.

If you have more plugs you would like to add, repeat the same process as above.

Download the Image for the Raspberry Pi.

Download link: Op-en.se Raspberry Pi image. The image is based on the HypriotOS 1.0.0 "Blackbeard" image for Raspberry Pi. Read more about Hypriot. The disk image runs these docker containers:

  • openenergy/rpi-node-red:zwave
  • sbiermann/mosquitto
  • sbiermann/rpi-influxdb
  • openenergy/rpi-app-sever
  • akkerman/rpi-nginx
Write the op-en-zwave-rpi.img file to a Micro SD.

Repeat the process like you did with the Razberry image. When done insert it into the Raspberry Pi, connect lan cable and power it up.

Connecting the Raspberry Pi to the internet.

Connect the Pi to the local network/internet via a lan cable. It should appear in the network with the hostname: "op-en-se-zwave". Get the ip address of the pi. Use Putty or Terminal to access it by typing:

ssh pirate@192.168.xxx.xxx (xxx = ip adress of the Pi inside your local network, while pirate is the username) password: hypriot

You should now be logged in and if you want the Pi to connect via Wifi edit the "device-init.yaml" file by typing:

sudo nano /boot/device-init.yaml

Change the hostname if you like and add your Wifi's SSID and Password. When your done press CTRL+X, then press SHIFT+Y and hit ENTER.

Type sudo reboot

Get the Docker containers up and running

When the Raspberry Pi is done rebooting.

Login in via ssh: ssh pirate@192.168.xxx.xxx

Password: hypriot

Check and see which docker processes are running by typing:

docker ps If nothing comes up: cd /playground/rpi/ and then

sudo docker-compose.yml up -d Now you should see the docker containers beeing started. sudo docker ps again, and this time you should be able to see something like this. Now the docker containers are up and running and we can go into the Node-red interface and see check out the zwave data. This is done by entering 192.168.xxx.xxx:1880 in your browser.

If you connect an electrical device to your Fibaro plug you should be able to see the data coming into the debug tab of Node-red.