Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cant fill in particular config value in OZW addon #1600

Closed
nelbs opened this issue Sep 28, 2020 · 8 comments
Closed

Cant fill in particular config value in OZW addon #1600

nelbs opened this issue Sep 28, 2020 · 8 comments

Comments

@nelbs
Copy link

nelbs commented Sep 28, 2020

The problem

I have some Neo coolcam PIR PD02Z sensors and are unable to change parameter 99 (ambient light intensity calibration) . In the OZW addon I cant fill in / change a number at the entry of parameter 99. When I try this via the ozw.set_config_parameter I get some errors in HA log and OZW addon log.
The ozw log doesn't show no errors / warnings.

The strange thing is that the initial value is 1000. When I click on that value to change it, it changes automatically to 1. Then I cant change it anymore.

I checked the xml file but i dont see something strange

image
image

Environment

  • Add-on with the issue: OpenZwave
  • Add-on release with the issue: 0.5.2
  • Last working add-on release (if known):
  • Operating environment (OS/Supervised): Supervised
  • Aeotec gen 5 stick + NEO coolccam PIR V2 (PD02Z)

Problem-relevant configuration

device: /dev/serial/by-id/usb-0658_0200-if00
network_key: >-
xxxx xxxx xxxx

Traceback/Error logs

HA message when using calling ozw.set_config_parameter

Kan service ozw/set_config_parameter niet aanroepen 'NoneType' object has no attribute 'type'

Message in OZW addon log

[20200928 14:57:02.654 CEST] [default] [debug]: QVariant(int, 5) 
[20200928 14:57:02.656 CEST] [default] [debug]: QVariant(int, 14) 
[20200928 14:57:02.656 CEST] [default] [debug]: QVariant(int, 1) 
[20200928 14:57:02.657 CEST] [default] [debug]: QVariant(int, 3) 
[20200928 14:57:02.658 CEST] [default] [debug]: QVariant(int, 12) 
[20200928 14:57:02.659 CEST] [default] [debug]: QVariant(int, 4) 
[20200928 14:57:02.660 CEST] [default] [debug]: QVariant(int, 16) 
[20200928 14:57:02.661 CEST] [default] [debug]: QVariant(int, 17) 

Additional information

@kpine
Copy link
Contributor

kpine commented Oct 6, 2020

There are various problems setting values in ozw-admin, for example: OpenZWave/ozw-admin#33.

The problem with set_config_parameter and short values was fixed in HA 0.115. What version are you using?

@nelbs
Copy link
Author

nelbs commented Oct 6, 2020

Hi, I am using version 0.115.6

@kpine
Copy link
Contributor

kpine commented Oct 6, 2020

What is the service data you are using? Based on the current OZW code, you would get that error if the combination of the OZW instance, node, or parameter index values could not be found. A future version of HA should report a more sensible error.

@kpine
Copy link
Contributor

kpine commented Oct 7, 2020

Another question, what Stage is your node in? You can find this in the UI, Configuration -> Devices. Select this device and the Device Info will list the Stage.

@nelbs
Copy link
Author

nelbs commented Oct 7, 2020

The stage of this node is complete and this is the service data:

node_id: 14
parameter: 99
value: 1000

@kpine
Copy link
Contributor

kpine commented Oct 21, 2020

Kan service ozw/set_config_parameter niet aanroepen 'NoneType' object has no attribute 'type'

I am guessing that you are running into the same problem that this PR was attempting to fix. Until that problem is fixed in the upstream library you won't be able to use Home Assistant to change the value.

There also looks to be a bug in the device XML definition for parameter 99. This error is likely causing the ozw-admin GUI to be unable to configure the value correctly.

    <Value type="short" genre="config" instance="1" index="99" label="Ambient Light Intensity Calibration" value="1000" min="1" max="65536" size="2">

The type is a "short" with size "2", but the maximum value is set 65536. OZW represents "short" values as signed 16-bit integers. The maximum value is in fact 32767. A value of 65536 when casted to a short maps to 0, which is why ozw-admin won't let you change the value. This would also affect HA since it checks the min and max.

If the device really does allow a value up to 65535 (0xffff), then to allow the full range of values, you'd need to modify the XML file to:

    <Value type="short" genre="config" instance="1" index="99" label="Ambient Light Intensity Calibration" value="1000" min="-32768" max="32767" size="2">

You cannot exclude the value 0. But this configuration parameter is undocumented, and there appear to be different versions of the product, so who knows what it's supposed to be.

You can bypass HA and ozw-admin and set the value directly via MQTT using the setvalue command. Use MQTT Explorer to find the value id key. Use MQTT explorer to publish the command.

topic: OpenZWave/1/command/setvalue/
payload:

{
  "ValueIDKey": 123456789,
  "Value": 300
}

Replace 123456789 with your key.

@nelbs
Copy link
Author

nelbs commented Oct 23, 2020

If the device really does allow a value up to 65535 (0xffff), then to allow the full range of values, you'd need to modify the XML file to:

    <Value type="short" genre="config" instance="1" index="99" label="Ambient Light Intensity Calibration" value="1000" min="-32768" max="32767" size="2">

thanks @kpine that did the trick. Now I can change the value in the OZW gui.

Very useful program, mqtt explorer. I did not know that.

@stale
Copy link

stale bot commented Mar 11, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Mar 11, 2021
@stale stale bot closed this as completed May 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants