Search documentation of grizzly

# View Source Grizzly.Node (grizzly v7.4.2)

Functions for working directly with a Z-Wave node

# Summary

## Types

id()
info_opt()

Options to use when getting device info.

lifeline_opts()
opt()

## Functions

get_dsk(node_id, add_mode, opts \\ [])

Get a node's dsk.

get_info(node_id, opts \\ [])

Get the information for a node by its id

get_lifeline_association(node_id)

Get the lifeline association group for a node.

get_statistics(node_id)

Gets a node's statistics from Z/IP Gateway.

set_lifeline_association(node_id, opts \\ [])

Set lifeline association for the node

# Types

Link to this type

# id()

View Source

    @type id() :: non_neg_integer()

Link to this type

# info_opt()

View Source

    @type info_opt() :: {:force_update, boolean()} | info_opt()

Options to use when getting device info.

- `:force_update` - By default there is a cache managed by `zipgateway` that tracks the device information. Sometimes that can get out of date, so you can pass `[force_update: true]` to force the cache to update the device info. By default this is `false`

Link to this type

# lifeline_opts()

View Source

    @type lifeline_opts() ::
      {:controller_id, Grizzly.ZWave.node_id()}
      | {:extra_node_ids, [Grizzly.ZWave.node_id()]}

Link to this type

# opt()

View Source

    @type opt() :: {:seq_number, integer()} | {:timeout, non_neg_integer()}

# Functions

Link to this function

# get_dsk(node_id, add_mode, opts \\ [])

View Source

    @spec get_dsk(Grizzly.ZWave.node_id() | :gateway, :add | :learn, [
      Grizzly.command_opt()
    ]) ::
      Grizzly.send_command_response()

Get a node's dsk.

The response to this command is the `DSKReport` command

Sending this command with `:gateway` will always go to your Z-Wave controller

Link to this function

# get_info(node_id, opts \\ [])

View Source

    @spec get_info(Grizzly.ZWave.node_id() | Grizzly.VirtualDevices.id(), [
      info_opt() | opt()
    ]) ::
      Grizzly.send_command_response()

Get the information for a node by its id

The response to this command is the `NodeInfoCacheReport` command

Link to this function

# get_lifeline_association(node_id)

View Source

    @spec get_lifeline_association(Grizzly.ZWave.node_id() | Grizzly.VirtualDevices.id()) ::
      Grizzly.send_command_response()

Get the lifeline association group for a node.

Link to this function

# get_statistics(node_id)

View Source

    @spec get_statistics(Grizzly.ZWave.node_id() | Grizzly.VirtualDevices.id()) ::
      {:ok,
       Grizzly.ZWave.CommandClasses.NetworkManagementInstallationMaintenance.statistics()}
      | {:error, any()}

Gets a node's statistics from Z/IP Gateway.

Link to this function

# set_lifeline_association(node_id, opts \\ [])

View Source

    @spec set_lifeline_association(
      Grizzly.ZWave.node_id() | Grizzly.VirtualDevices.id(),
      [lifeline_opts()]
    ) ::
      Grizzly.send_command_response()

Set lifeline association for the node

The lifeline associated is used to report events that happen at the Z-Wave device level back to the Z-Wave controller. For example, if you turn on a light and want to be notified, the device will need to have it's lifeline association set.

Opts:

- `:controller_id` - the idea of the main controller to send lifeline reports to (defaults to `1`)
- `:extra_node_ids` - any extra nodes to set add to the association group