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 whether you accept or reject these cookies being set.

Button through RS485

I have a plain button (non-knx) which I want to control through LM, unfortunately I don't have any analog ports in my LM type. I've read somewhere that I can simply connect the button to RS485 port in the LM (A and gnd). I need a script for that. I've found this script which I modified for me and it does transfer but all I get after pressing the button is 1. There is also a huge delay (when I get 1 I have to wait a while for it to work again, I'm suspecting that this might be because of wrong baudrate. What I need though is to get 1/0 according to the state of that button.

-- open port on first call
if not port then
port ='/dev/RS485-1', { baudrate = 4800, parity = 'odd', duplex = 'half', databits = 8, stopbits = 1 })
-- port ready
if port then
-- read one byte
char = port:read(1, 1)
-- send back if read succeeded
if char then

grp.write('30/1/1', char)

I hope your controller is still working..

I never seen a short circuit on a communication port as a solution.

We have a KNX interface for your task - MTN670802 - that is not very expensive.



Thank you for your response, I also hope it's still working. Well atleast it actually worked the way I wanted. Guess I won't use it like that anymore, I better get what you posted.

Forum Jump: