Trend Log functions question - Printable Version +- Logic Machine Forum (https://forum.logicmachine.net) +-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1) +--- Forum: Scripting (https://forum.logicmachine.net/forumdisplay.php?fid=8) +--- Thread: Trend Log functions question (/showthread.php?tid=4132) |
Trend Log functions question - iJAF - 05.07.2022 Hi, I have data from a Photovoltaic Solar PowerPlant energy production already in Trends. I'm trying to make a script to send an email with a CSV with the production from each day per each row of the CSV at the end of each month. I have it already sending a CSV with a row for each 30min directly from trends (30min resolution) with the trend_export function. My question is about changing from 30min per row to each day per row. I'm trying now directly with the trend log functions: Code: require('trends') If I set the resolution like this, will it calculate the correct value for each day? Code: day = trends.fetch('PV Total Energy', dates, 86400) EDIT: if used this way the values doesn't make much sense. One more thing, in the visualization, if I export multiple trends to CSV I get each variable in each column. (see attachment) Any way to do this via scripting in order to send via email ? Thank you RE: Trend Log functions question - admin - 06.07.2022 What do you mean that "the values doesn't make much sense"? Are they different from the data view in trends UI monthly mode? This example exports daily data for multiple trends for the past month. You can add more trend name to the trendlist table as needed. Code: require('trends') RE: Trend Log functions question - iJAF - 06.07.2022 Hi, Thank you. I mean for example for "Temp. 1" for day 8, seems to have a strange value when comparing the 2 CSVs Regarding your code example, thank you very much. I think I will also offer the original resolution from Trends in order to let the end customer choose. Have you got one an example code like the one you posted before, for multiple trends with the timestamp for the original resolution from Trends, like this one bellow from visualization ? Thank you very much ! |