scripts
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | Last revisionBoth sides next revision | ||
scripts [2019/01/09 10:28] – akuzmuk | scripts [2019/01/09 10:29] – akuzmuk | ||
---|---|---|---|
Line 54: | Line 54: | ||
</ | </ | ||
- | ===== Notification functions ===== | ||
- | ==== SendSMS(phone_number, | ||
- | The SendSMS function sends a request to send an SMS to the number **phone_number** with the text **message**. Returns false if an error occurred and true if successful. Success does not mean delivering a message, but only success when creating a query. This function requires an Internet connection, an account in [[http:// | ||
- | |||
- | Format of **phone_number** - only digits with the country code, without spaces, brackets, plus sign. For example, " | ||
- | |||
- | ==== SendEmailMessage(emailAddress, | ||
- | |||
- | The SendEmailMessage function sends a request to send an e-mail to **emailAddress** with the subject of the letter **subject** and the text **message**. Returns false if an error occurred and true if successful. Success does not mean delivering a message, but only success when creating a query. This function requires an Internet connection, an account in [[http:// | ||
- | |||
- | The field **message** can contain the html-code. | ||
- | |||
- | Example: | ||
- | <code lua> | ||
- | function main (userId) | ||
- | SendEmailMessage(" | ||
- | " | ||
- | "<p style=' | ||
- | end | ||
- | </ | ||
- | |||
- | The function is available since WebHMI 2.7.4710 version. | ||
- | |||
- | ==== SendTelegramMessage(chatId, | ||
- | The SendTelegramMessage function sends a message with the text **message** to the chat with Id = **chatId**. Returns 1 if an error occurred and 0 if successful. Success does not mean delivering a message, but only success when creating a query. To use this function, you must have an Internet connection, an account in the [[Introduction to Level2 | Level2]] system. The service is free. | ||
- | To get ChatId, go to [[http:// | ||
- | |||
- | Example: | ||
- | |||
- | {{ : | ||
- | |||
- | ==== SendViberMessage(chatId, | ||
- | The SendViberMessage function sends a message with the text ' | ||
- | Success does not mean delivering a message, but only success when creating a query. To use this function, you must have a working Internet connection, an account in the system [[Introduction to Level2 | Level2]] and a positive balance in this system. The service is chargeable. This feature is available starting with firmware version 2.4.4227. | ||
- | To get ChatId, go to [[http:// | ||
- | |||
- | {{ : | ||
- | |||
- | You will be taken to the public WebHMI account. Go to the personal messages of the public account by clicking the button at the top right. | ||
- | |||
- | {{ : | ||
- | |||
- | Write any text in the chat. In response you will receive a message with a unique chatId chat ID. | ||
- | |||
- | {{ : | ||
===== Weather and resource monitoring ===== | ===== Weather and resource monitoring ===== |