Postlad/Guides/Tasmota, Shelly and Home Assistant
Send Tasmota, Shelly and Home Assistant readings to a live chart (no code)
If a Tasmota plug, a Shelly relay or Home Assistant already knows the number, you do not need to write firmware to chart it. Each of them can make an HTTP request on a schedule, and one GET request to Postlad is all it takes to put the reading on a live chart you can share or embed.
Reviewed against the official documentation, not yet tested on each device.
The one request every method sends
Everything on this page builds the same URL:
http://api.postlad.com/u?k=YOUR_KEY&f1=23.5&f2=61kis the stream's write key.f1tof16are the values. The only other names accepted aret,statusandfmt.- Any other name is rejected with
error unknown_param:, so&temp=21.4fails. Usef1and name the field "temperature" on the stream page instead. - Values must be plain decimals such as
23.5: no units, no commas. Anything else is rejected and nothing is stored. - Plain
http://works on purpose, because many small devices cannot do HTTPS well. HTTPS also works.
The reply is one line:
ok 4182
error bad_value: f1="unavailable" is not a number. Send a plain decimal like 23.5 (no units, no commas).ok 4182 means stored, with 4,182 readings stored this month. The second line is what Home Assistant gets if it sends a sensor that is unavailable. If you are moving from ThingSpeak, the /update?api_key=KEY&field1=23.5 form is accepted too; see moving a ThingSpeak sketch.
How often to send
The Free plan allows 1 reading every 5 seconds per stream and 100,000 readings a month per account. Faster than every 5 seconds gets an HTTP 429 reply. The monthly total is the limit that usually matters:
| One reading every | Readings in a 31-day month | Fits Free on its own? |
|---|---|---|
| 30 seconds | 89,280 | Yes, but it leaves little for a second stream |
| 60 seconds | 44,640 | Yes, two such streams fit |
| 300 seconds | 8,928 | Yes, with plenty to spare |
A Shelly plug sending every 60 seconds uses 44,640 readings in a 31-day month. Every reading is kept at full detail for 30 days, then an hourly minimum, maximum and average for 12 months.
Field mapping
Postlad fields are numbered. The names and units live on the stream page, so decide the mapping once and keep it:
| Source | f1 | f2 | f3 |
|---|---|---|---|
| Tasmota with a DHT22 (shown as AM2301) | Temperature, °C | Humidity, % | |
| Tasmota energy-monitoring plug | Power, W | Voltage, V | Total energy, kWh |
| Shelly Gen2, Gen3 or Gen4 with power metering | apower, W | voltage, V | aenergy.total, Wh |
| Home Assistant | First sensor you choose | Second sensor | Add more as needed |
| Node-RED | Whatever your function puts there |
Tasmota: a rule with WebSend
Tasmota rules run on the device. A rule can watch the telemetry message Tasmota already produces and send a value with the WebSend command, which makes a plain HTTP request.
1. Find the sensor's name
Open the device's web page, then Console. Rule triggers use the names exactly as they appear in the telemetry JSON. A DHT22 usually appears as AM2301:
{"Time":"2026-11-06T10:15:00","AM2301":{"Temperature":21.4,"Humidity":58.2},"TempUnit":"C"}Running Status 8 in the console shows the same names. A DS18B20 shows up as DS18B20, a BME280 as BME280, and so on.
2. Send one value
Paste this into the console, with your write key:
Rule1 ON Tele-AM2301#Temperature DO WebSend [api.postlad.com] /u?k=YOUR_KEY&f1=%value% ENDONThen enable it and set how often it fires:
Backlog TelePeriod 60; Rule1 1How it works:
Tele-in front of the trigger means "only when the TelePeriod message is sent", so one request goes out per telemetry period. Without it, a rule can also fire on other updates, which can be faster than you want.%value%is replaced with the trigger's value, for example21.4.[api.postlad.com]is the host. The command after it starts with/, so WebSend uses it as the path of the request.TelePeriodsets the telemetry period in seconds, from 10 to 3600. The default is 300.TelePeriod 60means one reading a minute.- A rule is stored but does nothing until
Rule1 1enables it.Backlogruns several commands in order, separated by semicolons.
3. Send two values in one request
Two separate WebSend rules would send two requests within a second, and the second would be refused by the 5-second limit. Keep the first value in a variable and send both together:
Rule1 ON Tele-AM2301#Temperature DO Var1 %value% ENDON ON Tele-AM2301#Humidity DO WebSend [api.postlad.com] /u?k=YOUR_KEY&f1=%var1%&f2=%value% ENDONVar1 %value% stores the temperature, and %var1% puts it back into the URL when the humidity rule fires. The rules in a set are checked in the order you wrote them, so the variable rule goes first.
4. Energy-monitoring plugs
Plugs with power monitoring report an ENERGY object in the same telemetry message. The same pattern sends power, voltage and the running total:
Rule1 ON Tele-ENERGY#Voltage DO Var1 %value% ENDON ON Tele-ENERGY#Total DO Var2 %value% ENDON ON Tele-ENERGY#Power DO WebSend [api.postlad.com] /u?k=YOUR_KEY&f1=%value%&f2=%var1%&f3=%var2% ENDONTasmota reports Total in kWh. A rule set has room for roughly 1,000 characters; if you need more, continue in Rule2.
Tasmota's documentation describes WebSend as sending over HTTP, which is why the examples use the plain HTTP endpoint. Watch the console after the next telemetry period to see the request go out.
Shelly Gen2, Gen3 and Gen4: a script
Shelly devices from the Plus and Pro lines onward (Gen2, Gen3 and Gen4) can run small JavaScript programs on the device. Gen1 devices cannot run scripts, so this section does not apply to them.
Open the device's web page, go to Scripts, create a script, paste this in, put your write key in, save it and start it. Set it to run on startup so it survives a power cut.
// Postlad: send this Shelly's power reading every 60 seconds.
let POSTLAD_KEY = "YOUR_KEY";
let EVERY_MS = 60 * 1000; // 60 s = 44,640 readings in a 31-day month
function sendReading() {
let sw = Shelly.getComponentStatus("switch:0");
if (sw === null || typeof sw.apower !== "number") {
print("switch:0 has no power reading on this device");
return;
}
let url = "http://api.postlad.com/u?k=" + POSTLAD_KEY +
"&f1=" + sw.apower +
"&f2=" + sw.voltage +
"&f3=" + sw.aenergy.total;
Shelly.call("HTTP.GET", { url: url, timeout: 10 }, function (result, error_code, error_message) {
if (error_code !== 0) {
print("request failed: " + error_message);
return;
}
print("HTTP " + result.code + ": " + result.body);
});
}
Timer.set(EVERY_MS, true, sendReading);Shelly.getComponentStatus("switch:0")returns the first switch's status, ornullif there is no such switch. On a device with several channels, use"switch:1"and so on.apoweris the instantaneous power in watts,voltageis in volts, andaenergy.totalis the total energy in watt-hours. These fields only exist on switches with power metering, which is why the script checks first.Timer.set(EVERY_MS, true, sendReading)runs the function every 60,000 milliseconds. Thetruemakes it repeat.Shelly.call("HTTP.GET", …)makes the request. The callback receives the result, an error code (0 means no error) and an error message. The reply text is inresult.body.
Open the script's log in the web page to see each HTTP 200: ok N line. Energy meters that use a different component, such as the Pro 3EM, report under other names and need a different status call.
Home Assistant: rest_command and an automation
Home Assistant already has the readings. A rest_command defines the request, and an automation calls it on a timer.
1. Define the request
Add this to configuration.yaml. The URL is a template, so {{ f1 }} and {{ f2 }} are filled in by whatever calls it:
# configuration.yaml
rest_command:
postlad_greenhouse:
url: "http://api.postlad.com/u?k=YOUR_KEY&f1={{ f1 }}&f2={{ f2 }}"
method: get
timeout: 10Restart Home Assistant after adding rest_command for the first time. After later edits, the rest_command.reload action reloads the commands from YAML.
2. Call it on a schedule
Create a new automation, switch the editor to YAML, and paste this, using your own sensor entity IDs:
alias: Send greenhouse readings to Postlad
triggers:
- trigger: time_pattern
minutes: "/5"
conditions:
- condition: template
value_template: >
{{ states('sensor.greenhouse_temperature') | is_number
and states('sensor.greenhouse_humidity') | is_number }}
actions:
- action: rest_command.postlad_greenhouse
data:
f1: "{{ states('sensor.greenhouse_temperature') }}"
f2: "{{ states('sensor.greenhouse_humidity') }}"
mode: singleminutes: "/5"fires every 5 minutes, at minutes divisible by 5. Keep the quotes. Use"/1"for every minute.- The condition only lets the request through when both sensors hold numbers. A sensor that has dropped off reports
unavailableorunknown, Postlad rejects that with a 400 and stores nothing, and the condition saves the wasted request. - The
datavalues become thef1andf2variables in the URL template.
This is the syntax used in the current Home Assistant documentation (triggers:, - trigger:, actions:, - action:). Older installations used platform: and service: instead. Units are not sent; set them on the Postlad stream page.
Node-RED: inject, function, http request
Node-RED needs three nodes, plus a debug node to see the reply:
- Inject: set it to repeat at an interval, every 60 seconds. For a first test, give it a JSON payload like the one below. Later, replace it with the node that produces your real readings.
- Function: paste the code below.
- http request: method GET, URL left empty, return a UTF-8 string. When the URL is not set in the node, it uses
msg.url. - Debug: shows
msg.payload, which is Postlad's reply, andmsg.statusCode.
{"temperature": 21.4, "humidity": 58}// Function node: turn {temperature, humidity} into a Postlad request.
const POSTLAD_KEY = "YOUR_KEY";
const p = msg.payload || {};
const f1 = parseFloat(p.temperature);
const f2 = parseFloat(p.humidity);
if (!Number.isFinite(f1) || !Number.isFinite(f2)) {
node.warn("Not sent, values are not numbers: " + JSON.stringify(p));
return null;
}
msg.url = "http://api.postlad.com/u?k=" + encodeURIComponent(POSTLAD_KEY) +
"&f1=" + f1 + "&f2=" + f2;
return msg;Returning null stops the message, so a missing or non-numeric value is skipped with a warning instead of turning into a rejected request.
URL encoding
- Plain decimals such as
21.4or-3.25need no encoding. - The optional
statustext, up to 120 bytes, does. Spaces and symbols must be encoded:status=door%20open. In Home Assistant use theurlencodefilter, and in Node-REDencodeURIComponent(). On Tasmota and Shelly, keep status text to letters and digits, or leave it out. Only the latest status is kept. - Never send a value with a unit or a thousands separator.
1,250and21.4°Care both rejected.
Keep the write key safe
The write key can add readings to one stream. It cannot read anything or change your account, but anyone who has it can write junk into your chart.
- The key sits in plain text in a Tasmota rule, a Shelly script, Home Assistant's
configuration.yamland a Node-RED flow. Set a password on the device web pages, and treat configuration backups and exported flows as private. - Replace the key with
YOUR_KEYbefore posting a rule, script or flow on a forum. - Share the chart with a public or secret read link. Viewers never need the key.
- Rotate a key that has leaked.
Troubleshooting
Tasmota: nothing happens
Check that the rule is enabled (Rule1 on its own shows its state), that the sensor name matches the telemetry JSON exactly, and wait for a full TelePeriod. The console logs rule activity when the rule fires.
Shelly: the log says switch:0 has no power reading
The device has no power metering on that channel, or its component has another name. Check the device's status page for the right component.
Home Assistant: the automation runs but nothing arrives
Open the automation's trace. If the condition stopped it, one of the sensors was not a number. If the action ran, check the entity IDs and that Home Assistant was restarted after adding rest_command.
The reply is 429
Two requests reached the same stream less than 5 seconds apart. Combine the values into one request, or send less often.
FAQ
Can Tasmota send sensor data to a server without MQTT?
Yes. A rule with WebSend makes an HTTP request on each telemetry period, and Postlad accepts the reading from the URL. No broker is needed.
How do I log a Shelly plug's power usage?
On a Gen2, Gen3 or Gen4 device, a short script reads apower, voltage and aenergy.total from switch:0 and sends them with HTTP.GET on a timer. Every 60 seconds uses 44,640 readings in a 31-day month.
Why does Home Assistant get a 400 error?
Usually because a sensor was unavailable or unknown, and Postlad only accepts plain decimals. Add a condition that checks both values with is_number before the request is sent.
Can I use my own field names like temp in the URL?
No. Only k, f1 to f16, t, status and fmt are accepted, and any other name is rejected. Name the fields on the stream page instead.
Do viewers need a Home Assistant or Postlad account?
No. Share the stream's public or secret link, or embed the chart. Viewers need neither an account nor access to your network.
Create the stream
Create a free account, make a stream, copy its write key into the rule, script, YAML or flow above, and name the fields to match.
Related guides
- Send sensor data over the HTTP API: every parameter and reply in one place.
- Embed a live sensor chart: put the chart on a web page or dashboard.
- Sensor data in Google Sheets: get the same readings into a spreadsheet.
- ESP32 greenhouse monitor: soil, air and light from one board.
- Raspberry Pi data logger: when the readings come from a script.
- Build a room monitor: a complete temperature and humidity installation.
- All guides
Sources and verification
- Tasmota commands (WebSend, Backlog, TelePeriod, Rule): https://tasmota.github.io/docs/Commands/
- Tasmota rules (triggers,
Tele-,%value%, variables): https://tasmota.github.io/docs/Rules/ - Shelly script API (Shelly.call, Shelly.getComponentStatus): https://shelly-api-docs.shelly.cloud/gen2/Scripts/APIs/Shelly
- Shelly Timer API: https://shelly-api-docs.shelly.cloud/gen2/Scripts/APIs/Timer
- Shelly Switch component status: https://shelly-api-docs.shelly.cloud/gen2/ComponentsAndServices/Switch
- Shelly HTTP component: https://shelly-api-docs.shelly.cloud/gen2/ComponentsAndServices/HTTP
- Home Assistant RESTful Command: https://www.home-assistant.io/integrations/rest_command/
- Home Assistant time pattern trigger: https://www.home-assistant.io/triggers/time_pattern/
- Home Assistant
is_number: https://www.home-assistant.io/template-functions/is_number/ - Node-RED http request node: the node's built-in help in the Node-RED editor.