Zwave_js.set_config_parameter in appdaemon not working

Prior to migrating to zwave_js, I had been using an appdaemon app to interface with a mimolite.

In it, I had been setting a device parameter with the following call:

self.call_service("zwave/set_config_parameter", node_id=19, parameter=11, value=150)

With zwave_js, it appears that the interface has changed. Rather than using node_id, the device id needs to be specified instead.

So now I am making my call like this:

self.call_service("zwave_js/set_config_parameter", device_id='f61ad85870bb394b844107e1f3a59e79', parameter='11', value='150')

But this call results in the following in the error log:

021-07-30 14:38:07.494656 WARNING propane: Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/appdaemon/threading.py", line 936, in worker
    funcref(args["event"], data, self.AD.events.sanitize_event_kwargs(app, args["kwargs"]))
  File "/config/appdaemon/apps/propane.py", line 44, in read_mimolite
    self.call_service("zwave_js/set_config_parameter", device_id='f61ad85870bb394b844107e1f3a59e79', parameter='11', value='150')
  File "/usr/lib/python3.8/site-packages/appdaemon/utils.py", line 197, in inner_sync_wrapper
    f = run_coroutine_threadsafe(self, coro(self, *args, **kwargs))
  File "/usr/lib/python3.8/site-packages/appdaemon/utils.py", line 308, in run_coroutine_threadsafe
    result = future.result(self.AD.internal_function_timeout)
  File "/usr/lib/python3.8/concurrent/futures/_base.py", line 446, in result
    raise TimeoutError()
concurrent.futures._base.TimeoutError

When I make the call from Developer Tools / Services / Z-Wave JS: Set as Z-Wave device configuration param, and choose the mimolite device from the GUI form I see this in the HA log with no errors or futther trace:

2021-07-30 08:38:23 INFO (MainThread) [homeassistant.components.zwave_js.services] Set configuration parameter ConfigurationValue(value_id='19-112-0-11') on Node Node(node_id=19) with value 150

Is there something wrong with how I’m specifying params in the appdaemon code?

I don’t know if it matters, but I note that you’ve changed the parameter and value to strings from integers. Both can apparently take either strings for properties/labels or integers, so perhaps it’s getting confused about what you’ve provided.

Thought I had tried it both ways prior to posting, but just now it did make a difference to pass them as ints. No exceptions, but behavior of the mimolite seems to behave slightly different under zwave_js than from zwave, in terms of the timing of the device responses. I am able to get my app to work again now with same behavior I had using zwave, with a few code changes. Thanks for responding Rob.

Looks like I spoke too soon, with integer params the same exception still eventually occurred:

2021-07-31 00:37:00.841319 WARNING propane: Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/appdaemon/threading.py", line 936, in worker
    funcref(args["event"], data, self.AD.events.sanitize_event_kwargs(app, args["kwargs"]))
  File "/config/appdaemon/apps/propane.py", line 44, in read_mimolite
    self.call_service("zwave_js/set_config_parameter", device_id='f61ad85870bb394b844107e1f3a59e79', parameter=11, value=150)
  File "/usr/lib/python3.8/site-packages/appdaemon/utils.py", line 197, in inner_sync_wrapper
    f = run_coroutine_threadsafe(self, coro(self, *args, **kwargs))
  File "/usr/lib/python3.8/site-packages/appdaemon/utils.py", line 308, in run_coroutine_threadsafe
    result = future.result(self.AD.internal_function_timeout)
  File "/usr/lib/python3.8/concurrent/futures/_base.py", line 446, in result
    raise TimeoutError()
concurrent.futures._base.TimeoutError

It seems to happen inconsistently. Not sure why there would be a timeout in setting a param sometimes, if it works most of the time, but the device is otherwise responsive; triggering the mimolite relay works every time.