Skip to content

Cookie preferences

We use cookies for our own analytics, to see how our campaigns perform and, if you allow it, to load content from other services such as the Google site search. We never sell your data. Necessary cookies keep the site working and cannot be switched off. See our Cookie Policy for details and our Privacy Policy for how we handle personal data.

Security, load balancing and remembering your cookie choice.

Show us which pages people read and how they find the site, so we can improve it (Google Analytics).

Show us which of our ad campaigns bring visitors to the site and remember the campaign or partner link you arrived from (Google Ads, partner program). We do not use these cookies to build advertising profiles.

Load the site search from Google when you use it. Google sets its own cookies and shows ads in the search results.

© 2026 The ThingsBoard Authors
Try for free

ThingsBoard Cloud

Choose your data region

Your data stays in the region you choose, for residency and compliance. No credit card required.

Rather run it yourself? Install on your own servers

Thermostat widget

  • Widget
  • 597 installs
  • v1.0.0
  • Jun 15, 2026
  • MIT license
  • v4.2+

Interactive temperature scroller with a draggable ruler. Displays the current temperature from your datasource and lets users set a new target by scrolling left/right (mouse, touch, or wheel). The selected value is automatically saved as an attribute on the device, with debounced writes to avoid spamming the server. Fully themeable — colors, fonts, range, tick density, and an optional auto-scale mode that adapts the font to any widget size.

Widget Type
  • Latest
Category
  • Input Forms
  • Controls
Use Cases
  • Smart Energy
  • Smart Metering
  • Smart Building
  • Smart City
  • Smart Office
  • Tank Level Monitoring
  • Waste Management

Who it’s for

Building managers, smart home owners and energy managers ask “how do I let an operator move the temperature setpoint from a dashboard instead of walking to the thermostat?” The thermostat widget puts the live reading and a drag-to-set ruler in one control, so the current value and the target are read in the same glance.

What it does

A device reporting temperature = 18°C shows that value above a draggable ruler. Dragging the ruler to 19 writes targetTemperature = 19 to the device as a shared attribute, which is where an HVAC controller reads its setpoint from. The displayed temperature keeps following telemetry as new readings arrive.

  • Live temperature taken from the widget’s datasource key
  • Drag-to-set ruler that saves straight to a device attribute, with no separate form or RPC to wire up
  • Ruler bounds you choose, so the control can be held inside the band a building’s energy policy allows
  • Sets one entity’s setpoint per widget; tile one widget per zone rather than expecting a zone selector

How to set up

Data keys

KeyRoleTypeDescription
temperatureMain valueTimeseriesThe reading shown above the ruler; change the key name to match your device’s telemetry key

The widget ships with a simulated function datasource key labeled Random, so it draws random values until you point the datasource at a device and rename the key.

To point it at your own device: open the dashboard in edit mode, open the widget’s Datasources, pick the entity or entity alias, and replace the function key with the key your device reports.

The setpoint is not a data key — it is named in the settings below and written by the widget, so nothing has to be added to the datasource for the ruler to work:

AttributeScopeOperationDescription
targetTemperatureSharedWriteThe value the ruler saves. Attribute key to save renames it and Attribute scope moves it to client or server scope

Widget settings

SettingDefaultEffect
Attribute key to savetargetTemperatureThe attribute the ruler writes to — set it to the key your controller reads
Attribute scopeSharedScope the setpoint is written in
Min temperature-20Lowest value the ruler can reach
Max temperature20Highest value the ruler can reach
Save debounce (ms)0How long a drag settles before it is saved; raise it so dragging across the ruler writes once instead of at every step
Pixels per degree10Ruler scale — a larger value makes each degree a longer drag
Major tick every (0 = auto)0Spacing of the labeled ticks; auto derives it from the range
Background color#FFFFFFCard background behind the ruler

How to customize

  • To hold the setpoint inside a policy band — narrow Min temperature and Max temperature (the shipped range is -20 to 20), so an occupant cannot ask for a target the plant will not serve.
  • To make the ruler less twitchy — raise Pixels per degree; each degree then takes a longer drag.
  • To thin out the ruler labels — set Major tick every (0 = auto) to a fixed spacing instead of letting it be derived from the range.
  • To match your dashboard’s colors — set Background color, Temperature text color, Indicator color, Major tick color, Minor tick color and Tick label color.
  • To change the fonts — set Temperature font and Tick label font, and turn on Auto scale temperature font if the widget is resized across breakpoints.

Tips

  • Place this widget next to a temperature chart card so the operator sees the recent trend before moving the setpoint — it cuts the changes that overshoot and get reversed ten minutes later.
  • Raise Save debounce (ms) above zero on any deployment where the write goes over a slow link: at the default the ruler saves on every step of the drag.
  • For multi-zone buildings, give every zone’s widget the same Min temperature and Max temperature so the setpoints stay comparable at a glance.

Share Your Widget with the Community

Built a custom widget? Export it as a JSON from ThingsBoard and publish it to the IoT Hub through a simple 4-step wizard (Upload, Listing, Readme, Review & Submit). Share it with thousands of ThingsBoard developers worldwide and get featured in the catalog.