Query Question for current watts

weather-display.com currently has a simple graph in their display with the TED5000 which works fine with my failing TED-5000. I’ve got iotawatt up and running and want to make sure I use the proper query to supply the proper number for WDisplay. They create a 1 min database of current watts. The below query is what I came up with but I am not sure it is the correct way to do it. It gives me current watts. Please advise if there is a better way.

http://iotawatt.local/query?select=[Total_Grid.d0]&begin=s-5s&end=s&group=10s

While it should work, I would change the group to ALL as you are defining a single interval with the begin and end parameters. The query will return the average Watts during the most recent 5 second interval that ended on a 5 second boundary. So depending on when you issue the query, the returned result could be up to 4 seconds old.

Query returns data from the datalog. That is something different from what is displayed in the IoTaWatt status page, which is a damped most recent 1 second value. The status API is undocumented and subject to change, but others have used it for similar projects. You would need to glean the current details by looking at the code, either in the IoTaWatt firmware or the receiving JavaScript in the index.htm app.