best way to store period power usage - Printable Version +- Logic Machine Forum (https://forum.logicmachine.net) +-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1) +--- Forum: General (https://forum.logicmachine.net/forumdisplay.php?fid=2) +--- Thread: best way to store period power usage (/showthread.php?tid=3906) |
best way to store period power usage - benanderson_475 - 27.02.2022 Hi, i am looking to shift power plans but want to log for a few weeks the times i use power as they have different rates for each periods for the proposed new plan, so i want to check if it is worth while, i have LM5 connected to modbus IEM power meter to read total consumption KWH. time periods are 7am-9am to 5pm-9pm (period 1) 9am-5pm to 9pm-11pm (period 2) 11pm to 7am (period 3) best case would be daily data for each period and store it in a virtual object with its date? Any ideas? RE: best way to store period power usage - Daniel - 28.02.2022 You could make 3 virtual objects and use trends on all 3. Use a fetch function to collect last hour consumption and based on the period add this value to virtula or not. You will be able to compare daily values later only take in to account an hour value shift. RE: best way to store period power usage - benanderson_475 - 08.01.2023 (28.02.2022, 08:43)Daniel Wrote: You could make 3 virtual objects and use trends on all 3. Use a fetch function to collect last hour consumption and based on the period add this value to virtula or not. You will be able to compare daily values later only take in to account an hour value shift. I'm not sure how to collect last hour from trends etc i had a look at trends, fetchone but doc says hour and minute info are ignored, this is what i have so far, anyways to optimize it?, its scheduled script to run every hour Code: -- Peak 7am-9am | off peak shoulder 9am-5pm | peak 5pm-9pm | off peak shoulder 9pm-11pm | Off-peak night 11pm-7am |