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.

Read fire panel sensors current state
#1
Hi. I have a fire panel and want to read the state of each sensor by RS232. I´m new at LUA but made some things like this:

-- Include library before calling serial functions
if not port then
require('serial')
-- Setting port parameters and open serial port
port = serial.open('/dev/RS232', {
baudrate = 19200,
databits = 8,
stopbits = 1,
parity = 'none',
duplex = 'full'
})
-- Flushes any read/unsent bytes
port:flush()

-- Read data from serial port
if port:read() == 'Powr___1'
-- Send alert when condition matched
then alert('Projector is ON')
end

-- Closing serial port
port:close()
end

¿How do I enter this contact ID event for reading the current state of the sensor in LUA command. Attached is the contact ID events codes.

-- Read data from serial port
port:read() == 'Powr___1' 
end

¿Is there a "Hello world" command to see if the communication is established between LM and Fire panel?


Thanks for your help

Attached Files Thumbnail(s)
   
Reply


Messages In This Thread
Read fire panel sensors current state - by Chmo - 23.01.2023, 18:31

Forum Jump: