Docs
Labeled Value
The Labeled Value widget shows a reading with its name beside it, on one line.
Use it when the dashboard has many readings and you want them stacked in rows rather than spread across tiles. The Value Display widget puts the name above the number, this one puts it in front.
| Setting | What it does |
|---|---|
| Pin | the virtual pin your code writes to |
| Label | the name shown before the value |
| Decimals | how many digits after the point |
| Unit | text appended to the number |
Open these from the canvas: tap Edit, then long press the widget and choose Configure.
Example
Three readings in three rows.
#include <PlynxSimpleEsp32.h>
PlynxTimer timer;
void sendReadings()
{
Plynx.virtualWrite(V29, analogRead(34) * (3.3 / 4095.0) * 100.0);
Plynx.virtualWrite(V30, analogRead(35) * 100.0 / 4095.0);
Plynx.virtualWrite(V31, millis() / 60000);
}
void setup()
{
Serial.begin(115200);
// 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(10000L, sendReadings);
}
void loop()
{
Plynx.run();
timer.run();
} The sketch is the same as for a Value widget. Only the layout in the app changes, so you can swap one for the other without touching the code.
Set the unit in the widget rather than building it into the string, or the value stops being a number.
Troubleshooting
| Problem | Check |
|---|---|
| Widget stays empty | nothing calls virtualWrite() on that pin |
| Label and value overlap | shorten the label, or use a wider widget |
| Too many digits | set Decimals in the widget settings |