123
make.co
Screena logical collection of devices, and
could have reasonably been called a “Room” or
“Location.” Each screen is displayed on its own
web page and is associated with VLights and
Settings.
VLighta collection of Z-Wave devices that
are addressed together. For example, there are
four smart ceiling lights in the family room that
are controlled by a single switch and should
always be on/off/dimmed together — these are
collected into a single VLight.
Settinga list of VLights and values that
together put lights into a useful configuration.
E.g., the “Movie” setting dims the lights in the
family room and turns off all of the lights on the
periphery, while “Cooking” turns all the lights
in the kitchen to their brightest levels.
All of this is described in a JSON configuration file
defined by the Server.Cong class. You can see
a sample configuration in example-server.json that
exposes the service on port 7071 (Figure
I
).
Using the same binaries you built earlier, fire
up the server with the following command, which
starts it up in the background and saves any log
output to PATHTOLOG:
nohup java
-cptarget/zwave-1.0-SNAPSHOT-jar-
with-dependencies.jar
com.shutdownhook.zwave.Server
PATHTOCONFIG>>PATHTOLOG&
Each screen displays its Settings (plus “on” and
“off” which do the obvious) as pushbuttons, and
each VLight as a slider. Pressing a Settings button
sets all of its VLights to the appropriate levels;
sliding a slider sets the brightness of all the
devices within that VLight (including 0 which turns
the device off). No muss, no fuss, but extremely
usable for my purposes. Voilà!
What Next?
Remember that in my scenario all the devices
are dimmable lights, so the UX will need some
updates as I include other device types. And while
using the phone to control the lights is great, it’s
just a start. Check out the links below to learn
how to voice-enable your gateway with Alexa
and add motion detection to turn the lights on
or off based on presence. That’s one of the best
things about building for yourself; once you know
how things work under the covers, tweaking
them to fit your unique needs becomes pretty
straightforward. Making is magic!
RESOURCES:
Project code from this article (and more): github.
com/seanno/shutdownhook/tree/main/zwave
Article series on my blog, ShutdownHook:
“Z-What? Rescuing my Z-Wave smart lights
shutdownhook.com/2021/10/30
Alexa, ask Bellevue House…”
shutdownhook.com/2021/11/04
“Can you see me now?”
shutdownhook.com/2021/11/11
RaZberry and Z-Way:
RaZberry product information:
z-wave.me/products/razberry
RaZberry installation and Z-Way manual:
z-wave.me/z-way/download-z-way
Pre-configuring Wi-Fi on a headless Raspberry
Pi : raspberrypi.com/documentation/computers/
configuration.html
Z-Wave protocol and alternative development
options:
Z-Wave official site: z-wave.com
Silicon Labs SDK:
silabs.com/wireless/z-wave?tab=software
OpenZWave: openzwave.com
Z-Wave JS: github.com/zwave-js
I
M83_118-23_SB_Z-Wave_F1.indd 123M83_118-23_SB_Z-Wave_F1.indd 123 10/11/22 12:17 PM10/11/22 12:17 PM
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset