Skip to content
You Start with one site
Amounts in Start with one site
IoT & AIoT · Course

Read your history and share it

Lesson 8 of 9 Beginner 10 min read
Found this useful?

An inspector asks: "Was the cold room in range all of last week?" A client asks: "How often did the pump fail this month?" Your device has been reporting every 30 seconds, so the answer exists, but a live number on a phone cannot give it. If nobody can find, read and show the history, all those readings were sent for nothing. This lesson turns them into answers you can hand to someone.

#IoT #Data #Sharing

Where the history lives

On siliconwit.io, our monitoring service, each device page has five tabs:

  • Insights: the latest reading, the charts, figures for the time range you pick, and a weekly summary in plain words.
  • Data: every reading with its time, and the download buttons.
  • Control: commands and their history, for a device that accepts commands.
  • Automation: the alerts and rules for this device.
  • Settings: name, fields, commands, sharing, the public page, and the Access Token.

A chart can show the last hour, 6 hours, 24 hours, 7 days, 30 days, 90 days, 180 days or a year, or dates you choose, as far back as your plan keeps history. The free plan keeps 7 days. On a broker you run, the history is wherever you store it; the real-time dashboards lesson builds that store.

Read a chart honestly

A chart is easy to look at and easy to misread. Four things to check before you draw a conclusion:

  • The status first. A device that is not reporting shows its last reading, and the time since it arrived. A flat, calm line can simply mean nothing arrived. "Last data 6 h ago" changes the meaning of everything on the screen.
  • Gaps. A gap is time with no readings: a power cut, an outage that was too long for the device's memory, or a sensor that failed its sanity check. Do not read the line drawn across a gap as data.
  • The range. A 1 hour chart makes a 0.3 °C wobble look like a storm. A 30 day chart hides a 10 minute spike. Look at the range that matches the question.
  • Repeating shapes. A rise every afternoon is a pattern with a cause: sun on a wall, a daily delivery, a shift change. A slow climb over weeks is drift: a dirty filter, a failing seal, a sensor that needs checking.
Your turn: the afternoon bump

The 7 day chart of a cold room shows the temperature rise from 4.5 °C to about 7 °C at around 14:00 every weekday, and fall back within 20 minutes. On Saturday and Sunday there is no bump. What is the likely cause, and is it a problem?

Show the answer, 2 steps
  1. The cause

    A weekday-only rise at the same hour points to people, not machines: most likely the daily delivery with the door held open. Ask the site before you change anything. ✅

  2. Is it a problem?

    Not yet: it stays below 8 °C and recovers quickly. But now you know the normal shape, so your alert can wait longer than 20 minutes and still catch a real fault. Reading the history made the alert better. ✅

Download the readings

On the Data tab you can download the readings as CSV or JSON, up to 1,000 rows per download. At one reading every 5 minutes, 1,000 rows is about 3.5 days; at one every 30 seconds, about 8 hours. Paid plans also have an API for longer records and for other programs. Download what you need before you change plans: when a paid plan ends, readings older than the free history window are deleted 3 days later.

A CSV opens in any spreadsheet. A few lines of Python answer the inspector's question directly and the same way every time:

# summary.py: what a downloaded file of readings says about one field
import csv
FILE = "readings.csv" # the CSV from the device's Data tab
FIELD = "temperature" # the column to check
LIMIT = 8.0 # the most it may be, here a cold room at 8 C
EVERY_MIN = 5 # the device's data interval, in minutes
values = []
with open(FILE, newline="") as f:
reader = csv.DictReader(f)
print("columns:", reader.fieldnames) # check the names once
for row in reader:
cell = (row.get(FIELD) or "").strip()
if cell: # skip readings without this field
values.append(float(cell))
above = [v > LIMIT for v in values]
longest = run = 0
for a in above: # the order of the file does not change this
run = run + 1 if a else 0
longest = max(longest, run)
print(f"{len(values)} readings, {min(values):.1f} to {max(values):.1f}, mean {sum(values) / len(values):.2f}")
print(f"above {LIMIT}: {sum(above)} readings, about {sum(above) * EVERY_MIN} minutes")
print(f"longest time above: {longest} readings in a row, about {longest * EVERY_MIN} minutes")

The script prints the column names first. Check them once against your file and change FIELD if yours differ. The longest run counts readings in a row in the order of the file, and newest first or oldest first gives the same answer.

Worked example

You download 1,000 rows from a cold room that reports every 5 minutes, and run the script. What do you tell the inspector?

columns: ['time', 'temperature', 'humidity']
999 readings, 3.2 to 10.1, mean 4.56
above 8.0: 12 readings, about 60 minutes
longest time above: 9 readings in a row, about 45 minutes
Show the worked solution, 4 steps
  1. How much is covered

    999 readings × 5 minutes = 4,995 minutes, about 3.5 days. One row had no temperature, so it was skipped. Say which days the file covers, and nothing beyond them. ✅

  2. How long it was out of range

    12 readings above 8 °C × 5 minutes = about 60 minutes in total, out of about 83 hours. ✅

  3. The worst single event

    9 readings in a row = about 45 minutes above 8 °C in one go, reaching at most 10.1 °C. The other 3 readings above the limit were short, single spikes. ✅

  4. The honest answer

    "In these 3.5 days the room was above 8 °C for about an hour in total. One event lasted about 45 minutes and peaked at 10.1 °C; we can show you when it was on the chart." A clear number, its limits, and the evidence. ✅

Share a device with people

A device is private until you share it. On the Settings tab, under Device Sharing, you add a person by the email of their siliconwit.io account and choose what they may do:

LevelThey canGive it to
Viewsee the readings and chartsa client, a manager, an inspector
Controlview, and send commandsthe technician on duty
Admincontrol, and change the settingsa partner who runs the device with you

Only the owner can manage sharing or delete the device. You can hide single fields from a person, so a client sees the temperature but not, say, the battery level. When you remove someone, their access ends at once. The free plan shares each device with up to 2 people.

Give the lowest level that does the job. A client who can only view cannot switch off your pump by mistake.

Give it a public page

A public page lets anyone with the link watch the device live, with no account: a client checking on a job, an employer looking at your work, a class following an experiment. It is the only way a device's readings become public, and it happens only if you turn it on, on the Settings tab under Public Sharing. Before a device can go public you need a public profile (a display name), a description of at least 20 characters, an icon and at least one category.

  • The link looks like siliconwit.io/d/your-slug. On the free plan the slug is made for you; paid plans can choose it.
  • Visitors see the device name and description, the latest visible readings, the charts, a data table, whether it is reporting, and a map if it has GPS fields.
  • Visitors never see the Access Token, the settings, the rules or who it is shared with. You can hide fields from the public page too.
  • Commands stay hidden unless you choose, one by one, the commands that are safe for anyone to use, and how long that stays on.
Never make a command public if a stranger could cause harm with it. A public "relay on" on a pump, a heater or a door lock is an open invitation. If you allow any public control, the device's own limits must make every command safe, as the firmware lessons showed. A light in a demo is fine. A pump on a farm is not.

To put the live values on a website of your own, use the embed link, siliconwit.io/d/your-slug/embed, in an iframe. It shows the name, the status and the latest values, refreshes every 30 seconds, and needs no sign-in:

<iframe src="https://siliconwit.io/d/your-slug/embed"
width="360" height="220" style="border:0" loading="lazy"
title="Cold room, live"></iframe>

Common mistakes

  • Reading the line across a gap. The chart joins the points on either side. The real values in between are unknown.
  • Admin for everyone. Each extra admin is one more person who can change a limit or delete a field. View is enough for most people.
  • Sharing the Access Token instead of the device. The token lets someone publish as the device. Share the device with their account, or share the public page.
  • Waiting to download. History beyond your plan's window is not kept. If a month matters, download it while it is there.

Check yourself

Question 1

The chart shows a calm, flat line for the last 6 hours. What do you check before you say "all fine"?

Question 2

A device reports every 5 minutes. In a download, 18 readings in a row are above the limit. About how long was it above?

Question 3

A client should follow the readings but must never switch anything. Which access do you give?

Question 4

What can a visitor to a device's public page never see?

Key points
  • The history answers "what happened". Check the status and the gaps before you trust a line.
  • Download readings as CSV or JSON (up to 1,000 rows each), and answer questions with a script that gives the same answer every time.
  • Share with the lowest level that works: View, Control or Admin. Never share the token.
  • A public page shows readings, never the token or settings. Make a command public only if no stranger could cause harm with it.

You now have every piece: a trusted reading, a link that survives a real site, alerts, commands, and a record. The last lesson puts them into one node that you can leave on a site and trust.

Found this useful?

Discussion