mattludwigs
Grizzly - Z-Wave Library for Elixir
Grizzly is a library for working with Z-Wave devices. Z-Wave is a low-frequency radio protocol for controlling smart home devices on a mesh network. Grizzly leverages Z-Wave over IP (Z/IP) to communicate to Z-Wave devices via DTLS. Grizzly provides complete support for the various Z-Wave security groups, extensible device behavior, and reliable error isolation between device behaviors.
Hardware requirements are:
To get up and running fast with a raspberry pi 3 check out the grizzly quickstart.
The zipgateway binary will need to be cross-compiled for your target. This can be a bit tricky, so if you need help with this part of the setup process please reach out on the forum by using the grizzly tag.
Z-Wave is a complex protocol with many moving parts and pitfalls. We hope that Grizzly provides a simple API for handling these complexities. As home automation and IoT grows in popularity we are excited to help the Elixir ecosystem provide reliable solutions to hard problems in this space.
If you have questions please feel free to reach out on the forum using the grizzly tag.
Special thanks to SmartRent for their support in open sourcing Grizzly!
Happy IoT hacking!
Trending in Announcing
Other Trending Topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #elixirconf-us
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #metaprogramming
- #performance
- #security










First Post!
tielur
Yay! I can’t wait to try it out! Big thanks to @mattludwigs and the entire SmartRent team!
Most Liked
mattludwigs
v0.8.0!
Adds support for handling SmartStart meta extension fields.
These fields give more information about the current status, inclusion methods,
and product information for the SmartStart device.
There are two breaking changes:
Grizzly.CommandClass.NodeProvisioningnamespace into the
Grizzly.SmartStart.MetaExtensionnamespace.previously supported meta extensions worked. Namely, we added a
new/1callback that does parameter validation, and returns
{:ok, MetaExtension.t()}.This breaks the previous behaviour of
to_binary/1functions in previouslyimplemented meta extensions.
meta_extensionsfield toGrizzly.CommandClass.NodeProvisioningcommands that can handle meta extensions
Grizzly.Conn.Server.ConfigdocsTimecommand offset valuesThank you to those who contributed to this release:
mattludwigs
v0.8.1!
no match error that propagated up the supervision tree
Thank you to those who contributed to this release:
mattludwigs
v0.9.0-rc.0
This is release is a massive rework of the entire API and internal works of Grizzly. Please see the release notes for more details as there are a number of breaking changes.
The reasons for this was to provide a better API, better startup times, more robustness with the runtime, and hopefully better long term maintenance. Grizzly does a lot in the way to handle the sequencing of commands the lifecycle of sending and receiving them. Some of this a little complex and was hard to test. Now, while still a little complex, these sections of the code that had a higher risk for regressions are not built in such a way that we can test them. This makes maintaining and releasing code much less low risk.
Also, we did not use OTP in such a way to provide a self-healing system in areas that would greatly benefit from that. With this release all that has better supervision, meaning that the underlining Z-Wave communication should never get into a state that isn’t self-healing. This is very important for embedded devices as they should be able to run indefinitely without human interaction and having a self-healing system is key to achieving this.
For more detailed guide to the breaking changes and how to upgrade please see
our Grizzly v0.8.0 → v0.9.0 guide.
This release presents a simpler API, faster boot time, more robustness in Z-Wave communication,
and resolves all open issues on Grizzly that were reported as bugs.
Removed APIs
Grizzly.NodestructGrizzly.ConnmoduleGrizzly.NotificationsmoduleGrizzly.PacketmoduleGrizzly.close_connectionGrizzly.command_class_versions_known?Grizzly.update_command_class_versionsGrizzly.start_learn_modeGrizzly.get_command_class_versionGrizzly.has_command_classGrizzly.connected?Grizzly.has_command_class_namesGrizzly.configGrizzly.Network.busy?Grizzly.Network.ready?Grizzly.Network.get_stateGrizzly.Network.set_stateGrizzly.Network.get_nodeGrizzly.Node.newGrizzly.Node.updateGrizzly.Node.put_ipGrizzly.Node.get_ipGrizzly.Node.connectGrizzly.Node.disconnectGrizzly.Node.make_configGrizzly.Node.has_command_class?Grizzly.Node.connected?Grizzly.Node.command_class_namesGrizzly.Node.update_command_class_versionsGrizzly.Node.get_command_class_versionGrizzly.Node.command_class_version_known?Grizzly.Node.update_command_classGrizzly.Node.put_associationGrizzly.Node.get_association_listGrizzly.Node.configure_associationGrizzly.Node.get_network_informationGrizzly.Node.initialize_command_versionsMoved APIs
Grizzly.reset_controller→Grizzly.Network.reset_controllerGrizzly.get_nodes→Grizzly.Network.get_node_idsGrizzly.get_node_info→Grizzly.Node.get_node_infoGrizzly.Notifications.subscribe→Grizzly.subscribe_commandandGrizzly.subscribe_commandsGrizzly.Notifications.unsubscribe→Grizzly.unsubscribeGrizzly.add_node→Grizzly.Inclusions.add_nodeGrizzly.remove_node→Grizzly.Inclusions.remove_nodeGrizzly.add_node_stop→Grizzly.Inclusions.add_node_stopGrizzly.remove_node_stop→Grizzly.Inclusions.remove_node_stopGrizzly.Client→Grizzly.TransportGrizzly.Security→Grizzly.ZWave.SecurityGrizzly.DSK→Grizzly.ZWave.DSKGrizzly.Node.add_lifeline_group→Grizzly.Node.set_lifeline_associationWe moved all the commands and command classes to be under the the
Grizzly.ZWavemodule namespace and refactored the command behaviour.Grizzly.send_commandChangesThe main API function to Grizzly has changed in that it only takes a node id,
command name (atom), command args, and command options.
Also it no longer returns a plain map when there is data to report back from
a Z-Wave node but it will return
{:ok, %Grizzly.ZWave.Command{}}.Please see
GrizzlyandGrizzly.ZWave.Commanddocs for more information.Connections
Grizzly uses the
zipgatewaybinary under the hood. The binary has its ownnetworking stack and provides a DTLS server for us to connect to. Prior to
Grizzly v0.9.0 we greatly exposed that implementation detail. However, starting
in Grizzly v0.9.0 we have hidden that implementation detail away and all
connection functionally is handle by Grizzly internally. This leaves the
consumer of Grizzly to just work about sending and receiving commands.
If you are using
%Grizzly.Conn{}directly this is no longer available and youshould upgrade to just using the node id you were sending commands to.
When Grizzly is Ready
We use to send a notification to let the consumer to know when Grizzly is
read. Staring in v0.9.0 the consumer needs to configure Grizzly’s runtime
with the
on_readymodule, function, arg callback.See
Grizzly.Runtimefor more detailsInclusion Handler Behaviour
Adding and removing a Z-Wave node can be a very interactive process that
involves users being able to talk to the including controller and device. The
way Grizzly < v0.9.0 did it wasn’t vary useful or robust. By adding the the
inclusion handler behaviour we allow the consumer to have full control over the
inclusion process, enabling closer to Z-Wave specification inclusion process.
See
Grizzly.InclusionHandlerandGrizzly.Inclusionsfor more information.Command Handler Behaviour
If you need to handle a Z-Wave command lifecycle differently than the default
Grizzly implementation you can make your own handler and pass it into
Grizzly.send_commandas an option:See
Grizzly.CommandHandlerfor more information.Supporting Commands
At the point of the
rc.0release are not fully 100% supporting the samecommands as in < v0.8.8, but we are really close. The commands that we haven’t
pulled over are not critical to average Z-Wave device control. We will work to
get all the commands back into place.
Thank you to Jean-Francois Cloutier for contributing so much to this release.
Last Post!
mattludwigs
v0.15.10
Added
when querying extra supported command classes.
Fixed
WakeUpNoMoreInformationcommand nameThank you to those who contributed to this release: