Japie...dziu

, dzięki
EDIT: OK, jedziemy dalej
klew wrote: Wed Apr 17, 2024 9:55 am
Sformatowany json od Syngeos wygląda tak :
Code: Select all
{
"coordinates": [50.08125, 18.831793],
"id": 10085,
"source": 1,
"city": "Orzesze ",
"address": "Kobiórska 1",
"sensors": [
{
"unit": "°C",
"name": "temperature",
"data": [
{
"read_at": "2024-04-18T07:02:55+00:00",
"value": 6.17
}
],
"display_type": "percent"
},
{
"unit": "%",
"name": "humidity",
"data": [
{
"read_at": "2024-04-18T07:02:55+00:00",
"value": 78.8
}
],
"display_type": "percent"
},
{
"unit": "hPa",
"name": "air_pressure",
"data": [
{
"read_at": "2024-04-18T07:02:55+00:00",
"value": 979.94
}
],
"display_type": "percent"
},
{
"unit": "µg/m³",
"name": "pm1",
"data": [
{
"read_at": "2024-04-18T07:04:55+00:00",
"value": 15.94
}
],
"display_type": "percent"
},
{
"unit": "µg/m³",
"name": "pm2_5",
"norm": {
"threshold": 25,
"grade_a": {
"gte": 0,
"lt": 13
},
"grade_b": {
"gte": 13,
"lt": 35
},
"grade_c": {
"gte": 35,
"lt": 55
},
"grade_d": {
"gte": 55,
"lt": 75
},
"grade_e": {
"gte": 75,
"lt": 110
},
"grade_f": {
"gte": 110
}
},
"data": [
{
"read_at": "2024-04-18T07:04:55+00:00",
"value": 36.56,
"current_norm": "grade-c",
"threshold_level": 146
}
],
"display_type": "percent"
},
{
"unit": "µg/m³",
"name": "pm10",
"norm": {
"threshold": 50,
"grade_a": {
"gte": 0,
"lt": 20
},
"grade_b": {
"gte": 20,
"lt": 50
},
"grade_c": {
"gte": 50,
"lt": 80
},
"grade_d": {
"gte": 80,
"lt": 110
},
"grade_e": {
"gte": 110,
"lt": 150
},
"grade_f": {
"gte": 150
}
},
"data": [
{
"read_at": "2024-04-18T06:58:54+00:00",
"value": 48.7,
"current_norm": "grade-b",
"threshold_level": 97
}
],
"display_type": "percent"
}
],
"first_logo": {
"filename": "42f0c52a6703101c6026521e65c09b2a.png",
"url": "https://s3.eu-central-1.amazonaws.com/cdn.syngeos.pl/42f0c52a6703101c6026521e65c09b2a.png"
},
"send_reports": false
}
Ja tworząc plik ymal na wzór tego z airly zrobiłem tak :
Code: Select all
...
channels:
- type: ThermHygroMeterParsed
name: syngeos_temp_and_humi
source:
type: File
file: "/home/wyse/Syngeos/data.json"
expiration_time_sec: 1200
parser:
type: Json
name: p1
temperature: "/sensors/0/data/1/value"
humidity: "/sensors/1/data/1/value"
- type: PressureParsed
name: syngeos_pressure
parser:
use: p1
pressure: "/sensors//2/data/1/value"
Niestety pojawia się :
Code: Select all
kwi 18 09:51:51 wyse supla-device-linux[9255]: ERR[1713426711.606551] JSON key "/sensors/1/data/1/value" not found
kwi 18 09:51:51 wyse supla-device-linux[9255]: ERR[1713426711.606648] JSON key "/sensors/0/data/1/value" not found
kwi 18 09:51:51 wyse supla-device-linux[9255]: ERR[1713426711.616939] JSON exception during getValue for key "/sensors//2/data/1/value"
kwi 18 09:51:56 wyse supla-device-linux[9255]: VERBOSE[1713426716.894260] Send: [53 55 50 4C 41 16 1F 00 00 00 28 00 00 00 10 00 00 00 1C D1 20 66 00 00 00 >
kwi 18 09:51:56 wyse supla-device-linux[9255]: VERBOSE[1713426716.894469] Send: [53 55 50 4C 41 ]
kwi 18 09:51:57 wyse supla-device-linux[9255]: VERBOSE[1713426717.5887] Recv: [53 55 50 4C 41 16 1E 00 00 00 32 00 00 00 10 00 00 00 1C D1 20 66 00 00 00 00>
kwi 18 09:52:01 wyse supla-device-linux[9255]: VERBOSE[1713426721.606093] Source: {"coordinates":[50.08125,18.831793],"id":10085,"source":1,"city":"Orzesze >
kwi 18 09:52:01 wyse supla-device-linux[9255]: ERR[1713426721.608158] JSON key "/sensors/1/data/1/value" not found
kwi 18 09:52:01 wyse supla-device-linux[9255]: ERR[1713426721.608258] JSON key "/sensors/0/data/1/value" not found
kwi 18 09:52:01 wyse supla-device-linux[9255]: ERR[1713426721.618555] JSON exception during getValue for key "/sensors//2/data/1/value"
No i w supli pusto
Gdzie tu jest błąd ?