The Notification driver sends push notifications to Android and iOS mobile devices via the Weble mobile application. It works similarly to the SMTP driver — writing a value to a notification address triggers a push notification to the specified user.
This is useful for:
Requirements
- The recipient is a user account of the gateway and has logged in at least once from the Weble mobile app on the phone to notify (see Weble mobile app).
- Notifications are relayed by the Weble servers through the Weble VPN: the VPN must be enabled and connected on the gateway (see Network – VPN).
%push:<username>, in the Usernames tab. You do not have to insert addresses.%push:<username> — from a route, a logic or the API. Every phone registered for this user receives the notification.gateways.writeValue('%push:john', 'Boiler room: high temperature')
| Label | JSON Key | Description |
|---|---|---|
| Name | name | A descriptive name. |
| Cluster ID | cluster | Cluster identifier. |
| Description | description | Optional description. |
| AppId | appId | Identifier of the mobile application that receives the notifications. Default: com.weble.webleview. Only phones registered with this application are notified. If left empty, all the phones registered for the user are notified. |
| DefaultSubject | defaultSubject | Title of the notification when the written value does not provide one. Default: WebleView. |
| Address | Meaning |
|---|---|
%push:<username> |
A user account of the gateway. Writing a value sends a push notification to all the phones registered for this user. Created automatically for every account. |
%push:<username>/<device id> |
A phone registered for this user (description: platform, model, version). For information only: it cannot be written. |
{ "value": "High temperature", "subject": "Boiler room" }."", 0, false) are refused with Please provide a valid message content. To push a numeric state, convert it to text in the route, for example "Alarm state: " + value.| Label | JSON Key | Description |
|---|---|---|
| Name | name | The address name, %push:<username>. |
| Description | description | Optional description. |
| Log | log | Logging mode. |
| Error returned by the write | Cause |
|---|---|
Unknown username |
The address is not %push:<username> for an existing user account (device addresses cannot be written). |
NO_DEVICE |
No phone has ever been registered on this gateway: log in from the mobile app first. |
No username found with com <AppId> |
This user has no phone registered with this AppId: log in from the mobile app with this account, or check the AppId. |
Please provide a valid message content |
The value is empty, 0 or false. |
| Time-out or connection error | The Weble VPN is not connected. |
If the write succeeds but the phone shows nothing, check the notification settings of the app and of the phone: see Weble mobile app.