From b036d67d203e0e5fbcafd6041282ae00e2e38ae8 Mon Sep 17 00:00:00 2001 From: Raman Gupta <7243222+raman325@users.noreply.github.com> Date: Mon, 14 Jun 2021 16:39:43 -0400 Subject: [PATCH] Document zwave_js.ping service (#18196) --- source/_integrations/zwave_js.markdown | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/source/_integrations/zwave_js.markdown b/source/_integrations/zwave_js.markdown index 4a73a5babc9..91f1852701e 100644 --- a/source/_integrations/zwave_js.markdown +++ b/source/_integrations/zwave_js.markdown @@ -220,6 +220,31 @@ This service will set a value on a Z-Wave device. It is for advanced use cases w | `value` | yes | The new value that you want to set. | | `wait_for_result` | no | Boolean that indicates whether or not to wait for a response from the node. If not included in the payload, the integration will decide whether to wait or not. If set to `true`, note that the service call can take a while if setting a value on an asleep battery device. | +### Service `zwave_js.ping` + +Calling this service forces Z-Wave JS to try to reach a node. This can be used to update the status of the node in Z-Wave JS when you think it doesn't accurately reflect reality, e.g. reviving a failed/dead node or marking the node as asleep. + +| Service Data Attribute | Required | Description | +|------------------------ |---------- |-------------------------------------------------------------------------------------------------------------------------------------------------- | +| `entity_id` | no | Entity (or list of entities) to set the configuration parameter on. At least one `entity_id` or `device_id` must be provided. | +| `device_id` | no | ID of device to set the configuration parameter on. At least one `entity_id` or `device_id` must be provided. | + +This service can be used in tandem with the node status sensor (disabled by default) to track the node's status and fire the command when needed. Here's an example automation that would ping a node when the node status sensor state has changed to dead and remained dead for 30 minutes. Note that this may be useful for some devices but will definitely not be useful for all. In cases where it is not useful, all you will be doing is generating additional traffic on your Z-Wave network which could slow down communication. + +```yaml +trigger: + platform: state + entity_id: + - sensor.z_wave_thermostat_node_status + - sensor.z_wave_lock_node_status + to: "dead" + for: "00:30:00" +action: + - service: zwave_js.ping + target: + entity_id: "{{ trigger.entity_id }}" +``` + ### Service `zwave_js.set_lock_usercode` This service will set the usercode of a lock to X at code slot Y.