20.05.2020, 10:30
Hi
I have some trouble to send control commands ON/OFF to a BenQ MS517H usin gfollowing event based script.
I have some trouble to send control commands ON/OFF to a BenQ MS517H usin gfollowing event based script.
Code:
require('serial')
device = '/dev/ttyUSB0'
port = serial.open(device, { baudrate = 9600, parity = 'none', stopbits = 1 })
-- get value of KNX object
value = event.getvalue()
if (value == true) then
-- send power on command with returns to make them stick
char = "<CR>*pow=on#<CR>"
port:write(char)
else
-- send power off command
char = "<CR>*pow=off#<CR>"
port:write(char)
end
-- close port
port:close()