How to use subaccounts efficiently?

Building multi-layer flespi applications with the help of hierarchical subaccounts structure.

Devices USE channel

Devices USE a channel to receive messages and send commands over channel connections. 

Application: parent account can group devices. In this case, devices can’t have the same ident (e.g. it is not possible that two companies connect a device with the same IMEI to one host:port).  

subaccounts use parent channel

Channels and devices USE stream

The stream can subscribe for messages from child’s channels and devices.

Application: only the parent account can manage stream subscriptions and turn on or off subscriptions for specified channels or devices.

parent stream flespi subaccounts

Devices USE several modems to send SMS

Child account uses its own modem to send settings to devices and if it fails to deliver the message, then the parent account modem tries to send the SMS. (Subaccount is created without modem, so by default, it uses parent account's modem.)

Application: Parent account allows subaccount to use its own SMS service account but guarantees delivery of the SMS by backing up the modem if subaccount’s modem is not working properly. 

Note: Channels use modems to send channel commands via SMS, so all of the above applies to channels as well.

Calculators are assigned to devices

You can assign a calculator from the parent account to devices in a child subaccount. To get intervals from the calculator, subscribe to the flespi/interval/gw/calcs/{calc_id}/devices/{device_id}/{event_type} topic from the parent account.

Important! If you subscribe to the flespi/interval/gw/calcs/{calc_id}/devices/{device_id}/{event_type} topic from the subaccount, you won't receive messages, because the subaccount has no access to a calculator in the parent account.

See also
A detailed explanation of what we charge for, when, and on what conditions.
Manually posting messages into a flespi device.