The Image Selector field type allows you to put an entry where the user can select one or many images with given values.
Users will need to click on an image and the value you entered in the widget options will be stored in your data device.
The most important configuration here that needs explanation is Use Values From and Allow Multiple Selections
Let's talk about Use Values From with Static value.
In this case you need to enter:
Here is an example:
You can click on the + and - buttons to add or remove a new image.
With this configuration, the user should see something like this:
If Allow Multiple Selections is set to yes, the user can select more than one image before clicking on the Send button.
Now for Use Values From with Dynamic value, the field will behave very differently in the background, but the user should see the same thing.
This option allows you to get all the values through a variable in your device's data storage. This means that all the data from that variable will be used as an item for the image field instead of the previous definition with Static Value.
Take a look in this data example:
{ variable: "device__image", value: "Temperature Sensor", metadata: { description: ""This sofa has wheels on it.", url: "https://3.imimg.com/data3/KJ/NV/MY-14192/office-sofa-on-wheels-250x250.jpg", value: "temperature_sensor" } }
With this data in the device's storage, the result should be exactly the same as the previously shown with Static Value.
Pay attention to the data parameters used: