Image Widget
Last updated
Last updated
Improve your header visually with a custom image that can be controlled from hardware.
Theme - Define how the widget design will appear in dark and light app/OS themes.
Datastream - Select or create a datastream of data type integer. By changing the value of this datastream, an image index wil change.
Handle values out of range as empty
When turned ON, widget will don't show an image if the incoming value is out of datastream min/max range.
When OFF, the image with index closest to the current value will be shown.
Images - Specify a list of images to display, where the Image ID corresponds to the respective values of the datastream.
Full width - When ON, image will be expanded to the edges of the screen and under the Tabs.
Images scaling - Choose between FIT or FILL options to adjust how the image appears within the container.
You can change certain properties of the Widget from your hardware. For that, use this command:
Where:
vPin
is: virtual pin number the widget is assigned to
widgetProperty
: property you want to change
propertyValue
: value of the property you want to change
Don't put Blynk.setProperty()
into the void loop()
as it can cause a flood of messages and your hardware will be disconnected. Send such updates only when necessary, or use timers.
You can change the properties url
, urls
, isHidden
of the widget from your hardware. The URL must be encoded, so spaces in labels must be replaced with %20, and color hexadecimal values in the HTTP API URL must include the hash # character urlencoded as %23.
Change the individual image by its index:
Change a list of URLs for the widget. First image will have index 0
, next 1
, and so on.
Make sure you not exceed the max string size of 255 chars when sending a long list of URLs
Widget can be hidden from header.
GET
https://{server_address}/external/api/update/property?token={your 32 char token}&pin={your vPin}&{property}={value}
The endpoint allows you to update the Datastream Property value via GET request. All widgets (both web and mobile) that are assigned to this datastream will inherit this property. The Datastream Property is persistent and will be stored forever until you change it with another value. In order to clear the property you need to clear the device data in device actions menu.
Examples:
https://blynk.cloud/external/api/update/property?token=GVki9IC70vb3IqvsV0YD3el4y0OpneL1&pin=V1&isHidden=true
https://blynk.cloud/external/api/update/property?token={token}&pin={pin}&url={index}&url={url}
https://blynk.cloud/external/api/update/property?token=GVki9IC70vb3IqvsV0YD3el4y0OpneL1&pin=V1&url=2&url=https://image%202.jpg
https://blynk.cloud/external/api/update/property?token={token}&pin={pin}&urls={url1}&urls={url2}&urls={url3}
https://blynk.cloud/external/api/update/property?token=GVki9IC70vb3IqvsV0YD3el4y0OpneL1&pin=V1&urls=https://image%201.jpg&urls=https://image%202.jpg&urls=https://image%203.jpg
{server address}*
string
token*
string
pin*
string
{property}
string
The property of the widget you want to update: isHidden
, url
, urls
isHidden
string
true or false
url
string
Replace image by its index. Indexes start from 0. URL should be urlencoded
urls
string
Replace the whole set of images with the new set of URLs. The URLs should be urlencoded
Get from the bottom right of your Blynk console. .
Device from Device info
The datastream (should start with "v")