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.

Counting pulses, showing last 1hr total
#2
Code:
function ecl_get_last_hour_counter(ls_address)
  local obj_addressraw = knxlib.encodega(ls_address)
  local query = "select count() as pulses_per_hour FROM  objectlog WHERE datahex='01' AND objectlog.address="..obj_addressraw.." AND logtime>="..tostring(os.microtime()-3600)
    local count = db:getall(query)
  return count[1].pulses_per_hour
end
LM5Lp, firmware: 2018.08.22 and 2021.12.15, FlashSYS v2, ARMv7 Processor rev 5 (v7l), kernel 4.4.151 and 4.4.259
Reply


Messages In This Thread
RE: Counting pulses, showing last 1hr total - by Thomas - 01.07.2019, 14:02

Forum Jump: