Docs

Notifications

Push, persistent, email and SMS, and letting the installer choose recipients.

FunctionDeliveredNotes
sendPushNotification(message, title?, critical?, userIds?)phones of the account's userscritical: true = time-sensitive (prompt under Focus); never bypasses Do Not Disturb
sendPersistentNotification(message, title?)the app's notification centrestays until dismissed
sendEmail(to, subject, body)email via the cloudfire-and-forget
sendSms(to, message)SMS via the cloudUS 10-digit numbers

All four are fire-and-forget: they return immediately and failures are logged on the hub. They need the hub to be online; everything else in a smart app runs without the cloud.

function onLeak(evt) {
  sendPushNotification(`Water detected at ${evt.newState.attributes?.friendlyName ?? evt.entityId}`, 'Leak', true);
  sendPersistentNotification('A leak sensor tripped. Check the utility room.', 'Leak');
}

Choosing recipients

Let the installer pick people instead of hard-coding addresses:

{ key: 'recipients', label: 'Notify', type: 'accountUserId', multiple: true },
{ key: 'emailTo',    label: 'Email',  type: 'accountUserEmail' },

These input types are not hydrated as globals; read them from settings:

sendPushNotification(message, 'Security', false, settings.recipients);
if (settings.emailTo) sendEmail(settings.emailTo, 'Alarm', message);

The cloud rejects user ids that do not belong to the hub's account.

Rate and content

There is no per-app quota, but every push interrupts a person. Debounce noisy sensors with runIn, batch summaries with a daily schedule, and keep personal data out of messages (they transit the cloud and may appear on lock screens).

sendEmail, sendSms and httpRequest are not available to AI-generated user automations; your own registered apps can use them.

On this page