Session:Creating Z-Wave controllers and devices

Description Hacking around Z-Wave smart home protocol
Website(s) z-uno.z-wave.me
Type Workshop
Kids session No
Keyword(s) hardware, software
Tags z-wave, z-uno, smart home, home automation
Processing village Village:Lemanicus
Person organizing User:PoltoS
Language en - English, fr - French, ru - Russian
en - English, fr - French, ru - Russian
Related to Projects:Z-Wave
Other sessions... ... further results

Starts at 2019/08/21 16:00
Ends at 2019/08/21 17:30
Duration 90 minutes
Location Room:Hackcenter

Starts at 2019/08/22 16:00
Ends at 2019/08/22 17:30
Duration 90 minutes
Location Room:Hackcenter

Subtitle Time changed!!!!!
Starts at 2019/08/24 14:00
Ends at 2019/08/24 16:00
Duration 120 minutes
Location Room:Johnson (Workshop 1)

Hacking around Z-Wave smart home gateway based on Raspberry Pi and making your own Z-Wave device based on Z-Uno.

Please take with you

  • Your laptop with
    • Access to the internet
    • Arduino IDE installed
    • Z-Uno package installed in Arduino IDE (see https://z-uno.z-wave.me/install for details - we will help you with this during the workshop)
  • Your Raspberry Pi 3/4 with Raspbian Stretch (optional)
  • Arduino compatible sensors to build your own Z-Wave sensor (optional)
  • Your Z-Wave stuff if any (optional)

Workshop sections

  • What is Z-Wave and where should you use it
  • Z-Way controller and RaZberry/UZB hardware
    • Controlling switches
    • Reading sensor/switch values
    • Making rules
    • Using JS API
  • Z-Uno prototyping board
    • Making Simple Switch
    • Adding more stuff
  • Z-Uno Shield and Z-Uno Configurator
  • Z-Uno Modules

Usefull links for the workshop

Z-Way controllers on the workshop

Z-Way documentation

Z-Way workshop materials

  • Making rules: Settings -> Apps -> Local -> IfThen -> Add
  • Turning on/off a device /ZWaveAPI/Run/devices[NNN].SwitchBinary.Set(0 or 1)
  • Reading switch value /ZWaveAPI/Run/devices[NNN].SwitchBinary.data.level.value
  • Reading sensor value /ZWaveAPI/Run/devices[NNN].SensorBinary.data[12].level.value
  • Using JS API /JS/Run/var v = 1; setInterval(function() { zway.devices[NNN].SwitchBinary.Set(v); v = 1-v;}, 2000);

Z-Uno documentation

Z-Uno settings

Make sure to configure in Arduino IDE:

  • File -> Preferences -> Add package source URL http://z-uno.z-wave.me/files/z-uno/package_z-wave.me_index.json
  • Tools -> Board -> Board Manager -> Z-Uno 2.1.5
  • Tools -> Board -> Z-Uno
  • Tools -> Programmer -> Z-Uno
  • Tools -> Port -> /dev/ttyACM0 or /dev/ttyACM1
  • Tools -> Frequency EU/RU (depending on your controller)
  • Tools -> Security none or S0 or S2 - up to you

You might also need to add your user to dialout group to have permissions for /dev/ttyACM*

Z-Uno workshop materials

Sketch for Simple Switch:

ZUNO_SETUP_CHANNELS(ZUNO_SWITCH_BINARY(state, 0));

byte state = 0;

void setup() {
  pinMode(13, OUTPUT);
}

void loop() {
  digitalWrite(13, state ? HIGH : LOW);
}

Sketch in getter/setter style:

ZUNO_SETUP_CHANNELS(
  ZUNO_SWITCH_BINARY(getter, setter),
  ZUNO_SENSOR_BINARY_DOOR_WINDOW(doorGetter)
);

byte state = 0;
byte door = 0, lastDoor = 0xff;

void setup() {
  pinMode(13, OUTPUT);
  pinMode(18, INPUT);
}

void loop() {
  digitalWrite(13, state ? HIGH : LOW);
  
  door = digitalRead(18) == LOW ? 0xff : 0;
  if (door != lastDoor) zunoSendReport(2); // push update of channel 2
  lastDoor = door;
}

void setter(byte val) {
  state = val;
}

byte getter() {
  return state;
}

byte doorGetter() {
  return door;
}