Here is a full example of how to create a number entity for a zwave config parameter.
Using the “idle brightness” configuration parameters for the Honeywell T6 Pro thermostat as an example:
Step 1 - Get the zwave device diagnostics for the device and find the property you want.
{
"id": "18-112-0-39",
"nodeId": 18,
"commandClass": 112,
"commandClassName": "Configuration",
"endpoint": 0,
"property": 39,
"propertyName": "Idle Brightness",
"type": "number",
"readable": true,
"writeable": true,
"label": "Idle Brightness",
"default": 0,
"stateless": false,
"commandClassVersion": 4,
"min": 0,
"max": 5,
"list": false,
"lastUpdate": 1662215115053
},
Step 2 - Create the following package file
template:
- trigger:
- platform: zwave_js.value_updated
entity_id:
- climate.upstairs_thermostat
command_class: 112
property: 39
sensor:
- name: "upstairs_thermostat_idle_brightness"
state: "{{ trigger.current_value }} "
- number:
- name: "upstairs_thermostat_idle_brightness"
state: '{{ states("sensor.upstairs_thermostat_idle_brightness") }}'
step: 1
min: 0
max: 5
set_value:
service: zwave_js.set_config_parameter
data_template:
entity_id: climate.upstairs_thermostat
parameter: 39
value: "{{ value }}"
Note, you may need to perform a manual refresh of config from zwave_js ui the first time. On subsequent startups it retains the old value. If you are concerned about the value being changed while HASS is down, then you should poll as @freshcoast describes above.
In process of replicating this using shell scripts and automating generation from the device diagnostic file.