12.10.2016, 12:07 (This post was last modified: 12.10.2016, 13:38 by AEK.)
some additions for that case
Lutron message parser
For example I shall show you how to receive setpoint temperature from Lutron panel/switch
Let’s write all messages from Lutron to knx group address
Change resident script
From Lutron we receive a lot of messages when we change setpoint
For example, this 4 message we will receive twice, when we will change setpoint:
~HVAC,11,78,26,26 – i dont know what is it
~HVAC,11,18,79,0,0 – setpoint in Fahrenheit
~HVAC,11,19,26,0,0 -- setpoint in Celsius degree
~HVAC,11,10,26,26 -- i dont know what is it
Let’s see, what we have in setpoint in Celsius degree
~HVAC,11,19,26,0,0
~HVAC – status from device
11 – device id, which send this message
19 – type of information (Celsius degree in this example)
26 - Celsius degree
0,0 – some other parameters
To parse this message and write temperature to knx address create event based script for message group address (15/1/1)
Code:
12345678910111213141516171819202122
--lutron parser-- get stringtemp = event.getvalue()
-- convert sting to tabletemp = string.split(temp, ',')
-- if comand type is ~HVAC let's move forwardiftemp[1] == '~HVAC'then-- if device id = id of our panel let's move forwardiftemp[2] == '11'then-- be carefull, temp[2] is string, not number-- if in message is celsius degreeiftemp[3] == '19'then-- convert temperature from string to numbertemp = tonumber(temp[4])
-- check current value of setpoint, to not to write the same valuecur_temp = grp.getvalue('lutron_temp_setpoint')
iftemp~=cur_tempthen-- write walue to temp addressgrp.write('lutron_temp_setpoint', temp)
endendendend
To write value from LM to Lutron create event script for setpoint object
Code:
123456789
require('user.lutron')
value = event.getvalue()
-- round setmoint to integervalue = math.floor(value)
tcp, err = lutron_login()
ifnottcpthenlog('no connection to device', err)
endtcp:send('#HVAC,11,19,'..value..',0,0\r\n')
to read some data from lutron use next script (resident in my case)
Code:
123456789101112131415
require('user.lutron')
--Подключаемся и делаем запросtcp, err = lutron_login()
ifnottcpthenlog('no connection to device', err)
else-- send some requesttcp:send('?HVAC,11,15\r\n')
-- and receive answerx = tcp:receive()
-- log answer, or write it to message addresslog(x)
tcp:close()
end
Hi Erwin,
is it possible to have some suggestion about Lutron integration? In the next week I will have to integrate it.
Let me know if it could be possible.
Thanks.
(02.02.2017, 17:44)Domoticatorino Wrote: Hi Erwin,
is it possible to have some suggestion about Lutron integration? In the next week I will have to integrate it.
Let me know if it could be possible.
Thanks.
I am integrating knx keypad and lutron controller using Logic Machine, I am able to send command but how do I get the status message from lutron please help.
(14.11.2022, 16:36)admin Wrote: What kind of status do you want to get? Do you already know the required status request message that should be sent to Lutron?
I just want to get On/off status and brightness value. No, how to send the required status to lutron? Please guide.
Which commands are you using for control? The status command is similar but it begins with ? instead of # and the last parameter (value) is skipped. This example parses HVAC query: https://forum.logicmachine.net/showthrea...97#pid2197
You will need a separate resident script for status queries.
(21.11.2022, 08:12)admin Wrote: Which commands are you using for control? The status command is similar but it begins with ? instead of # and the last parameter (value) is skipped. This example parses HVAC query: https://forum.logicmachine.net/showthrea...97#pid2197
You will need a separate resident script for status queries.
I am using this event based script to send command, can you please share the resident script for the same.
require('user.lutron')
tcp, err = lutron_login()
if not tcp then
log('no connection to device', err)
end
tcpend('#DEVICE,10,6,3\r\n')
Try this, no guarantees that it will work because we don't have any Lutron devices to test. Check Logs for any errors if the script does not work.
Adjust each query call as needed. First argument is the query request (without \r\n, it's added automatically), second argument is the status group address where the new value is written.
(22.11.2022, 12:29)admin Wrote: Try this, no guarantees that it will work because we don't have any Lutron devices to test. Check Logs for any errors if the script does not work.
Adjust each query call as needed. First argument is the query request (without \r\n, it's added automatically), second argument is the status group address where the new value is written.
The script you have shared worked, but sometimes it goes into the sleep mode or update the status very late. Also How do I get the brightness status through this script. I am using the event based script to send the brightness value command to lutron. Please guide
require('user.lutron')
tcp, err = lutron_login()
if not tcp then
log('no connection to device', err)
end
value = event.getvalue()
value = math.floor(value)
(29.11.2022, 10:14)admin Wrote: What is the resident script sleep time set to?
For outputs use this query format:
Code:
1
query('?OUTPUT,151,1', '1/1/151')
Sleep Interval for script is set to 0,
while sock do
query('?OUTPUT,151,1', '0/0/2')
query('?OUTPUT,151,1', '0/0/4')
I am using this but I it is updating the ON/OFF status only in the script but not giving me the value. First One is for ON/OFF status and second one is for the BR value, '0/0/2' is 1-bit object and '0/0/4' is 1byte Scale object.