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
#1
Hello
I've a water gauge which returns pulses.
I want to show water consumption for the last 1 hour.
Do you have any idea how to do it in LM way?
If no is this correct hack?
 

Code:
object=grp.find('1/1/1')
obj_addressraw = object.dstraw

query = "
select count() from FROM  objectlog WHERE objectlog.address="..obj_addressraw.." AND logtime>=os.microtime()-3600"
count = db:getall(query)

No, it isn't.
Object doesn't have dstraw. How to convert address to dstraw integer?

Bingo! knxlib.encodega('1/1/1')
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
Counting pulses, showing last 1hr total - by Thomas - 01.07.2019, 12:52

Forum Jump: