Can a device type handler or a smart app send z-wave commands to other z-wave devices?
No… well, probably not.
A DTH is meant to instantiate once per “added physical device” and only has the attributes for that specific Device. It cannot talk to others.
A SmartApp can only talk to Device Object Instances that are authorized by the user in Preferences.
Theoretically, it should be possible, as long as you know the device ID. Maybe @juano2310 could shed some light…
That would be a bit of a security leak, so this is an interesting Topic.
The Z-Wave Docs don’t seem to reference DNI, and use of an Device Object by ID other than those authorized in Preferences is also illegal and should be prevented. http://docs.smartthings.com/en/latest/device-type-developers-guide/building-z-wave-device-handlers.html
I don’t think that is possible. You can get a device using DNI if the device is a child of the smartapp or you selected it using the inputs.