some more keys
This commit is contained in:
parent
7c55c805a4
commit
c2c1e1db00
@ -71,6 +71,7 @@ The `both.php` file supports both **Ecowitt** and **Wunderground** protocols.
|
|||||||
|
|
||||||
- **HTTP Method**: GET
|
- **HTTP Method**: GET
|
||||||
- **Data Format**: URL parameters (Query Parameters)
|
- **Data Format**: URL parameters (Query Parameters)
|
||||||
|
- **Protocol**: https://support.weather.com/s/article/PWS-Upload-Protocol?language=en_US
|
||||||
|
|
||||||
#### Example GET Data:
|
#### Example GET Data:
|
||||||
|
|
||||||
|
11
both.php
11
both.php
@ -18,7 +18,12 @@ $WUNDERGROUND_TO_ECOWITT = array(
|
|||||||
'dateutc' => 'dateutc',
|
'dateutc' => 'dateutc',
|
||||||
'solarradiation' => 'solarradiation',
|
'solarradiation' => 'solarradiation',
|
||||||
'softwaretype' => 'stationtype',
|
'softwaretype' => 'stationtype',
|
||||||
|
// not sure about the following keys
|
||||||
|
'lowbatt'=> 'wh65batt',
|
||||||
|
'rainin' => 'rainratein',
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// TDOD: make mapping for these keys
|
||||||
//POST (ecowitt):
|
//POST (ecowitt):
|
||||||
// [PASSKEY] => 123*****************************
|
// [PASSKEY] => 123*****************************
|
||||||
// [runtime] => 296
|
// [runtime] => 296
|
||||||
@ -27,11 +32,9 @@ $WUNDERGROUND_TO_ECOWITT = array(
|
|||||||
// [baromabsin] => 28.804
|
// [baromabsin] => 28.804
|
||||||
// [vpd] => 0.290
|
// [vpd] => 0.290
|
||||||
// [maxdailygust] => 11.41
|
// [maxdailygust] => 11.41
|
||||||
// [rainratein] => 0.000
|
|
||||||
// [eventrainin] => 0.000
|
// [eventrainin] => 0.000
|
||||||
// [hourlyrainin] => 0.000
|
// [hourlyrainin] => 0.000
|
||||||
// [totalrainin] => 0.000
|
// [totalrainin] => 0.000
|
||||||
// [wh65batt] => 0
|
|
||||||
// [freq] => 868M
|
// [freq] => 868M
|
||||||
// [model] => GW2000A
|
// [model] => GW2000A
|
||||||
// [interval] => 8
|
// [interval] => 8
|
||||||
@ -41,19 +44,19 @@ $WUNDERGROUND_TO_ECOWITT = array(
|
|||||||
// [PASSWORD] => 1
|
// [PASSWORD] => 1
|
||||||
// [dewptf] => 55.04
|
// [dewptf] => 55.04
|
||||||
// [windchillf] => 69.44
|
// [windchillf] => 69.44
|
||||||
// [rainin] => 0.000
|
|
||||||
// [baromin] => 28.804
|
// [baromin] => 28.804
|
||||||
// [lowbatt] => 0
|
|
||||||
// [action] => updateraw
|
// [action] => updateraw
|
||||||
// [realtime] => 1
|
// [realtime] => 1
|
||||||
// [rtfreq] => 5
|
// [rtfreq] => 5
|
||||||
|
|
||||||
$NORMALIZATION = array(
|
$NORMALIZATION = array(
|
||||||
|
// TODO: round float to only two decimal places
|
||||||
'dateutc' => fn ($dt) => new DateTimeImmutable($dt),
|
'dateutc' => fn ($dt) => new DateTimeImmutable($dt),
|
||||||
'tempf' => fn ($temp) => normalizeTemperature($temp),
|
'tempf' => fn ($temp) => normalizeTemperature($temp),
|
||||||
'indoortempf' => fn ($temp) => normalizeTemperature($temp),
|
'indoortempf' => fn ($temp) => normalizeTemperature($temp),
|
||||||
'windspeedmph' => fn ($mph) => normalizeSpeed($mph),
|
'windspeedmph' => fn ($mph) => normalizeSpeed($mph),
|
||||||
'windgustmph' => fn ($mph) => normalizeSpeed($mph),
|
'windgustmph' => fn ($mph) => normalizeSpeed($mph),
|
||||||
|
// TODO: add missing keys from mapping
|
||||||
);
|
);
|
||||||
|
|
||||||
function ecowittKey($key)
|
function ecowittKey($key)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user