Author Topic: Trying to understand the details in Ecowitt JSON output  (Read 821 times)

0 Members and 2 Guests are viewing this topic.

Offline broadstairs

  • Forecaster
  • *****
  • Posts: 861
Trying to understand the details in Ecowitt JSON output
« on: March 27, 2024, 07:18:11 AM »
I am trying to decode the JSON output from getliveinfo HTTP command on a gateway, my issue is with one particular line

Code: [Select]
{
"common_list": [{
"id": "0x02",
"val": "9.5",
"unit": "C"
}, {
"id": "0x07",
"val": "75%"
}, {
"id": "3",                   <what's this supposed to be?
"val": "5.7",
"unit": "C"
}, {
"id": "0x03",              <this is dewpoint!
"val": "5.3",
"unit": "C"
},

Any ideas anyone?

Stuart
Ecowitt GW1003 with ultrasonic wind gauge, lightning sensor and PM2.5 sensor with Personal Weather Tablet as a console.

Offline Vasco

  • Forecaster
  • *****
  • Posts: 343
    • PWS
Re: Trying to understand the details in Ecowitt JSON output
« Reply #1 on: March 27, 2024, 07:51:51 AM »
Apparent temp, I think?

But mine is id 4, on a WN32, not 3:
Code: [Select]
{ "id": "0x02", "val": "4.7", "unit": "C" }, { "id": "0x07", "val": "95%" }, { "id": "4", "val": "3.4", "unit": "C" }, { "id": "0x03", "val": "4.0", "unit": "C", "battery": "0" }
« Last Edit: March 27, 2024, 07:59:50 AM by Vasco »
Ecowitt GW1102 (with GW2000) + Weather Display in Windows 10

Offline broadstairs

  • Forecaster
  • *****
  • Posts: 861
Re: Trying to understand the details in Ecowitt JSON output
« Reply #2 on: March 27, 2024, 08:10:45 AM »
Yes but it makes no sense as all the other IDs are hex numbers which relate to the telnet API sensor IDs. I'm hoping someone can tell me how you are supposed to identify this entry, where is the documentation? A 4 would equate to Wind chill if it were hex! What gateway/console is yours?

Stuart
« Last Edit: March 27, 2024, 08:13:05 AM by broadstairs »
Ecowitt GW1003 with ultrasonic wind gauge, lightning sensor and PM2.5 sensor with Personal Weather Tablet as a console.


Offline Vasco

  • Forecaster
  • *****
  • Posts: 343
    • PWS
Re: Trying to understand the details in Ecowitt JSON output
« Reply #4 on: March 27, 2024, 09:19:26 AM »
What gateway/console is yours?

GW2000A_V3.1.2

Interestingly, apparent temp is not shown or graphed at ecowitt.net. . .  :?
« Last Edit: March 27, 2024, 09:36:07 AM by Vasco »
Ecowitt GW1102 (with GW2000) + Weather Display in Windows 10

Offline Wooks61

  • Senior Member
  • **
  • Posts: 96
Re: Trying to understand the details in Ecowitt JSON output
« Reply #5 on: March 27, 2024, 09:37:01 AM »
I get :
{ "common_list": [{ "id": "0x02", "val": "18.3", "unit": "C" }, { "id": "0x07", "val": "55%" }, { "id": "4", "val": "17.8", "unit": "C" }, { "id": "0x03", "val": "9.1", "unit": "C" }
from GW2000A

Offline Wooks61

  • Senior Member
  • **
  • Posts: 96
Re: Trying to understand the details in Ecowitt JSON output
« Reply #6 on: March 27, 2024, 09:42:30 AM »
What gateway/console is yours?

GW2000A_V3.1.2

Interestingly, apparent temp is not shown or graphed at ecowitt.net. . .  :?

My Ecowitt.net shows App Temp on the tile and graph
https://www.ecowitt.net/home/share?authorize=N6PUT1

Can be changed in the Ecowitt.net Settings page.

Offline Wooks61

  • Senior Member
  • **
  • Posts: 96
Re: Trying to understand the details in Ecowitt JSON output
« Reply #7 on: March 27, 2024, 10:00:05 AM »
{ "common_list": [{ "id": "0x02", "val": "15.8", "unit": "C" }, { "id": "0x07", "val": "61%" }, { "id": "3", "val": "15.8", "unit": "C" }, { "id": "0x03", "val": "8.3", "unit": "C" }

when "Feels Like" is set to display

Offline Vasco

  • Forecaster
  • *****
  • Posts: 343
    • PWS
Re: Trying to understand the details in Ecowitt JSON output
« Reply #8 on: March 27, 2024, 10:04:22 AM »
My Ecowitt.net shows App Temp on the tile and graph

Apparent shows in GUI but not at ecowitt.net, where it has been selected.
« Last Edit: March 27, 2024, 10:17:27 AM by Vasco »
Ecowitt GW1102 (with GW2000) + Weather Display in Windows 10

Offline Vasco

  • Forecaster
  • *****
  • Posts: 343
    • PWS
Re: Trying to understand the details in Ecowitt JSON output
« Reply #9 on: March 27, 2024, 10:09:31 AM »
{ "id": "3", "val": "15.8", "unit": "C" } . . . when "Feels Like" is set to display

So the answer to Stuart's original question is probably "Feels Like", not "Apparent"  ;)
« Last Edit: March 27, 2024, 10:51:57 AM by Vasco »
Ecowitt GW1102 (with GW2000) + Weather Display in Windows 10

Offline broadstairs

  • Forecaster
  • *****
  • Posts: 861
Re: Trying to understand the details in Ecowitt JSON output
« Reply #10 on: March 27, 2024, 10:37:25 AM »
This whole situation is completely ridiculous. We should not be poking around in the dark trying to work out the meaning of Ecowitt's publicly announced HTTP interface. It should be documented clearly somewhere which it appears no one has access to!. Ecowitt had told me I should be using this interface for my GW1200 as currently they say the local API is not supported on it  ](*,)  :twisted:

I am going to raise this with Ecowitt and in light of what they told me about the GW1200 and explain in words of one syllable why full documentation on this interface and the exact meaning of all possible entries is needed.

Stuart
Ecowitt GW1003 with ultrasonic wind gauge, lightning sensor and PM2.5 sensor with Personal Weather Tablet as a console.

Offline broadstairs

  • Forecaster
  • *****
  • Posts: 861
Re: Trying to understand the details in Ecowitt JSON output
« Reply #11 on: March 27, 2024, 10:50:24 AM »
I have just emailed Ecowitt to ask for the relevant documentation on all the JSON strings used by all commands in the HTTP interface. I'll update here on their reply.

Stuart
Ecowitt GW1003 with ultrasonic wind gauge, lightning sensor and PM2.5 sensor with Personal Weather Tablet as a console.

Online jbroome

  • Senior Member
  • **
  • Posts: 53
Re: Trying to understand the details in Ecowitt JSON output
« Reply #12 on: March 28, 2024, 05:42:27 AM »
If you use the browser interface to your GW* device, go to the Live Data page, then select "view source" to look at the HTML.
If you scroll down far enough, you should find something like this:

   const idObj = {
      '0x02': 'Outdoor Temperature',
      '0x07': 'Outdoor Humidity',
      '0x03': 'Dew Point',
      // '0x04': 'Wind chill',
      // '0x05': 'Heat index',
      '0x0A': 'Wind Direction',
      '0x0B': 'Wind Speed',
      '0x0C': 'Gust Speed',

      '0x15': 'Solar Irradiance',
      '0x16': 'UV',
      '0x17': 'UV-Index',
      '0x18': 'Date and time',
      '0x19': 'Day Wind Max',

      '0x0D': 'Rain Event',
      '0x0E': 'Rain Rate',
      '0x0F': 'Rain hour',
      '0x10': 'Rain Day',
      '0x11': 'Rain Week',
      '0x12': 'Rain Month',
      '0x13': 'Rain Year',
      '0x14': 'Rain Totals',
      //piezo rain
      // '0x80': 'Rain Rate',
      // '0x81': 'Rain Event',
      // '0x82': 'Rain Hour',
      // '0x83': 'Rain Day',
      // '0x84': 'Rain Week',
      // '0x85': 'Rain Month',
      // '0x86': 'Rain Year',
   }


Also take a look at the function initData() - this is the top of it:

function initData() {
      if (dataArr.common_list && dataArr.common_list.length > 0) { //common-data
         let commonStr = ''
         dataArr.common_list.forEach(val => {
            let idStr = ''
            if (val.id === '3') {
               idStr = 'Feels Like'
            } else if (val.id === '4') {
               idStr = 'Apparent'
            } else if (val.id == '0x0A') {
               idStr = idObj[val.id] || ''
               val.val = `${val.val} °`
            } else if (val.id == '0x15') {
               idStr = idObj[val.id] || ''
               val.val = val.val.includes('W/m2') ? val.val.replace('W/m2', ' W/㎡') : `${val.val}`
            } else {
               idStr = idObj[val.id] || ''
            }
            if (val.id != '0x04' && val.id != '0x05') {
               let unit = val.unit ? unitJudge(val.unit) : ''
               let imgStr = (!val.battery || val.battery == '0') ? '' :
                  `<img src="${battImgobj[val.battery]}" >`
               commonStr += `<div class="data-item">
                        <div class="data-til-box"><div class="data-til">${idStr}</div> ${imgStr}</div>
                        <div class="data-num">${val.val} ${unit}</div>
                     </div>`
            }
         })


This should help to decode the id values - at least *if* the value you seek is present.

Based on what I see, id "3" is indeed "Feels Like", id "4" is "Apparent", while "0x03" is "Dew Point" and "0x04" might be "Wind chill".
Gotta love how those ids are numerically equal, but not string equal...

   ---Jonathan
Collector of Ecowitt and related gizmos:
GW1000 x3 (both 915 MHz and 433 MHz)
GW1100 x2 (both 915 MHz and 433 MHz)
GW1200 (433 MHz)
GW2000 (915 MHz)
WH31
WH31P
WH32E
WH32B
WH34BS
WH34BL
WN35
WH40
WH41
WH45
WH46
WH51
WH55
WH57
WH65B
WH68
WS90BN
(and probably more that I've forgotten)

Offline broadstairs

  • Forecaster
  • *****
  • Posts: 861
Re: Trying to understand the details in Ecowitt JSON output
« Reply #13 on: March 28, 2024, 05:58:24 AM »
Yes thanks for that however it does not mean that Ecowitt should not provide full documentation for this interface which is something I am pushing for.

I had worked out what 3 and 4 probably meant but trial and error or looking at page source should not be needed!

Without documentation how does a developer add support for this interface unless he either purchases the correct device or relies on help from someone who does - documentation is important.

Stuart
« Last Edit: March 28, 2024, 06:00:26 AM by broadstairs »
Ecowitt GW1003 with ultrasonic wind gauge, lightning sensor and PM2.5 sensor with Personal Weather Tablet as a console.

Online jbroome

  • Senior Member
  • **
  • Posts: 53
Re: Trying to understand the details in Ecowitt JSON output
« Reply #14 on: March 28, 2024, 06:29:02 AM »
Yes thanks for that however it does not mean that Ecowitt should not provide full documentation for this interface which is something I am pushing for.

Oh, I absolutely agree. And the documentation should be updated as the interface changes.  I am growing weary of having to reverse-engineer so many things with the Ecowitt devices, despite their moderately-decent attempts at documentation.

I just spent several hours troubleshooting an undocumented extension to the GW1000_LIVEDATA response - ITEM code 0x6B, formerly documented as ITEM_WH34_BATT (and obsoleted), has now been reused for an extended version of ITEM_SENSOR_CO2. The extended version adds PM1.0 and PM4.0 values.

It would have been really nice if the "telnet" API specification had been updated to include this.  My v1.7.7 GW1000 is sending this, so it has been in the firmware for quite some time.

   ---Jonathan
« Last Edit: March 28, 2024, 06:30:50 AM by jbroome »
Collector of Ecowitt and related gizmos:
GW1000 x3 (both 915 MHz and 433 MHz)
GW1100 x2 (both 915 MHz and 433 MHz)
GW1200 (433 MHz)
GW2000 (915 MHz)
WH31
WH31P
WH32E
WH32B
WH34BS
WH34BL
WN35
WH40
WH41
WH45
WH46
WH51
WH55
WH57
WH65B
WH68
WS90BN
(and probably more that I've forgotten)

Offline broadstairs

  • Forecaster
  • *****
  • Posts: 861
Re: Trying to understand the details in Ecowitt JSON output
« Reply #15 on: March 28, 2024, 06:35:40 AM »
Oh, I absolutely agree. And the documentation should be updated as the interface changes.  I am growing weary of having to reverse-engineer so many things with the Ecowitt devices, despite their moderately-decent attempts at documentation.

I just spent several hours troubleshooting an undocumented extension to the GW1000_LIVEDATA response - ITEM code 0x6B, formerly documented as ITEM_WH34_BATT (and obsoleted), has now been reused for an extended version of ITEM_SENSOR_CO2. The extended version adds PM1.0 and PM4.0 values.

It would have been really nice if the "telnet" API specification had been updated to include this.  My v1.7.7 GW1000 is sending this, so it has been in the firmware for quite some time.

   ---Jonathan

That explains why I have not seen that ID of 6B on my GW1000 or others as I don't have that sensor!

Stuart
Ecowitt GW1003 with ultrasonic wind gauge, lightning sensor and PM2.5 sensor with Personal Weather Tablet as a console.

Offline Vasco

  • Forecaster
  • *****
  • Posts: 343
    • PWS
Re: Trying to understand the details in Ecowitt JSON output
« Reply #16 on: March 29, 2024, 08:15:36 AM »
Apparent shows in GUI but not at ecowitt.net, where it has been selected.

Later I realised that this is probably because I haven't set up the anemometer yet  :oops:
Ecowitt GW1102 (with GW2000) + Weather Display in Windows 10

Offline mcrossley

  • Forecaster
  • *****
  • Posts: 1140
    • Wilmslow Astro
Re: Trying to understand the details in Ecowitt JSON output
« Reply #17 on: March 29, 2024, 08:25:51 AM »
I just spent several hours troubleshooting an undocumented extension to the GW1000_LIVEDATA response - ITEM code 0x6B, formerly documented as ITEM_WH34_BATT (and obsoleted), has now been reused for an extended version of ITEM_SENSOR_CO2. The extended version adds PM1.0 and PM4.0 values.
Why would you reuse an ID at this stage?!!  I still have the battery decode in my code just in case someone is running old firmware.
Have they run out of numbers between 1 and 255 they can think of!
Mark

Online jbroome

  • Senior Member
  • **
  • Posts: 53
Re: Trying to understand the details in Ecowitt JSON output
« Reply #18 on: March 29, 2024, 02:41:07 PM »
I just spent several hours troubleshooting an undocumented extension to the GW1000_LIVEDATA response - ITEM code 0x6B, formerly documented as ITEM_WH34_BATT (and obsoleted), has now been reused for an extended version of ITEM_SENSOR_CO2. The extended version adds PM1.0 and PM4.0 values.
Why would you reuse an ID at this stage?!!  I still have the battery decode in my code just in case someone is running old firmware.
Have they run out of numbers between 1 and 255 they can think of!

I know, right?  My code was decoding 0x6B as ITEM_WH34_BATT, with eight bytes of data, but then I was getting out of sync and couldn't decode the next part.  After staring at the raw dump for a bit, I realized that twenty-four bytes after the 6B was the expected 6C for ITEM_HEAP_FREE.  I then looked at those intervening 24 bytes, and realized that it was an extended version of ITEM_SENSOR_CO2, with the pm1_co2, pm1_24h_co2, pm4_co2, and pm4_24h_co2 values (all 16 bits) added after the co2_24h value (but before the co2_batt value.)

I now have my code check the model and firmware version to decide how to interpret this item.  I already need to do that for ITEM_TF_USR*, as GW1000 1.6.0 and later send the extra byte for the battery value, and earlier versions do not.

   ---Jonathan
Collector of Ecowitt and related gizmos:
GW1000 x3 (both 915 MHz and 433 MHz)
GW1100 x2 (both 915 MHz and 433 MHz)
GW1200 (433 MHz)
GW2000 (915 MHz)
WH31
WH31P
WH32E
WH32B
WH34BS
WH34BL
WN35
WH40
WH41
WH45
WH46
WH51
WH55
WH57
WH65B
WH68
WS90BN
(and probably more that I've forgotten)

Offline Vasco

  • Forecaster
  • *****
  • Posts: 343
    • PWS
Re: Trying to understand the details in Ecowitt JSON output
« Reply #19 on: April 04, 2024, 12:31:02 PM »
Apparent shows in GUI but not at ecowitt.net, where it has been selected.

Later I realised that this is probably because I haven't set up the anemometer yet  :oops:

Yes, all good once anemo set up  :)
Ecowitt GW1102 (with GW2000) + Weather Display in Windows 10

 

anything