Skip to main content
Goal: make your product remember and react — persist readings, then automate a response.

1. Create a table

In your product’s Studio, open Monitor → Database and create a schema with a readings table (e.g. a temperature column). See Database.

2. Store a reading

Real hardware — insert from firmware:
device.insertDatainDatabase(productId, deviceId, "readings", [](JsonObject &row) {
  row["temperature"] = readTemperature();
});
Read it back with getDatabaseData(productId, "readings", 20), or show it on the dashboard with a Table or Chart widget bound to the table.
No hardware? The Database API and the dashboard Database Form widget can write records too.

3. Add a rule

Now automate a reaction. As a user of the product, open the app’s Rules tab and build an if / then:
IF   temperature > 30
THEN send Operate → ON      (turn on the fan/pump/etc.)
ELSE send Operate → OFF
That’s conditional automation with no code — the same Operate command you’ve used since Lesson 1, now fired automatically.
Readings landing in the readings table, and a rule that acts on them.

Next: publish & onboard

Ship it to users.