Back to changelog
    IoT Logic

    Know which geofence a device is in

    One formula now returns the name of the geofence a device is in, however many geofences the account holds.

    geofenceName() checks the position in each data packet against your geofences and returns the name as text. You store it as a calculated attribute in an Initiate Attribute node, and from there it behaves like any other attribute: it shows up in Data Stream Analyzer, it can be displayed as a custom sensor, and it can be forwarded to an external system. Used as a condition in an IF/THEN Logic node, it routes data for a whole set of areas at once, which suits cases like spotting a route deviation or an entry into a restricted zone.

    Until now you named one geofence per check with inGeofence(), so covering many areas meant a chain of conditions and a flow edit every time a geofence was added. An optional tag narrows the search when only some of your geofences matter for that attribute, for example depots but not customer sites.

    The function is a paid option, sold separately and switched off by default. Contact your service provider to have it enabled for your account. Until it is on, a flow that uses the function cannot be saved.

    Add it in the Formula field of an Initiate Attribute node in IoT Logic. Type the function name yourself: the attribute autocomplete does not offer it, and the geofence picker appears only in the IF/THEN Logic node.

    Learn more in the documentation →

    Improvements

    Closing a node that has unsaved changes now asks whether to keep editing or discard them. Pressing Esc or the close button used to shut the panel straight away and drop the edits.

    Fixes

    • enterGeofence() now returns true only on the packet where a device crosses into a geofence. Flows could fire it repeatedly while the device stayed inside the same geofence, sending several webhook requests for a single passage.
    • Sensor values that a device reports through a peripheral, such as an analog fuel sensor on a MettaX MC202X, now reach IoT Logic as attributes. They appeared in the device logs but were missing from Data Stream Analyzer, so they could not be used in a formula or to set up a fuel sensor.