An alarm on the Weble IoT Universal Gateway always answers two questions:
The two are independent: any trigger can use any channel. In most installations, the trigger is a route (or a logic circuit) and the channel is a notification driver: the route writes the message text to an address of the notification gateway, and the driver sends it.
This page helps you choose a trigger and a channel, gives complete recipes, and lists the checks to make when a message does not arrive. The configuration of each driver is described on its own page.
| Mechanism | Fires when | Configured in | Typical use |
|---|---|---|---|
| Status route | The status of an address changes (online, offline, or an error such as ! timeout) |
Routes, type status | A meter or a slave device stops answering |
| Gateway status route | A gateway becomes connecting, connected or disconnected |
Routes, type gateway status | A whole driver loses its connection |
| Value route with a function | The routing function decides that the value is abnormal and returns a message | Routes, Source value function | Temperature, pressure or level threshold |
| Logic circuit | A comparison in a circuit becomes true and a Write gate writes the message | Logic module | Conditions combining several values, delays, schedules |
| BACnet alarms and events | A remote BACnet device sends an EventNotification, or the local BACnet server raises one |
BACnet driver, Events & Alarms | Integration with a BACnet BMS |
| Alarms module | A definition with a threshold is matched, or a script raises an alarm | API or AI assistant only (section 6) | Alarms that must be acknowledged and resolved, with a history |
| Visualization alarms | An alarm function of a visualization element becomes active | Visualization | Operators who watch the site in the visualization |
The first four mechanisms are the most common. They need no licence of their own and cover almost every need: start with a route.
Visualization alarms are separate from the others. They are shown in the visualization (/ui) with a severity — critical (default), warning or maintenance — and are not sent by themselves: to send a message, add a route or a logic circuit on the same address.
| Channel | Driver | Needs | Direction | Works without Internet |
|---|---|---|---|---|
| SMTP client | An SMTP server and an account; SMTP licence | Send only; attachments possible | Yes, with an SMTP server on the local network | |
| SMS through the Weble service | SMS, type WebleSMS |
A WebleSMS account; Internet or the Weble VPN | Send only; groups and diffusion lists | No |
| SMS through the local modem | SMS, type LocalModem |
A gateway with a cellular modem and a SIM card (Linux only) | Send and receive | Yes (mobile network only) |
| SMS through an SMS provider | SMPP, type SNPP Client | An SMPP account at a provider, or an SMPP server on site; SMPP licence | Send only | Yes, with an SMPP server on the local network |
| WhatsApp / Telegram | IM whatsapp/telegram | Internet access; the Weble messaging service activated for the gateway | Send and receive replies | No |
| Push notification | Notification Android/IOS | The Weble mobile app logged in with a user account; the Weble VPN connected | Send only | No |
The two SMS types can be combined: with Type WebleSMS > LocalModem (or LocalModem > WebleSMS) the driver switches to the other provider when a send fails. See SMS: redundancy and retries.
| Need | Recommended channel |
|---|---|
| On-call technician who must react at any time | SMS, ideally WebleSMS > LocalModem; or WhatsApp / Telegram if the team uses it |
| Acknowledgement by reply ("ack", "ok") | WhatsApp / Telegram (replies on /#lastMessage), or SMS received by the local modem (%sms:lastMessage) |
| Several people at once | WhatsApp / Telegram group, or a WebleSMS group or diffusion list |
| Users of the mobile app | Push notification |
| Periodic report or file (daily counter values, CSV export) | E-mail, with the file as attachment: see SMTP: sending attachments and the CSV driver |
| Site without Internet | SMS through the local modem; e-mail or SMPP only towards a server reachable on the local network |
| Long text, details, links |
A communication loss is detected in two ways:
connecting, connected or disconnected.online, pending, offline, or an error that starts with !.Complete examples, with the routing functions that send an e-mail at the loss and at the return of the communication, are given in Email gateway status alerts and in Routes, section 4.2. Replace the e-mail address by an SMS, IM or push address to use another channel.
Goal: send one e-mail when a temperature goes above 30 °C, and one when it is back below 28 °C.
analogInput) to the address oncall@example.com:Boiler room of the SMTP gateway. The address is created on the first write.function (value, source, destination, options) {
var ctx = options.context // kept between executions of the route
if (!ctx.alarm && value > 30) {
ctx.alarm = true
return { subject: "ALARM boiler room: " + value + " °C", text: "The temperature is above 30 °C (" + value + " °C)." }
}
if (ctx.alarm && value < 28) {
ctx.alarm = false
return { subject: "End of alarm boiler room", text: "The temperature is back to " + value + " °C." }
}
// nothing returned: no e-mail
}
The gap between 30 and 28 °C (hysteresis) prevents a flood of e-mails when the value oscillates around the threshold. To limit the number of messages in any case, also set a Disable delay on the route (see Routes, section 2.12).
The same function works for any channel: for SMS, IM or push, return a text instead of an object, for example return "ALARM boiler room: " + value + " °C". See also SMTP: use with routes.
Goal: an SMS that still leaves if the Internet connection or the Weble service is down.
WebleSMS > LocalModem, and fill in the WebleSMS Username and Password.%sms:+41791234567.The driver sends through WebleSMS first and through the local modem if that fails.
Groups and diffusion lists of the WebleSMS account are always sent through the WebleSMS service, even in a redundancy mode. For a message that must leave without Internet, write to phone numbers.
Goal: notify an on-call group and let a technician acknowledge by answering "ack".
%im:whatsapp/Oncall, and its members, %im:whatsapp/Oncall/+41791234567 and so on. Keep Allow reply on yes or inherit.%im:whatsapp/Oncall. Every member receives it.%im:whatsapp/Oncall/+41791234567/#lastMessage as the source (one route per member, or a regular expression as source). Its routing function checks the text and writes the acknowledgement where it is needed, for example to an internal address $alarm_ack that a logic circuit uses:function (text, source, destination, options) {
if (String(text).trim().toLowerCase() == "ack") return 1
// any other reply: nothing written
}
See IM: example – alarm with acknowledgement and IM: what the recipient sees.
%push:<username> per user account.%push:<username>. To set the title, write an object: { "value": "High temperature", "subject": "Boiler room" }.The message must not be empty: convert numbers to text in the routing function, for example return "Alarm state: " + value.
The gateway also has an alarms module that keeps alarms with a life cycle and a history. It has no screen in the administration interface: it is used through the Peers API, by scripts, or by asking the AI assistant (for example "create an alarm when $room1/temp goes above 28 °C and send an SMS to +41791234567").
Each alarm follows the cycle active → acknowledged → resolved, then expires and leaves the history. The mode of the definition sets the default behaviour:
| Mode | Acknowledge | Resolve | Kept |
|---|---|---|---|
alarm |
Yes | Yes | Resolved alarms are kept 7 days |
alarmSimple |
Yes | No | Acknowledged alarms expire after 24 h |
journal |
No | No | Entries expire after 24 h |
Two safeguards limit floods: cooldownMs, the minimum time between the resolution of an alarm and a new one for the same target, and maxInstances, the maximum number of alarms of a definition active at the same time.
A definition can watch an address by itself with params.threshold:
address: the address to watch (id, name, <gateway>¬<name> or a view name);op: > (default), >=, <, <=, == or !=;value: the limit;message (optional): the text of the alarm.The alarm is raised when a new value matches the condition, and resolved automatically when a later value no longer matches.
params.onEvent writes a value to an address at each event of the alarm, so any channel of section 2 can be used. Give, for each event, an object with the target address and the value to write:
{
"id": "room1Hot",
"mode": "alarm",
"severity": "warning",
"cooldownMs": 600000,
"params": {
"threshold": { "address": "$room1/temp", "op": ">", "value": 28 },
"onEvent": {
"raised": { "address": "%sms:+41791234567", "value": "Room 1 too hot" },
"resolved": { "address": "%sms:+41791234567", "value": "Room 1 back to normal" }
}
}
}
The events are raised, acknowledged, unacknowledged, resolved, reopened, updated, expired and deleted. Without value, a JSON summary of the alarm is written. A list of objects sends to several addresses.
Acknowledging and resolving are done through the API (acknowledgeAlarm, resolveAlarm) or the AI assistant. The methods and their permissions are listed in Peers API: alarms.
| Check | What to look at |
|---|---|
| The notification gateway is connected | Green CONNECTED in Gateways. Otherwise open its log (☰ › Logs): a missing licence shows missing license. |
| The route fires and the write succeeds | Right-click the route and choose Listen (see Routes, listening to a route). No source line: the function returned nothing or threw (exception). A write-error line gives the error of the notification driver: look it up in the troubleshooting table of the driver page. |
| Empty message | Push notifications refuse an empty value, 0 or false; SMS refuse null. Build a text in the routing function. |
| Phone number | Write it in international format, with + and the country code, without spaces: +41791234567. |
| Internet / VPN | WebleSMS needs Internet or the Weble VPN; IM needs Internet; push notifications need the Weble VPN. |
| Account and service | WebleSMS: invalid account means a wrong username or password; an unknown group gives Unknows alias. IM: the messaging service must be activated for the gateway. Push: the user must have logged in from the mobile app. |
| Local modem | GSM mode and SIM PIN set in the network settings; SIM credit available. |
| E-mail does not arrive | Check the spam folder, the DefaultFrom address (the server may refuse a sender it does not own) and the port (465 for TLS, 587 for STARTTLS). |