This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Daily Electricity
#1
Hey guys,
I have a question.
I have a Wiser and a Schneider iEM-iEM3155.
I would like to make a list of the daily electricity consumption.
So that the meter reading is compared every 24 hours and the consumption is calculated and everything is entered in a list (perhaps as text in the touch)
I'm a beginner at scripting and didn't get it right.
The count is a 14.4 byte
Thanks for Helping
Reply
#2
Hi Tee_Trinker,

I use this function into resident script every 5 seconds:

-----
local coeff, energy, sampligSec
sampligSec=5 -- 5 seconds of sampling
coeff = 60*(60/sampligSec)
energy=grp.getvalue(yourdata) -- Wh
power=grp.getvalue(yourdata) -- W

energy=energy+(power/coeff)
---

I hope this is good for you.
Reply
#3
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
Reply
#4
(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
   
   
Reply


Forum Jump: