Docs
Image
The Image widget shows a picture from a URL.
Use it for: a camera snapshot, a diagram of your wiring, a floor plan, a status graphic that changes with the state.
| Setting | What it does |
|---|---|
| Pin | the virtual pin that selects the image |
| URLs | the list of images, one per index |
| Scale | how the picture fits the tile |
Open these from the canvas: tap Edit, then long press the widget and choose Configure.
Example
Send an index and the widget swaps the picture.
#include <PlynxSimpleEsp32.h>
#define DOOR_PIN 4
PlynxTimer timer;
bool wasOpen = false;
void checkDoor()
{
bool isOpen = digitalRead(DOOR_PIN) == HIGH;
if (isOpen != wasOpen) {
Plynx.virtualWrite(V33, isOpen ? 2 : 1); // 1 closed, 2 open
wasOpen = isOpen;
}
}
void setup()
{
Serial.begin(115200);
pinMode(DOOR_PIN, INPUT_PULLUP);
// Auto setup: WiFi and the Plynx token are configured from the app.
//
// To provide them directly in the sketch instead, use:
// Plynx.begin(auth, ssid, pass);
Plynx.begin();
timer.setInterval(2000L, checkDoor);
}
void loop()
{
Plynx.run();
timer.run();
} Indexes start at one, matching the order of the URLs in the widget settings.
The image loads from the internet on the phone. A URL on your home network works at home and shows nothing when you are out.
Troubleshooting
| Problem | Check |
|---|---|
| Tile stays blank | the URL is unreachable from the phone, or needs a login |
| Picture never changes | the index sent does not match a URL in the list |
| Image is stale | the phone cached it; add a changing query to the URL |
| Loads slowly | the file is large; a dashboard tile needs a small picture |