Ecowitt weather station webhook receiver
curl --request POST \
--url http://0.0.0.0:3000/v1/webhooks/ecowitt/{webhookId} \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data PASSKEY=abc123 \
--data 'dateutc=2024-01-15 12:00:00' \
--data tempf=72.5 \
--data humidity=55 \
--data baromrelin=29.92import requests
url = "http://0.0.0.0:3000/v1/webhooks/ecowitt/{webhookId}"
payload = {
"PASSKEY": "abc123",
"dateutc": "2024-01-15 12:00:00",
"tempf": "72.5",
"humidity": "55",
"baromrelin": "29.92"
}
headers = {"Content-Type": "application/x-www-form-urlencoded"}
response = requests.post(url, data=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/x-www-form-urlencoded'},
body: new URLSearchParams({
PASSKEY: 'abc123',
dateutc: '2024-01-15 12:00:00',
tempf: '72.5',
humidity: '55',
baromrelin: '29.92'
})
};
fetch('http://0.0.0.0:3000/v1/webhooks/ecowitt/{webhookId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "3000",
CURLOPT_URL => "http://0.0.0.0:3000/v1/webhooks/ecowitt/{webhookId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "PASSKEY=abc123&dateutc=2024-01-15%2012%3A00%3A00&tempf=72.5&humidity=55&baromrelin=29.92",
CURLOPT_HTTPHEADER => [
"Content-Type: application/x-www-form-urlencoded"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "http://0.0.0.0:3000/v1/webhooks/ecowitt/{webhookId}"
payload := strings.NewReader("PASSKEY=abc123&dateutc=2024-01-15%2012%3A00%3A00&tempf=72.5&humidity=55&baromrelin=29.92")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/x-www-form-urlencoded")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("http://0.0.0.0:3000/v1/webhooks/ecowitt/{webhookId}")
.header("Content-Type", "application/x-www-form-urlencoded")
.body("PASSKEY=abc123&dateutc=2024-01-15%2012%3A00%3A00&tempf=72.5&humidity=55&baromrelin=29.92")
.asString();require 'uri'
require 'net/http'
url = URI("http://0.0.0.0:3000/v1/webhooks/ecowitt/{webhookId}")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/x-www-form-urlencoded'
request.body = "PASSKEY=abc123&dateutc=2024-01-15%2012%3A00%3A00&tempf=72.5&humidity=55&baromrelin=29.92"
response = http.request(request)
puts response.read_body{
"status": "ok"
}{
"error": "Invalid webhook ID"
}{
"error": "Invalid PASSKEY"
}{
"error": "Config entry not found"
}{
"error": "Internal error"
}Webhooks
Ecowitt weather station webhook receiver
Receives weather sensor data from Ecowitt stations via form-urlencoded POST. Validates the webhookId and optional PASSKEY, then persists state and publishes via MQTT.
POST
/
v1
/
webhooks
/
ecowitt
/
{webhookId}
Ecowitt weather station webhook receiver
curl --request POST \
--url http://0.0.0.0:3000/v1/webhooks/ecowitt/{webhookId} \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data PASSKEY=abc123 \
--data 'dateutc=2024-01-15 12:00:00' \
--data tempf=72.5 \
--data humidity=55 \
--data baromrelin=29.92import requests
url = "http://0.0.0.0:3000/v1/webhooks/ecowitt/{webhookId}"
payload = {
"PASSKEY": "abc123",
"dateutc": "2024-01-15 12:00:00",
"tempf": "72.5",
"humidity": "55",
"baromrelin": "29.92"
}
headers = {"Content-Type": "application/x-www-form-urlencoded"}
response = requests.post(url, data=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/x-www-form-urlencoded'},
body: new URLSearchParams({
PASSKEY: 'abc123',
dateutc: '2024-01-15 12:00:00',
tempf: '72.5',
humidity: '55',
baromrelin: '29.92'
})
};
fetch('http://0.0.0.0:3000/v1/webhooks/ecowitt/{webhookId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "3000",
CURLOPT_URL => "http://0.0.0.0:3000/v1/webhooks/ecowitt/{webhookId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "PASSKEY=abc123&dateutc=2024-01-15%2012%3A00%3A00&tempf=72.5&humidity=55&baromrelin=29.92",
CURLOPT_HTTPHEADER => [
"Content-Type: application/x-www-form-urlencoded"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "http://0.0.0.0:3000/v1/webhooks/ecowitt/{webhookId}"
payload := strings.NewReader("PASSKEY=abc123&dateutc=2024-01-15%2012%3A00%3A00&tempf=72.5&humidity=55&baromrelin=29.92")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/x-www-form-urlencoded")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("http://0.0.0.0:3000/v1/webhooks/ecowitt/{webhookId}")
.header("Content-Type", "application/x-www-form-urlencoded")
.body("PASSKEY=abc123&dateutc=2024-01-15%2012%3A00%3A00&tempf=72.5&humidity=55&baromrelin=29.92")
.asString();require 'uri'
require 'net/http'
url = URI("http://0.0.0.0:3000/v1/webhooks/ecowitt/{webhookId}")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/x-www-form-urlencoded'
request.body = "PASSKEY=abc123&dateutc=2024-01-15%2012%3A00%3A00&tempf=72.5&humidity=55&baromrelin=29.92"
response = http.request(request)
puts response.read_body{
"status": "ok"
}{
"error": "Invalid webhook ID"
}{
"error": "Invalid PASSKEY"
}{
"error": "Config entry not found"
}{
"error": "Internal error"
}Path Parameters
UUID that identifies the Ecowitt config entry.
Body
application/x-www-form-urlencoded
Optional passkey for request validation
UTC timestamp of the reading
Temperature in Fahrenheit
Relative humidity (%)
Relative barometric pressure (inHg)
Absolute barometric pressure (inHg)
Wind direction (degrees)
Wind speed (mph)
Rain rate (in/hr)
Response
Weather data received and processed
⌘I