Hello @Ayub Lakhani ,
it seems your devices are connected to the IoT Hub without using any Device SDK, just plain MQTT.
The IoT Hub has you covered, as long as your devices are capable to work with cloud-to-device communication like Cloud messages, Direct Methods, or Device Twin changes (as in desired properties).
Check this extensive blog post covering all these features.
Once this is in place, you need to program an Azure function capable to execute a direct method call, a cloud message call, or a desired property update for the second device. The trigger is probably based on some logic inside Stream Analytics (or directly inside the Azure function).
I'm not sure wht the Service Bus queue is added.
The flow looks like:
device (sending over MQTT) -> IoT Hub (ingest) -> Stream Analytics (decision logic) -> Azure function (Starts Direct Method call or Desired property update or cloud message) -> IoT Hub (calls device) -> Device (received command over specific MQTT topic)
I recommend checking this learning module in advance to see how cloud-to-device communication is done.
----------
If the response helped, do "Accept Answer". If it doesn't work, please let us know the progress. By doing so, all community members who have a similar issue will benefit. Your contribution is highly appreciated.