Azure-docs: Need more info on Target Condition given in Device Configuration in Automatic Device Management

Created on 10 Jul 2018  Â·  9Comments  Â·  Source: MicrosoftDocs/azure-docs

Instead of using Tags , our requirement is to update twin for few devices , lets say out of ten devices we need only to update firmware for 3 devices . In the given article , they are using tags with device type as 'Chiller' but can't we 'deviceId" with AND condition to apply firmware only on selected device. We tried with below target condition but it didn't work

deviceId = 'deviceOne' AND deviceId='deviceTwo'

Please suggest .


Document Details

⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

assigned-to-author cxp doc-enhancement in-progress iot-husvc triaged

Most helpful comment

@ampac28 - in the tutorial you're looking at, the syntax you need to use is:

targetCondition: deviceid=\'device01\' OR deviceid=\'device02\'

All 9 comments

@ampac28 thank you for your feedback!

Did you try using something like the following:

targetCondition: SELECT deviceId FROM devices WHERE deviceId='device1' OR deviceId='device2'

Let us know the results?

You can learn more about device configuration here: https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-auto-device-config

Thank you!

@dominicbetts can we enhance this doc and add a reference to IoT Device Configuration doc: https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-auto-device-config ? It may help on similar questions.

Thank you!

@sergaz-msft @ampac28 - I added some links to further information in the article. The changes should be published later today.

@ampac28 - I'm going to request this issue is closed. If you have further questions, please reopen it. Thanks!

please-close

@ampac28 - in the tutorial you're looking at, the syntax you need to use is:

targetCondition: deviceid=\'device01\' OR deviceid=\'device02\'

@dominicbetts - Thanks for sharing the syntax , it really worked for me.
I have one more query on how to show device name (ID) under the Metrics section on the configuration tile. Currently I see it displays only the count of devices the configuration applied .
capture

I did the firmware sample for 2 devices and interested to show the each device name with their status. There may be a case if firmware update is apply on 5 devices then how best we can show the progress by device name on UI.

Please suggest.

Hi @ampac28 - the metrics page only shows counts - there could potentially be thousands or tens of thousands of devices updated through a configuration, so displaying a list of device ids is not practicable. If you think it would be useful to add this feature, then please make a suggestion for it here: https://feedback.azure.com/forums/321918-azure-iot

Alternatively, you could write your own application that queries and reads reported properties. This example shows how you can query reported properties: https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-node-node-device-management-get-started#trigger-a-remote-reboot-on-the-device-using-a-direct-method

Thanks,
Dominic

@ampac28 - I'm going to request this issue is closed. If you have further questions, please reopen it. Thanks!

please-close

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Agazoth picture Agazoth  Â·  3Comments

DeepPuddles picture DeepPuddles  Â·  3Comments

behnam89 picture behnam89  Â·  3Comments

AronT-TLV picture AronT-TLV  Â·  3Comments

mrdfuse picture mrdfuse  Â·  3Comments