LM Lutron telnet listener - Printable Version +- Logic Machine Forum (https://forum.logicmachine.net) +-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1) +--- Forum: Scripting (https://forum.logicmachine.net/forumdisplay.php?fid=8) +--- Thread: LM Lutron telnet listener (/showthread.php?tid=414) Pages:
1
2
|
LM Lutron telnet listener - AEK - 06.10.2016 hello everyone!! I made function (with Admin's big help), which will show you what Lutron send by telnet I have lutron Homework QS create user libruary "lutron" Code: local socket = require("socket") and resident script Code: require('user.lutron') RE: LM Lutron telnet listener - AEK - 12.10.2016 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 Code: require('user.lutron') 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: --lutron parser Code: require('user.lutron') Code: require('user.lutron') RE: LM Lutron telnet listener - Erwin van der Zwart - 12.10.2016 Hi AEK, We did this Lutron link 2 years ago on a big project. Keep in mind to send a telegam once every x period otherwise the TCP connection will be closed (after 12 hours i believe) by Lutron. We included a mechanisme to request date or time every hour from the Lutron server to keep the connection alive. BR, Erwin RE: LM Lutron telnet listener - AEK - 13.10.2016 (12.10.2016, 14:15)Erwin van der Zwart Wrote: Hi AEK, Hi, Erwin! thanks for your advice. there will be request of current temperature every N minutes in our case, so I think there will be no problem. if you did this 2 years ago, could you post your code here to? I'm not programmer, so i understand my code only partially RE: LM Lutron telnet listener - Domoticatorino - 02.02.2017 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. RE: LM Lutron telnet listener - imprashant - 14.11.2022 (02.02.2017, 17:44)Domoticatorino Wrote: Hi Erwin, 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. RE: LM Lutron telnet listener - admin - 14.11.2022 What kind of status do you want to get? Do you already know the required status request message that should be sent to Lutron? RE: LM Lutron telnet listener - imprashant - 20.11.2022 (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. RE: LM Lutron telnet listener - admin - 21.11.2022 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/showthread.php?tid=414&pid=2197#pid2197 You will need a separate resident script for status queries. RE: LM Lutron telnet listener - imprashant - 22.11.2022 (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/showthread.php?tid=414&pid=2197#pid2197 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') RE: LM Lutron telnet listener - admin - 22.11.2022 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. Code: require('user.lutron') RE: LM Lutron telnet listener - imprashant - 29.11.2022 (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. 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) tcpend('#OUTPUT,151,1,'..value..'\r\n') RE: LM Lutron telnet listener - admin - 29.11.2022 What is the resident script sleep time set to? For outputs use this query format: Code: query('?OUTPUT,151,1', '1/1/151') RE: LM Lutron telnet listener - imprashant - 29.11.2022 (29.11.2022, 10:14)admin Wrote: What is the resident script sleep time set to? 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. RE: LM Lutron telnet listener - admin - 29.11.2022 Add logging to the query function like this and post what you get in Logs tab: Code: function query(req, out) RE: LM Lutron telnet listener - imprashant - 29.11.2022 (29.11.2022, 10:35)admin Wrote: Add logging to the query function like this and post what you get in Logs tab:Lutron Status 29.11.2022 16:17:17 * arg: 1 * string: receive failed * arg: 2 * string: invalid reply QNET> ~OUTPUT,151,1,11.00 Lutron Status 29.11.2022 16:17:17 * arg: 1 * string: receive failed * arg: 2 * string: invalid reply NET> Lutron Status 29.11.2022 16:17:17 * arg: 1 * string: receive failed * arg: 2 * string: invalid reply NET> Lutron Status 29.11.2022 16:17:18 * arg: 1 * string: receive failed * arg: 2 * string: invalid reply QNET> ~OUTPUT,151,1,11.00 Lutron Status 29.11.2022 16:17:18 * arg: 1 * string: receive failed * arg: 2 * string: invalid reply QNET> ~OUTPUT,151,1,11.00 Lutron Status 29.11.2022 16:17:18 * arg: 1 * string: no connection to device * arg: 2 * nil Lutron Status 29.11.2022 16:17:23 * arg: 1 * string: receive failed * arg: 2 * string: invalid reply QNET> ~OUTPUT,151,1,11.00 RE: LM Lutron telnet listener - admin - 29.11.2022 Try this query function: Code: function query(req, out) RE: LM Lutron telnet listener - imprashant - 29.11.2022 (29.11.2022, 11:01)admin Wrote: Try this query function:Now this is working great, but still sometimes are status update is immediate, but many times it is taking significant amount of time to update. RE: LM Lutron telnet listener - admin - 29.11.2022 You can lower the sleep time between polling cycles by modifying this line (currently it's 5 seconds): Code: os.sleep(5) -- delay between each poll cycle RE: LM Lutron telnet listener - imprashant - 29.11.2022 (29.11.2022, 11:16)admin Wrote: You can lower the sleep time between polling cycles by modifying this line (currently it's 5 seconds): I have made it 1 second. Now it is working fine, I hope it will work when I add more data points. Thank You Very much for your support. |