SOLVED ZWave: How to send SensorMultilevelCmd_Get within an automation

Posting under a new topic as my question now is not open-ended.
My original post:
https://community.home-assistant.io/t/zwave-mimolite-driver-incomplete/184684

There doesn’t seem to be any “ZWave Protocol For Dummies” like guide out there, so I’ve been trying to understand things by tinkering while observing OZW_log.txt and looking over the MimoLite spec.

Now I feel like I may have an educated guess at something that may explain my issue and thereby give a clue to how to get it working:
It looks like my previous controller software already “knew” how MimoLite worked, and it was plug and play in the sense that when you used it’s binary switch, the relay would turn on and would in the same step it would retrieve the SIG1’s analog reading.

I’m assuming that sequence isn’t built in for Hassio because using the switch triggers the relay, but in the series of responses there is no SensorMultilevel report. (as in the example in my original post). This report is what would give the analog reading per the spec.
So, I’m assuming that to fix my issue, I need to find a way to get HA to.

  1. Switch ML’s relay on
  2. While it’s on, send issue the SensorMultilevelCmd_Get command to it
  3. Capture the reading in the response from the previous command.

Steps 2. and 3. need to occur while the relay is still switched on, so I either need to set it to stay on when switched, or turned off automatically after an interval has passed.

The ML spec shows how I can set a device parameter that appears to control how long the relay will stay on, but I am not physically at the device’s location so can’t observe it yet.

The thing I need to know how to do is, in an automation, how can I send the SensorMultilevelCmd_Get command. The only way I’ve been able to do it is by issuing a node refresh from the ZWave control panel.

Is there a way to do this?

Use the zwave.refresh_entity service call with the sensor entity ID.

Finally figured it out. If you just turn on the MimoLite relay, it automatically turns off before the Multilevel get can reach the device and get the analog reading. Per the spec, there is a parameter (#11) you can change that sets a delay in milliseconds before the relay auto shuts off. Changing this value so that it waits 10 seconds, and bingo- the reading is accurate!

The other controller platform must have been doing this intrinsically.
I’m also sending a wave.refresh_entity_value to target just the ‘general’ sensor rather than the full report.

So I’m on my way again, with a new struggle- trying to understand how to use call_service in AppDaemon to set the params there rather than in an automation. The docs unfortunately don’t give an example. But this still feels like a big win.