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.

How to control the KNX bus via SMS and send notices via SMS?
#3
1. Place the contents of user.sms.lua into a new user library called "sms"

2. Create a Resident script for SMS handler. Set sleep interval to 0 and place the contents of resident.lua into the script.
You might have to edit this line:
Code:
comport = 'ttyUSB1'
And try ttyUSB0 or ttyUSB2, different modems have different ports that can work with SMS. You must disable / enable resident script after changing port name.

3. Add the contents of init.lua to the Start-up script, you have to reboot LM via Systems config afterwards. Do not reboot via power cycle or you might lose your newly created scripts.

4. Edit script the resident and set the PIN and allowed numbers for SMS handler

5. To send SMS from a script:
Code:
require('user.sms')
sendsms('12345678', 'test sms')

6. Command syntax:
  a. Write to bus:
    W ALIAS VALUE
  b. Read from bus:
    R ALIAS

On read request, script will reply with SMS message containing current value of selected object.

ALIAS can be:
  a. Group address (e.g. 1/1/1)
  b. Name (e.g. Obj1). If name contains spaces then it must be escaped usign double quotes (e.g. "Room Temperature")

NOTE:
  a. Object data type and name must be set in Objects tab. Otherwise script won't be able to read and write to object.
  b. Only ASCII symbols are accepted in the message.

Examples:
  a. Binary write:
    W 1/1/1 true
  b. Scaling write:
    W LED1Red 67
  c. Temperature (floating point) write:
    W "Room Setpoint" 22.5
  d. Read:
    R 2/1/1

Attached Files
.lua   init.lua (Size: 199 bytes / Downloads: 107)
.lua   resident.lua (Size: 3.49 KB / Downloads: 116)
.lua   user.sms.lua (Size: 9.11 KB / Downloads: 130)
Reply


Messages In This Thread
RE: How to control the KNX bus via SMS and send notices via SMS? - by admin - 28.08.2015, 07:20

Forum Jump: