home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
73.41k stars 30.65k forks source link

Can not set parameter on Z-Wave device #91477

Closed Andrew-Joakimsen closed 1 year ago

Andrew-Joakimsen commented 1 year ago

The problem

I install new Zooz Zen54 switch and need to set a configuration parameter for it to work properly (attached switch type to momentary). In the Zooz documentation this means to set parameter 12 to a value of 1.

In the Home Assistant UI it shows the table with parameters, and I can see the Parameter 12 as a valid recognized value, but the entire table it is read-only, There is no option to edit any parameter.

Then I attempt to change the parameter with Developer Tools > Call Service and it fails with the error:

Failed to call service zwave_js.set_config_parameter. Node(node_id=3) - NotImplementedError: Configuration values of undefined type can't be set

What version of Home Assistant Core has the issue?

core-2023.4.4

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Z-Wave JS

Link to integration documentation on our website

https://www.home-assistant.io/integrations/zwave_js/#service-zwave_jsset_config_parameter

Diagnostics information

config_entry-zwave_js-bcbcb7555006462eef3d79a45d4e4a6b.json.txt

Parameters in UI are read only: 0p8Y5Au

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

service: zwave_js.set_config_parameter data: parameter: "12" value: "2" target: device_id: 807b674d02c4b6f58e0a52e44c2c36fd

Produces error

Failed to call service zwave_js.set_config_parameter. Node(node_id=3) - NotImplementedError: Configuration values of undefined type can't be set

home-assistant[bot] commented 1 year ago

Hey there @home-assistant/z-wave, mind taking a look at this issue as it has been labeled with an integration (zwave_js) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `zwave_js` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Renames the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign zwave_js` Removes the current integration label and assignees on the issue, add the integration domain after the command.

(message by CodeOwnersMention)


zwave_js documentation zwave_js source (message by IssueLinks)

kpine commented 1 year ago

Can you attach the device diagnostic instead of the integration one? Easier to work with.

Andrew-Joakimsen commented 1 year ago

I don't believe I have it, I had to switch to Z-wave JS UI integration to make this device work.

But this is a totally stock new install of Home Assistant, added Z-Wave stick and only this one Z-Wave device.

kpine commented 1 year ago

Go to the device page in HA, click the ... under Z-Wave info and it can be downloaded.

Andrew-Joakimsen commented 1 year ago

zwave_js-a5b2e24019fdc65c8f6da82a757b297a-Node 3-807b674d02c4b6f58e0a52e44c2c36fd.json.txt

That is the device diag, but remember it is generated with Z-Wave JS UI installed which does properly support setting the device's parameter. The default Z-Wave integration has already been removed from this installation.

kpine commented 1 year ago

Thanks, that's the correct file.

You are using the Z-Wave integration, otherwise you couldn't produce that file. You are confusing add-ons and integrations. It doesn't matter if you're using the Z-Wave JS add-on or Z-Wave JS UI add-on, from HA point of view it's the same thing.

Andrew-Joakimsen commented 1 year ago

With Z-Wave JS UI the front end only shows parameters 1&2 and Dev Tools > Call Service returns a different error:

Failed to call service zwave_js.set_config_parameter. Node(node_id=3) - NotFoundError: Configuration parameter with value ID 3-112-0-12 could not be found

However the original error occurs when I try to set one of the detected parameters:

Failed to call service zwave_js.set_config_parameter. Node(node_id=3) - NotImplementedError: Configuration values of undefined type can't be set

kpine commented 1 year ago

You'll need to re-interview the device. The add-ons have different driver versions, that's the only difference. It looks like when you switched add-ons the interview failed. Please upload a new diag file if you can get it to be successful.

Andrew-Joakimsen commented 1 year ago

Re-interview doesn't add any new parameters to the device, but this is going on a tangent. The issue is that you can not set a recognized parameter.

kpine commented 1 year ago

Correct, but it would be helpful to have a complete and correct device diagnostic file. If your device continues to be in this state HA will not be able to set parameter 12 anyways because it does not exist.

After re-interviewing the device, does parameter 12 exist in ZUI? If not, and parameter 12 is actually implemented by the device, you'll need to raise an issue with node-zwave-js. You might want to request a device configuration anyways, which would also solve this problem.

Andrew-Joakimsen commented 1 year ago

I am able to set the parameter through ZWave JS UI no issues.

I am reporting the bug because Home Assistant is not allowing to set the parameter, it shows a table of parameters on the configure screen that is read-only and call service returns the error

Failed to call service zwave_js.set_config_parameter. Node(node_id=3) - NotImplementedError: Configuration values of undefined type can't be set

This happens within Home Assistant for any recognized parameter with the built in Zwave JS and continues to happen after switching to the Zwae JS UI integration. Zwave JS UI provides a separate interface to adjust parameters which does not appear to suffer from this bug.

If the parameter change was possible within stock Home Assistant, then no switch Zwave JS UI is needed. That switch is probably introducing further issues and would likely require a full reset of the Zwave network to resolve. Like I said let's not go on a tangent and focus on the main issue.

kpine commented 1 year ago

I understand the issue completely. Just trying to help you out. If this bug is fixed you still won't be able to set parameter 12 in HA because of the device state. I'll disengage now, good luck.

Andrew-Joakimsen commented 1 year ago

The bug is not fixed. I can still not go into Home Assistant device config and set a parameter, it is read only. I can not go into Dev tools > call service, it returns an error when setting a parameter.

Andrew-Joakimsen commented 1 year ago

Here is a debug log with all the parameters. They are showing up in Home Assistant after you go to Zwave JS UI and query them.

zwave_js-a5b2e24019fdc65c8f6da82a757b297a-Node 3-807b674d02c4b6f58e0a52e44c2c36fd.json(1).txt

chuyskywalker commented 1 year ago

I've just run into this problem with a new ZWave light switch as well. All the same symptoms.

  1. device interviews and adds without any issues (UI or logs, as far as I can tell) but comes back with a rather generic name (Node NNN).
  2. All the parameters are read-only in the UI (see above screenshots; not mine, but same effect)
  3. Add/Exclude and re-interview don't appear to make any changes to the issue

I chalked the weird "Node N" moniker up to the fact that this is a VERY new device and not likely in the database (it's a NIE-TECH evalogik rotary dimmer)

I get the same error when attempting to set the parameters via the developer tools:

service: zwave_js.set_config_parameter
data:
  parameter: param020 # or 20 or "Rate For Physical On", all the same result
  value: 0
target:
  entity_id: light.node_23

Response:

Failed to call service zwave_js.set_config_parameter. Node(node_id=23) - NotImplementedError: Configuration values of undefined type can't be set

I'll attach the zwavejs logs from adding the device as well as the device diagnostics. I've attempt an exclude/add and some re-interviews, but end up at the same place each time.

kpine commented 1 year ago

You cannot use the service call to set unknown/undefined parameters. Request a missing device configuration. https://github.com/zwave-js/node-zwave-js/issues/new/choose

kpine commented 1 year ago

You can workaround it by either switching to Z-Wave JS UI as mentioned above, or using the command class API.

For the undefined type parameters:

service: zwave_js.invoke_cc_api
data:
  command_class: "112"
  method_name: set
  parameters:
    - parameter: 20
      value: 0
target:
  entity_id: light.node_23

If that doesn't work and/or for unknown parameters, add the parameter size:

service: zwave_js.invoke_cc_api
data:
  command_class: "112"
  method_name: set
  parameters:
    - parameter: 20
      value: 0
      valueSize: 1  # check user manual
target:
  entity_id: light.dining_room_light
chuyskywalker commented 1 year ago

@kpine appreciate that; I've got ahead and submitted this as best I could after reading up. Pretty new here so I appreciate the welcome.

kpine commented 1 year ago

I'll attach the zwavejs logs from adding the device as well as the device diagnostics. I've attempt an exclude/add and some re-interviews, but end up at the same place each time.

I hadn't looked at the interview earlier, but just took a look now. I see there are some discrepancies between what the interview shows and the information HA receives. As an example, interview shows:

2023-04-23T04:53:41.372Z CNTRLR « [Node 023] received information for parameter #1:
                                  parameter name:      Led Function
                                  value format:        UnsignedInteger
                                  value size:          1 bytes
                                  min value:           0
                                  max value:           3
                                  default value:       0
                                  is read-only:        false
                                  is advanced (UI):    false
                                  has bulk support:    true
                                  alters capabilities: false

But in the diagnostic dump, the min and max are missing:

        {
          "endpoint": 0,
          "commandClass": 112,
          "commandClassName": "Configuration",
          "property": 1,
          "propertyName": "param001",
          "ccVersion": 4,
          "metadata": {
            "type": "number",
            "readable": true,
            "writeable": true,
            "valueSize": 1,
            "name": "Led Function",
            "info": "Led behavior for output",
            "noBulkSupport": false,
            "isAdvanced": false,
            "requiresReInclusion": false
          },
          "value": 0
        },

If the min/max were being included, you could use these params with HA without requiring a device config file. HA rejects it because of the missing min/max.

issue-triage-workflows[bot] commented 1 year ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.