Emonhub.log format change?

I am using emonhub.log data to analyze data with various scripts. After a reboot, my scripts stopped working, and after some digging, I found that the log format seems to have been changed.

Before:

2022-12-06 17:18:06,332 INFO     localmeteo sending: http://localhost/input/bulk.json? data=[[1670339858.7669525,5,0,0,0,0,0,0,0,0,0,0,2095298],[1670339860.
7802935,19,18.1,0,49.900000000000006,2.5,1,0,-32],[1670339861.2871048,23,20.6,0,43.1,2.5,1,-53],[1670339863.8023262,5,0,0,0,0,0,0,0,0,0,0,2095303],[16703398
68.8322418,5,0,0,0,0,0,0,0,0,0,0,2095308],[1670339873.764555,5,0,0,0,0,0,0,0,0,0,0,2095313],[1670339878.7952633,5,0,0,0,0,0,0,0,0,0,0,2095318],[1670339880.0
061972,25,20.5,0,41.2,2.8000000000000003,1,-35],[1670339880.5131443,26,15.700000000000001,0,34.1,2.7,1,-37],[1670339881.9235277,20,16.900000000000002,0,54.1
,2.5,1,0,-47],[1670339883.84199,5,0,0,0,0,0,0,0,0,0,0,2095323]]&sentat=1670339886&apikey=E-M-O-N-C-M-S-A-P-I-K-E-Y

After:

2022-12-07 13:18:41,138 INFO     localmeteo sending: http://localhost/input/bulk.json?sentat=1670411921 (477 bytes of data, 11 frames, uncompressed)

How can I get the actual JSON data posted back to the log, or, alternatively, find another place where to hook at it? Specifically, I need the accurate timestamps and corresponding pulsecounts to derive an approximation of power used (averaged to a defined time span).

BR,

    Ari-Matti

The Emoncms feed API is quite limited, but I guess it was the only way. Made my dashboard to work again, even though the solution is neither elegant nor as accurate.

Hello @luru if you wanted to restore the previous behaviour, one option could be to print this data again in this section of emonhub: emonhub/EmonHubEmoncmsHTTPInterfacer.py at master · openenergymonitor/emonhub · GitHub

if compression_ratio<1.0:
    post_body = compressed
    # Set compression flag (cb = compression binary).
    post_url = post_url + "&cb=1"
    self._log.info("sending: %s (%d bytes of data, %d frames, compressed)", post_url, len(post_body),number_of_frames)
    self._log.info("compression ratio: %d%%",compression_ratio*100)
    self._log.info(json.dumps(post_body)) # Add this in here
else: 
    post_body = {'data': data_string}
    self._log.info("sending: %s (%d bytes of data, %d frames, uncompressed)", post_url, len(data_string),number_of_frames)
    self._log.info("compression ratio: %d%%, sent original",compression_ratio*100)
    self._log.info(json.dumps(data_string)) # Add this in here

I haven’t tested this, but I think it should work