Z-Wave Refresh device configuration(refreshCCValues)

Hi,
Is possible from automation call refresh device configuration:

When I press refresh button I see in zwave log that there is called some API function:
2022-11-14 18:19:00.304 INFO Z-WAVE: Calling api refreshCCValues with args: [ 86, 112, [length]: 2 ]

So my question can I call this refresh function and if is how I can do this?

Is maybe possible call refresh only one parameter inside this configuration? I need manually periodic refresh this value because Thermostatic Head sometime forget change it and when I refresh it manually it change state…
slika

Versions:
Home Assistant 2022.11.2
Supervisor 2022.10.2
Operating System 9.3
Frontend: 20221108.0 - latest
zwave-js-ui: 8.4.1
zwave-js: 10.3.0

Thanks for any help and hint.

Just call the zwave_js.refresh_value service like this:

service: zwave_js.refresh_value
data:
  entity_id:
    - sensor.your_entity

{Edit} Apologies, I hadn’t noticed that it was the configuration that you were trying to refresh. This won’t work, you could try posting in the zwave-js github issues also.

Use zwave_js.invoke_cc_api service to refresh the config parameter value:

service: zwave_js.invoke_cc_api
data:
  command_class: "112"
  method_name: get
  parameters:
    - 3
target:
  entity_id: climate.z_wave_thermostat

The first element in the parameters list is the parameter number. See Z-Wave JS Configuration CC API docs for more info.

1 Like

Thanks for reply and help. @freshcoast hint help me solve problem. Im try his code and run automation but it give me error:
Endpoint(node_id=86, index=1) - NotFoundError: Command class 112 not found on endpoint Endpoint(node_id=86, index=1)

Then Im try set endpoint to 0 and it start working, so automation now looks like:

alias: 0_Test
description: ""
trigger: []
condition: []
action:
  - service: zwave_js.invoke_cc_api
    data:
      command_class: "112"
      method_name: get
      parameters:
        - 3
      endpoint: "0"
    target:
      entity_id:
        - climate.floor2_bedroom_thermostat
mode: single

Configuration CC is only valid for the root device (endpoint 0). There was no reason to set it, which is why I never included it in the sample code. You can remove endpoint entirely.

If I run like this:

alias: 0_Test
description: ""
trigger: []
condition: []
action:
  - service: zwave_js.invoke_cc_api
    data:
      command_class: "112"
      method_name: get
      parameters:
        - 3
    target:
      entity_id:
        - climate.floor2_bedroom_thermostat
mode: single

It doesnt work and return error:

Endpoint(node_id=86, index=1) - NotFoundError: Command class 112 not found on endpoint Endpoint(node_id=86, index=1)

So I need to specify endpoint to 0. Maybe there is some bug in latest version of HA/Zwave…

No, you’re correct. There’s a distinction between inferred endpoints when specifying entity_id vs. device or area:

For entity_id:

If endpoint is specified, that endpoint will be used to make the CC API call for all devices, otherwise the primary value endpoint will be used for each entity.

For device_id/area:

If endpoint is specified, that endpoint will be used to make the CC API call for all devices, otherwise the root endpoint (0) will be used for each device.

If you use device_id instead (which I usually use in these examples), it will choose endpoint 0 automatically. If using entity, you should specify endpoint. It could be smarter, I suppose, depending on the CC being using, but it’s working as intended.

1 Like