Session:Creating Z-Wave controllers and devices
From 36C3 Wiki
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, iot |
Person organizing | PoltoS |
Language | en - English, fr - French, ru - Russian |
Other sessions...
|
(Click here to refresh this page.)
Subtitle | !! Room has changed !! |
---|---|
Starts at | 2019/12/27 18:00 |
Ends at | 2019/12/27 19:30 |
Duration | 90 minutes |
Location | Assembly:CriticalDecentralisationCluster |
Subtitle | !! Room changed to CDC Assembly !! |
---|---|
Starts at | 2019/12/28 14:00 |
Ends at | 2019/12/28 15:30 |
Duration | 90 minutes |
Location | Assembly:CriticalDecentralisationCluster |
Starts at | 2019/12/29 14:00 |
---|---|
Ends at | 2019/12/29 15:30 |
Duration | 90 minutes |
Location | Assembly:CriticalDecentralisationCluster |
Starts at | 2019/12/29 18:00 |
---|---|
Ends at | 2019/12/29 19:30 |
Duration | 90 minutes |
Location | Assembly:CriticalDecentralisationCluster |
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 - make sure to install 2.1.6 from repo http://z-uno.z-wave.me/files/z-uno/test-ucxx/package_z-wave.me_index.json)
- 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)
Contents
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
- Controller (EU, 868 MHz)
- Smart Home UI http://http://151.217.65.47/:8083
- Expert UI http://http://151.217.65.47/:8083/expert
- or WiFi SSID RPi-xxxx / PSK: mmltlEO5 / http://192.168.115.1:8083/
- Smart Home User: admin / Password: ccc-2019
Z-Way documentation
- Installing Z-Way https://z-wave.me/z-way/download-z-way/
- Z-Way doc https://z-wave.me/essentials
- Z-Way JS engine GitHub https://github.com/Z-Wave-Me/home-automation/
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
- Quick Intro https://z-uno.z-wave.me/getting-started/quick-introduction-in-z-uno/
- Installation howto https://z-uno.z-wave.me/install
- Language Reference https://z-uno.z-wave.me/reference/
- Examples https://z-uno.z-wave.me/examples/
- Z-Uno Shield https://z-uno.z-wave.me/shield/
- Z-Uno Shield Configurator https://z-uno.z-wave.me/shield/configurator/
- Z-Uno GitHub https://github.com/Z-Wave-Me/Z-Uno-Core/
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/test-ucxx/package_z-wave.me_index.json
- Tools -> Board -> Board Manager -> Z-Uno 2.1.6
- 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; }