10.11.2022, 12:47
(03.11.2022, 07:27)admin Wrote: One option is to use trends and fetch data from them: https://openrb.com/docs/trends-new.htm. Alternatively you can use this script as a starting point: https://forum.logicmachine.net/showthread.php?tid=1175
it Works...Thank you!!!!
I use this one:
event script to power object
Code:
kwhtot = event.getvalue(32/1/30)
kwhstart = 'kwh_usage_day_start'
kwhoutput = '32/2/1'
if storage.get(kwhstart) == nil then
storage.set(kwhstart, kwhtot)
end
grp.write(kwhoutput, kwhtot - storage.get(kwhstart))
then scheduled script with cron time 0 0 * * *
Code:
storage.set('kwh_usage_day_start', nil)
grp.write('32/2/1', 0)
and event script to power object Daily for Maximum
Code:
if event.getvalue('32/2/1') > grp.getvalue('32/2/2') then
grp.update('32/2/2', event.getvalue('32/2/1'))
grp.update('32/2/3', os.date('%d.%m.%Y'))
end
looks like this