-
Notifications
You must be signed in to change notification settings - Fork 3
Webhooks
polluSensWeb can send parsed readings to any HTTP endpoint — your own server, Home Assistant, Node-RED, InfluxDB gateways, sensor.community-style APIs, or a test service like webhook.site.
- Tick Enable Webhook Sending in the Webhook card.
- Enter the Webhook URL.
- Choose the HTTP method:
GET,POSTorPUT(GETsends no body). - Set the interval in seconds.
0= send on every valid packet. - Click Test Send Webhook Now to check it.
ℹ️ How requests are routed: browsers block most cross-origin requests, so webhooks are sent through a CORS proxy (
PROXY_URLinpollusensweb.js, by defaulthttps://pollutants.eu/proxy/proxy.php). Your readings and headers pass through that proxy. If that matters to you, run your own proxy — see Self-Hosting and Local Use. Rate limiting is active; a429error means you should increase the interval.
The same template engine processes headers and body.
| Placeholder | Replaced with |
|---|---|
{{ts}} |
Current timestamp (ISO 8601) |
{{field:<signal name>}} |
Value of one signal |
{{#fields}} … {{/fields}} |
Loop over all signals (body only), using {{key}} and {{value}} inside |
The signal name is the name shown in the chart signal list without the unit. For PM2.5 x0.4 calibrated [μg/m³], use {{field:PM2.5 x0.4 calibrated}}.
Placeholders for fields that don't exist are replaced with null.
Add headers with + Add header.
| Key | Value | Result |
|---|---|---|
X-PM25 |
{{field:PM2.5}} |
X-PM25: 12.3 |
X-TIME |
{{ts}} |
X-TIME: 2025-12-09T12:34:56Z |
Content-Type |
application/json |
Content-Type: application/json |
{
"software_version": "polluSensWeb 1.0",
"timestamp": "{{ts}}",
"sensordatavalues": [
{{#fields}}
{ "value_type": "{{key}}", "value": "{{value}}" }
{{/fields}}
]
}For a packet with PM1: 1.5, PM2.5: 12.3, PM10: 20.1 this becomes:
{
"software_version": "polluSensWeb 1.0",
"timestamp": "2025-12-09T12:34:56.789Z",
"sensordatavalues": [
{ "value_type": "PM1", "value": 1.5 },
{ "value_type": "PM2.5", "value": 12.3 },
{ "value_type": "PM10", "value": 20.1 }
]
}{
"pm25": {{field:PM2.5}},
"pm10": {{field:PM10}},
"time": "{{ts}}"
}Resulting request:
POST https://webhook.site/xxxxxx
X-PM25: 12.3
X-Time: 2025-12-09T12:34:56Z
Content-Type: application/json
{ "pm25": 12.3, "pm10": 20.1, "time": "2025-12-09T12:34:56Z" }
- Test with https://webhook.site first to see exactly what is sent.
- Avoid interval
0with fast sensors unless your endpoint can handle one request per packet. - Webhooks are the only feature that needs a network connection after the page has loaded.
polluSensWeb · MIT License · Repository · Report an issue
Using the app
Sensor definitions
Sensor notes
Deployment
Help