Let's use Adafruit IO’s new (Blockly-based) Actions to show the values of the sensors on the OLED display.
Navigate to the Actions page on Adafruit IO. Click New Action.
Give your action a name (I named mine Greenhouse Monitor) and click Create.
Let's configure this workflow to execute every 15 minutes.
To do this, expand the Block Toolbox by clicking Triggers and select the Schedule block.
Drag the Schedule block under the Triggers workflow. By default, it is configured to execute every 15 minutes.
Modifying Sensor Values
The BME688 produces precise measurements. However, these measurements often have too many decimal points to display on an OLED.
Before displaying these sensor values, we are going to take these measurements and round them to fit on the OLED's screen.
We'll need to store the component's feed value in a variable. Once we do that, we can modify the variable (in order to truncate it to a specific number of decimal places) and then reference when we print it to the display.
On the Toolbox, Click the Variables tab.
Click Create New Variable.
Enter the name temperature
.
On the Toolbox, Click the Math tab
Drag the Round block to the right side of the Set Variable block's "=" sign
On the Toolbox, Click the Feeds tab.
Drag the Get Feed block to the diagram and place it inside the Round Block.
Set the feed to QT Py S3: BME680 Temperature Sensor.
When the Actions' Actions section runs, it will set the variable to the last value saved to the feed (i.e: the most recent temperature value from the BME688).
Ensure your diagram should looks like the following screenshot before moving on:
Next, repeat the steps above for the BME688's humidity sensor and TVOC sensor.
Your diagram should look like the following.
Showing Temperature Values on the Display
Finally, we'll want to print the temperature values to the display.
- If you do not have an OLED - the process for this is the same for any "Display Component" in Adafruit IO.
Like the sensors component, the OLED component is an Adafruit IO Feed that you can write to. What's displayed on the OLED is the last value written to the feed.
On the Toolbox, Click the Feeds tab.
Drag the Set Feed block to the diagram and place it underneath your Actions
Set the feed to QT Py S3: 128x64 OLED (Large Font).
Next, we'll use a combination of a the template block and paragraph block to display formatted values (the variables from the sensor and static text)
On the Toolbox, Click the Text tab.
From the Text tab, select the Template block.
Drag the Template block to the diagram and place it inside the Set Feed Block.
To tell the display what to show, you'll need to write to the paragraph block. This block lives within the Template block but is presently grayed out.
The 128x64 OLED's Large Font mode can write up to 4 lines of text on the display.
For the first line of the paragraph block, I added a label called Greenhouse. The next 3 lines of the display are populated with the temperature, humidity and TVOC values.
To render a variable on the display, you'll reference a variable by using the following syntax: {{vars.variable}}
.
The string rendered by the following line:
T:{{ vars.temperature }}°F
Would look like this on the display:
T: 74°F
The snippet below is the value of the paragraph block, used by this project.
GREENHOUSE T:{{ vars.temperature }}°F H:{{ vars.humidity }}% TVOC:{{ vars.tvoc }} ppb
After placing the text above within the paragraph block, the final Action should look like the following screenshot.
With the Action complete, let's move on to using it!
Page last edited July 07, 2025
Text editor powered by tinymce.