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.


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.


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).



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
    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