Editing while running
What happens to running devices when you change the project in the GUI.
In the GUI you can edit a project while its devices run. Most edits reach running instances at once, and the instances stay connected. An edit that changes how an instance connects waits until you restart the instance: the GUI marks those instances. It also blocks the devices that cannot start.
This page describes the GUI. Edits an AI agent makes over MCP, in the GUI or in senzor-cli mcp, affect running devices the same way. senzor-cli run reads the project once when it starts; to apply changes, stop it and run it again, or start it with --watch, which applies each save the same way and restarts only the instances whose connection changed (see Apply saves while it runs).
Validation on every edit
Every edit validates the whole project again. The Problems tab at the bottom of the window lists every problem and shows how many there are, for example Problems (1). Click a problem to go to the device, template or broker settings it is about.

Devices with problems are blocked
A device with problems cannot start until you fix them. In the Devices tab it reads like office ×5 (has errors), and both its Start device button and the Start item in its right-click menu are disabled. Its stopped instances are not listed until the problem is fixed. A device can also be blocked by a problem that is not its own:
- a template with problems blocks every device that uses it;
- a broker problem, such as a
password_envvariable that is not set or a TLS file that cannot be read, blocks every device.
If the device was running when the problem appeared, its running instances keep running with their last valid settings. They carry the badge device has errors, and the instance view says: "Its device has problems (see the Problems tab); it keeps running with its last valid settings." You can stop or kill them, but not restart them, since there are no valid settings to restart with. Once you fix the problem, they belong to their device again and take its current settings, as described below.
Edits that apply at once
When an edit changes the settings of a running instance but not how it connects, the instance takes the new settings at once. It stays connected, so your consumers see no offline or online. This covers:
- its messages: topics, payloads and MQTT 5 properties;
- its fields: generators, scripts, units and names;
- the interval, QoS and retain;
- params and field overrides;
- the template the device uses;
- the seed;
- Home Assistant discovery;
- subscriptions: their topics, QoS and scripts.
The run carries on with the new settings:
- A field whose generator you did not change keeps its state: a random walk carries on from its current value. A field you add, or whose generator you change, starts afresh; for a field script, a changed script counts as a changed generator, so its
valuestarts again fromstart. - The scripts'
statestays as it is. - The instance unsubscribes from the topics of subscriptions you remove and subscribes to the topics you add or whose QoS you change, without reconnecting. An instance that is reconnecting subscribes to the current topics once it is back.
- A field you remove disappears from the instance, and so does its pin. Pins on the other fields stay.
- A new interval applies at once: the next tick comes one new interval after the edit.
seqand the time a sine follows carry on.- A new seed applies from the next tick. To repeat a seeded run from its start, restart the instance (see Reproducible runs).
- With Home Assistant discovery, the instance publishes the config messages that changed. When you remove a field or turn
home_assistantoff, it clears the config messages it no longer sends, and Home Assistant removes those entities. An instance that is reconnecting publishes them once it is back.
Connection changes: restart to apply
An instance connects with the broker settings and, when its template has availability, with a Last Will made of the availability topic and its offline payload. Both are fixed for as long as the connection lasts. So when an edit changes the broker settings or the template's availability (its topic, online or offline payload, or will delay), running instances carry on with the settings they connected with. That includes a param that the availability topic uses. None of the edit applies, not even the parts that could apply at once. Each such instance gets the badge restart to apply, and its instance view says: "The project changed; restart this instance to apply it."
Restart stops the instance cleanly and starts it again with the current settings. It is in the instance view and in the right-click menu of the instance. The right-click menu of a device has a Restart that restarts all of the device's running instances. A restart begins a new run: generators start afresh and pins are cleared (see Values and generators).
Instances that are not running always start with the current settings, so they never need a restart.
Removed instances
If you delete a running device, lower its count, or change its instance IDs (renaming the device does that too, unless its instance_id pattern leaves out {{ id }}), the running instances that are no longer part of the project keep running. Senzor calls them orphans:
- an orphan of a device that still exists is listed under that device, with the badge removed;
- the orphans of a deleted or renamed device are listed under the old name, shown as
office (removed).
The instance view of an orphan says: "This instance is no longer in the project; it disappears when stopped." Stop or kill it; once it has stopped, it leaves the list.
New devices
A device you add while others run appears with its instances stopped. Autostart applies only when a project is opened, so start the new device yourself, or use Start all.
Opening another project
When you open another project, or start a new one with New, the devices of the previous project stop first and each goes offline cleanly. The new project's autostart devices start only after that. Its instances may use the same client IDs as the old ones, and if they connected first, the broker would drop the old connections and publish their Last Will: your consumers would see offline after the new online and take running devices for gone.
While the GUI waits, the top bar shows starting devices…; hovering it explains: "Waiting for the previous project's devices to go offline". Commands you give during the wait, such as Start all, run once it is over. Stop all cancels the pending autostart and those commands.