SMS notifications
Instructions for sending SMS notifications to iOS and Android devices.
The SMS driver is based on the AV & Customs Systems driver. It works with SMS messaging services, allowing mobile devices to receive messages when relays, smoke detectors, motion sensors, or other devices are triggered.
Tip
Example for the SMS.ru service: SMS driver
Use the example to write your own driver for other SMS services:
- Twilio SMS;
- Telesign SMS Verify;
- Nexmo SMS Messaging;
- D7SMS;
- Telnyx;
- MessageBird;
- ClickSend (Inteltech);
- Nexmo Verify.
Example for the SMS.ru service (for Russian-speaking users)
- Sign up at sms.ru or another similar SMS messaging service.
- Obtain your secret key from the service. To do this, follow the link https://sms.ru/?panel=settings&subpanel=api.
- Download the example above, open the script editor, and enter the required data:
- device - driver reference (specify the "sms" driver);
- apiId - the secret key obtained in step 2;
- phoneNumber - the phone number that will receive SMS messages;
- TextMessage - message text.
- Bind the "Send" channel to an event (for example, a button press). The message will be sent when this event is triggered.

Example:
var device = IR.GetDevice("sms");
var apiId = "FDC658FC-784E-8DC2-AD67-7ACDABFF34C1";//write here your id from site sms.ru
var phoneNumber = "89998877666";//write here phone number
var TextMessage = "Hello World!";//text of sms
IR.AddListener(IR.EVENT_CHANNEL_SET, device, function(name, value)
{
if (name == "Send")
{
var mMessage = TextMessage.replace(" ","+");
var mUri = "/sms/send?api_id="+apiId+"&to="+phoneNumber.toString()+"&msg="+mMessage+"&json=1";
/* test */
//mUri += "&test=1";
var mData = 'GET, ' + mUri + ' ,';
//device.Send([mData]);
device.SendEx({
Type: "GET",
Url: mUri,
cbReceiveText: function(text, code, headers) {IR.Log("cbReceiveText "+text);}
})
}
});