Device Command Node: How to select devices by Attribute value

Nubee here. I created a function on my ESP32 device that is triggered by a Device Command from Losant, the function will send to losant the WiFi signal strength at my device. I would like to select the devices that will receive the command by the “firmware_version” attribute value. I don’t see anything in the query builder nor do I see an instruction in the device command help or the query help files.

please point me in the right direction if this is possible.



Hi @Dave_Blaylock and welcome to the Losant forums!

While you can’t perform a device query using device attributes, you can query device tags.

You can use a Device: Update Node to add/modify a “firmware_version” device tag based on the relevant device attribute.

Depending on your devices and use-case, you may also find it useful to bulk update device tags of existing devices.

Once the appropriate device tags are in place, you can scope the Device: Command Node as needed.

Let us know if you have any other questions, and once again thanks for joining us!

Thanks for your feedback @Sebastian_Turner I looked into the bulk update device tags and found that the template requires me to either update all devices or use a query to select the devices that get updated and the query does not allow me to select devices by attribute value.

Please let me know if maybe I did not understand your post.

I am working my way through Losant University but I am in a situation of Shoot then Aim. Seems like there is never enough time.

Yes, you are correct - for your current predicament, the bulk device update option will only be viable if you are updating all of your devices, or if you can come up with an advanced device query that would filter these devices as needed. Once device tags are in place, you can query them in any future device query.

Are these devices reporting in regularly with a “firmware_version” attribute, or any other value that signifies how these devices should be tagged? If so, I’d add a Device: Update Node to the relevant workflow(s) to set tags based on that attribute value.

Hopefully this is helpful! Let me know it goes.