Senzorv1.0.1

Running devices

Start, stop, restart and kill devices and instances from the GUI.

Each instance of a device is its own MQTT client. While it runs, it publishes its messages on every tick of its interval. You control instances from the top bar, from the menus in the device tree, from Start device in the device editor and from the instance view.

Autostart

When a project opens, Senzor starts every device that has Autostart ticked in the device editor (autostart = true in the file, the default). Other devices stay stopped until you start them. A device you add while the project is open does not start by itself.

Opening another project, or starting a new one, stops every instance of the current project first. The new project's instances may use the same client IDs as the old ones, so Senzor waits until the old instances are offline before it starts the new autostart devices; meanwhile the top bar shows starting devices…. Commands you give with Start all or the menus during that wait are sent once the old instances are offline.

Start all and Stop all

Start all starts every device, regardless of autostart. Devices with problems are skipped, and instances that already run are left alone.

Stop all stops every running instance. With availability set up, each instance that is online publishes its offline message, then disconnects. If you click Stop all while new devices are waiting for the previous project's to go offline, those devices do not start.

The device tree

The Devices tab lists each device as its ID and instance count, for example office ×5, with its instances under it. A coloured dot shows each instance's status (see The window). While any of a device's instances is not stopped, the device also shows how many are online, for example 4/5 online.

To find devices and instances, type into the box with the magnifying glass above Add device. A device whose ID contains the text stays with all its instances; otherwise only the instances whose ID contains it stay. The match ignores case. The menu next to the box, All at first, shows only the instances that are Online, have Problems (reconnecting or failed) or are Stopped. When nothing matches, the tab reads No device or instance matches.

A device or instance can carry a note:

  • office ×5 (has errors): the device cannot start, because it, its template or the broker settings have problems. The Problems tab says why. While it has errors, its instances are not listed, except those still running as orphans.
  • restart to apply next to an instance: the broker settings or the template's availability changed, and the instance still runs with the settings it connected with. Restart it to apply your edits.
  • device has errors or removed next to an instance: the instance is an orphan (see Orphans).

Devices with more than 50 instances start collapsed, because laying out thousands of rows makes the window slow. Click the arrow next to the device to expand it.

Several instances at once

To act on instances of different devices together, or on some of a device's instances, select them in the tree. Ctrl+click an instance (Cmd+click on macOS) to add it to the selection, or to take it out again. Shift+click selects every instance from the one you clicked before to this one, in the tree's order (after the tree's filter).

With two or more instances selected, the detail panel names them and counts them by state, for example 2 online, 1 stopped, and offers:

  • Start for those that are stopped or failed, Stop and Kill for those that run, and Restart for those of the project that run, as the device menu does.
  • Pin, a field the instances have in common, to a value, and Pin all: every selected instance that runs publishes that value from its next tick on, as a pin does. Unpin all hands the field back to its generator on those that have it pinned.

A plain click on an instance selects it alone again.

Device menu

Right-click a device to act on all of its instances:

  • Start starts the device's stopped and failed instances. It is disabled for a device with problems; hover over it to read Fix the problems in the Problems tab first.
  • Stop stops every instance listed under the device: each one that is online publishes offline (if the template has availability) and disconnects.
  • Restart stops each running instance and starts it again with the project's current settings. Stopped instances stay stopped. When none of the device's own instances runs (orphans do not count), the item is disabled with the hint No running instances to restart. A device with problems has no Restart.
  • Kill, in red, drops the connection of every listed instance without publishing offline. If the template has availability, the broker then publishes the instance's Last Will, as it would for a device that lost power. See Availability and Last Will.
  • Duplicate, below a line, copies the device; see Duplicate device.

Instance menu

Right-click an instance for Start, Stop, Restart and Kill for that one instance. Unlike the device menu, Restart here also starts a stopped instance. For an orphan, Start is disabled and Restart is missing: it has no settings in the project to start with.

The instance view has the same actions as buttons.

Editing while devices run

Most edits reach running instances at once, and the instances stay connected. A change to the broker settings or to a template's availability needs a new connection: the instances it affects keep the settings they connected with and show restart to apply until you restart them. See Editing while running.

Orphans

An instance that leaves the project while it runs keeps running as an orphan. That happens when you delete its device, when the device, its template or the broker settings get problems, or when a change to the device's ID, Count or Instance IDs gives the device a set of instance IDs without this one (lowering Count from 5 to 3 while office-3 runs, for example). An orphan carries a note:

  • removed: the instance is no longer part of the project. Instances of a deleted or renamed device are listed last, under the old device ID followed by (removed). An instance dropped by a change to Count or Instance IDs stays under its device.
  • device has errors: the device, its template or the broker settings have problems; the instance keeps running with its last valid settings.

You can stop or kill an orphan, but not restart it, since there are no valid settings to start it with. Once an orphan stops, it disappears from the tree. For a (removed) entry, the device menu only offers Stop and Kill.

Closing the window

When you close the window, Senzor stops every instance cleanly before it exits, waiting up to 2 seconds for them, so your devices publish offline instead of leaving through their Last Will. If the project has unsaved changes, Senzor asks first (Files).

On this page