Building a Report
Choose metrics, a time window, a schedule, and a message format
A report is built in four steps: Destination, Metrics, Schedule, and Review. Use Preview at any time to see the rendered Telegram message.
Before you begin
- Connect a Telegram integration.
- The device should have sent the fields you want to report on, so they can be picked from a list.
Steps
Open Integrations, click your Telegram integration, and open its Reports tab.
Click New report.
Work through the four steps below, then save. Leave Enabled on for the schedule to run.
1. Destination
Give the report a name (it appears in the message) and pick the Device to summarize.
2. Metrics
Add one metric per number you want in the report:
| Setting | Options |
|---|---|
| Field | The telemetry field, for example energy. If the device hasn't reported yet, type the field name |
| Aggregation | Total (sum), Average, Minimum, Maximum, Latest value, or Count |
| Format (optional) | A label, prefix, unit, and number of decimal places |
Use Total (sum) for counters that report increments (energy used, liters flowed), and Latest value for meters that report a running total.
3. Schedule
Time window (the period each report covers):
| Window | Covers |
|---|---|
| Last 24 hours / Last 7 days / Last 30 days / Last 90 days | A rolling period ending when the report is built |
| Previous calendar month | The whole of last month |
| Current month (to date) | From the 1st of this month until now |
Frequency:
| Frequency | Extra setting |
|---|---|
| Daily | Hour of day |
| Weekly | Day of week and hour |
| Monthly | Day of month and hour |
| On demand only | None. It runs only when you press Run now, or Build now in Telegram |
Choose a Timezone. The schedule runs, and times are shown, in that timezone.
"Build now" period. The window used when someone presses Build now on a delivered message. Leave it on Same as report period, or pick another, for example Current month (to date) on a daily report.
4. Review: message format
| Format | Result |
|---|---|
| Simple | Each metric as a labelled line, formatted for you |
| Template | Your own text with tokens: {report_name}, {device_name}, {report_period}, {generated_at}, plus one token per metric. Click a token to insert it. Unknown tokens are left unchanged |
| Custom (JSON) | A raw JSON body |
Template example
{report_name}
{device_name} · {report_period}
Energy: {energy_total}
Peak: {power_max}
Generated {generated_at}(Metric token names come from your metrics. The editor lists the exact tokens you can use.)
Troubleshooting
| Message or symptom | Cause | Fix |
|---|---|---|
| Maximum 50 reports per tenant | The workspace has 50 reports | Delete reports you no longer need |
| Unknown device field(s): … | A metric uses a field the device has never sent | Check the spelling against the device's Latest Telemetry |
| TEMPLATE format requires a template | Template is chosen, but the message is empty | Write the template, or switch to Simple |
| Invalid timezone: … | The timezone isn't recognized | Pick one from the list |
| Telegram channel is missing botToken or chatId | The Telegram integration is incomplete | Edit the integration and fill in both |
| Telegram says "Failed to build" after Build now | The report couldn't be built | Open the report in Sensorclouds and click Run now to see the error |
| The report arrives with empty values | The device sent nothing in the window | Check the device's Live Data, or choose a longer window |
| Scheduled reports stop arriving | The report or the integration is disabled | Turn both back on |