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

[feat] Offer auto-complete suggestions for config parameters with allowManualEntry: true that have options #779

Closed
AlCalzone opened this issue Mar 1, 2021 · 12 comments · Fixed by #781
Assignees
Labels
enhancement New feature or request

Comments

@AlCalzone
Copy link
Member

AlCalzone commented Mar 1, 2021

Is your feature request related to a problem? Please describe.
Some zwave-js config params have both allowManualEntry: true and options. These options are meant to give the user some guideline or point out special values like "Off".

Describe the solution you'd like
We should offer auto-complete suggestions in this case that can be selected in addition to manually entered values.

Describe alternatives you've considered
none

Additional context
none

@AlCalzone AlCalzone added the enhancement New feature or request label Mar 1, 2021
@robertsLando
Copy link
Member

robertsLando commented Mar 1, 2021

@AlCalzone Is options like states? How do I access those options?

@AlCalzone
Copy link
Member Author

Blocked by zwave-js/node-zwave-js#1927

@AlCalzone
Copy link
Member Author

You need to check the configuration parameters' metadata for these properties. options === states

@NYZack
Copy link

NYZack commented Mar 1, 2021

I believe there's also an issue in reporting read-only values if options are set in the config file but the device can also return values outside one of the options; in this case, the field ends up showing up as blank. (The flip side of the issue reported here.)

@robertsLando
Copy link
Member

The fix is ready in #781, just need to wait a new release of zwavejs with zwave-js/node-zwave-js#1927 fixed

@NYZack
Copy link

NYZack commented Mar 2, 2021

@robertsLando I still don't think this is working correctly for read-only parameters with options. I'm attaching a config file that has read-only parameters with options, but values that are outside the options can also be returned by the device. When values are outside the options, they don't appear.

zse29.json.txt
node_25.json.txt

@NYZack
Copy link

NYZack commented Mar 2, 2021

Here's a screenshot:
image

@robertsLando
Copy link
Member

@NYZack The problem is that those values have allowManualEntry set to false:

{
		"id": "25-112-0-7",
		"nodeId": 25,
		"commandClass": 112,
		"commandClassName": "Configuration",
		"property": 7,
		"propertyName": "Manual Motion Re-trigger Time Setting",
		"type": "number",
		"readable": true,
		"writeable": false,
		"description": "Read the value for the Motion Re-trigger Time set by knob on sensor (overridden by setting Motion Re-trigger Time parameter).",
		"label": "Manual Motion Re-trigger Time Setting",
		"default": 5,
		"stateless": false,
		"min": 5,
		"max": 720,
		"unit": "seconds",
		"list": true,
		"allowManualEntry": false,
		"states": [{
			"text": "5 seconds (Test mode) (Default)",
			"value": 5
		}],
		"value": 300,
		"lastUpdate": 1614706979421,
		"newValue": 300
	},
	{
		"id": "25-112-0-8",
		"nodeId": 25,
		"commandClass": 112,
		"commandClassName": "Configuration",
		"property": 8,
		"propertyName": "Manual Brightness Threshold Setting",
		"type": "number",
		"readable": true,
		"writeable": false,
		"description": "Read the value for the Brightness Threshold set by knob on sensor (overridden by setting Brightness Threshold parameter).",
		"label": "Manual Brightness Threshold Setting",
		"default": 900,
		"stateless": false,
		"min": 10,
		"max": 900,
		"unit": "lux",
		"list": true,
		"allowManualEntry": false,
		"states": [{
			"text": "900 lux (Test mode) (Default)",
			"value": 900
		}],
		"value": 300,
		"lastUpdate": 1614706979661,
		"newValue": 300
	},

If you check the other values with allowManualEntry set to true are correctly rendered (when you add a custom value the label will be Custom: <value>

@AlCalzone
Copy link
Member Author

@robertsLando Since that is a readonly parameter, it doesn't really make sense to offer a dropdown.
IMO you should simply display the value and use states to translate it to a label if possible.

@NYZack
Copy link

NYZack commented Mar 3, 2021

@robertsLando Sorry, you're right. I had an old version of the config file. It does return the value when allowManualEntry is set to true.

@NYZack
Copy link

NYZack commented Mar 5, 2021

OK, I'm still not sure this is resolved. When I enter a manual value for a parameter that also has options set (where allowManualEntry is set to true), the value is ignored, and instead the existing parameter (corresponding to an option) is re-written. In this case, the value 1 corresponded to the already-set option. I changed it to 500, and the log showed this:

2021-03-05 15:17:17.543 INFO ZWAVE: Calling api writeValue with args: [
{ nodeId: 36, commandClass: 112, endpoint: 0, property: 4 },
1,
[length]: 2
]

@robertsLando
Copy link
Member

Firstly ensure you are running the very latest version of z2m. Then to send a custom value write it on the input, press enter and then press the button on the right side to send the value

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants