Senzorv1.0.1

Files

Create, open and save project files from the GUI, reopen recent ones, and what Senzor does to the file when it saves.

A project is one TOML file. The GUI edits that file's contents in memory; nothing is written until you save. The top bar shows the file name, or untitled for a project without a file, with a * when there are unsaved changes. Undoing an edit by hand, so the project matches the file again, removes the *. See The project file for what the file holds.

You can also open a file when you start the GUI:

senzor examples/showcase.toml

New and Open

New starts an empty, untitled project. Open shows a file dialog that lists TOML files (Senzor project) and opens the one you pick. Replacing the project this way stops every instance of the current one; the new project's autostart devices start once those instances are offline (Running devices).

A file opens even when it has validation problems: they appear in the Problems tab, and you can fix them in the GUI. A file that cannot be read, that is not valid TOML, or that does not match the project format (an unknown key, for example) does not open. Senzor then shows Cannot open with the file's path, the note Fix the file in a text editor, then open it again. and the errors with their line and column. The current project stays open; if you named the file on the command line, Senzor starts with an empty project instead. To check a file from the command line, run senzor-cli validate (CLI reference).

You can also drop a project file on the window, from a file manager for example, to open it the way Open does. While you drag a file over the window, it reads Drop to open the project. When you drop several files, Senzor opens the first.

Recent projects

The clock button next to Open lists the project files you opened or saved lately, the latest first; hovering over it reads Recent projects. Each entry shows the file name and, smaller, its folder. Click one to open it the way Open does: Senzor asks about unsaved changes first, and the current project's instances stop.

A file goes to the top of the list when it opens, including a file named on the command line, and when you save it with Save or Save as. A file that cannot be opened is not added. The list keeps the last 10 files, and Clear list at its bottom empties it. Projects that an AI agent opens or saves over MCP are not added.

If a file in the list no longer exists, clicking it shows Something went wrong with <path> no longer exists, so it was taken off the recent projects., and the current project stays open. Senzor keeps the list with its settings.

Examples

The books next to the clock, Examples when you hover over them, list example projects; the welcome screen lists them too. They are the files in the repository's examples/ folder that the documentation shows: Quick start, IKEA Zigbee2MQTT, Home Assistant Statestream, Home Assistant Discovery, Thermostat, Binary payloads, Fleet and Showcase. Hover over one for what it simulates.

An example opens as an untitled project, the way Open opens a file: Senzor asks about unsaved changes first, and the current project's instances stop. It has nothing to save until you change it, and Save asks where to save it. Its autostart devices start right away, so Quick start connects to a broker at localhost:1883; change the broker in Project settings if yours is elsewhere. Binary payloads reads a .proto file of its own: Senzor writes it to a senzor-examples folder in the system's temporary folder and reads it from there until you save the project. Save the project next to a copy of proto/sensor.proto, or change Proto file.

When the file changes on disk

About once a second, Senzor checks whether another program, such as your text editor, changed the project's file. When the file now holds a different project, the window asks: project.toml changed on disk (with your file's name). Changes that leave the project as it was, such as a new comment or other formatting, and a file that is not valid TOML yet do not ask: Senzor waits until the file reads as a project.

  • Reload takes the file's version. Devices that are running keep running: they take the file's settings at once, show restart to apply where their broker settings or availability changed, or show removed when they are gone from the file; see Editing while running. Undo brings back the version you had. If you had unsaved changes, the question says that Reload replaces them.
  • Keep my version leaves the window as it is. Your version then counts as unsaved changes, so the title shows *, and Save writes it over the file. Escape or a click outside the question does the same.

While another question is open, Senzor waits with this one until you answer it.

Save and Save as

Save writes the project to its file. For a project without a file, it works like Save as. While there are unsaved changes, Save is filled with the accent colour.

Save as asks where to save, suggesting the current file name, or project.toml for a new project. Senzor adds .toml to a name that does not end in it (in any letter case), so the file shows up in the Open dialog: myproject is saved as myproject.toml, and notes.txt as notes.txt.toml.

The save dialog checks for an existing file only under the name you typed. If the name with .toml added already exists, Senzor asks before it overwrites that file: Replace myproject.toml? says the file already exists in its folder and that replacing it overwrites its contents. Click Replace to save over it, or Cancel to write nothing.

After Save as, the project's file is the new one, and relative TLS paths in the broker settings are resolved against its folder.

How Senzor saves

  • Your file stays as you wrote it. Senzor changes only what you edited: comments, blank lines, the order of keys and tables, inline tables, and how unchanged values are written, such as 600 or "60s", stay as they are. A key you left out because its default suits you stays out until you change it. A new device or template is added at the end of the file, with every key written out. A device or template you delete takes the comments inside it along; the others keep theirs. If Senzor cannot apply an edit to the file's text this way, it writes the whole file in its own layout instead, which drops comments; a #:schema line at the top is kept even then.
  • Changes made in your editor count. When another program changes only comments or formatting in the file, the next save in Senzor keeps those changes.
  • No half-written files. Senzor writes the project to a temporary file next to the original and then swaps it in, so a crash while saving leaves either the old file or the new one. Two cases are rewritten in place instead: a file with other hard links (so every name sees the change), and a file in a folder where Senzor cannot create the temporary file.
  • Permissions are kept. The saved file gets the old file's permissions, so a file you keep private because it holds a broker password stays private.
  • Symlinks stay links. Saving through a symbolic link writes the file it points to and keeps the link.
  • Read-only files are not overwritten. Saving to a read-only file fails, and Senzor shows Something went wrong with a message such as cannot write /path/to/project.toml: the file is read-only. The project keeps its unsaved changes.

Edit the file as text

TOML in the top bar, or Edit the project file as text in the command palette, shows the project file in the middle of the window, as Save would write it, comments included. Type into the box, then click Apply, or press Ctrl+Enter, to make your text the project:

  • Apply is one edit: Ctrl+Z takes it back, also when you changed only comments.
  • Text that is not a valid project file is not applied. The reason shows in red above the box, such as line 3, column 1: ..., and your text stays so you can fix it. Problems such as an unknown template are not in the way: they show in the Problems tab as for any other edit.
  • Not applied yet next to the buttons means the box holds text you have not applied. Revert puts the project's text back. Edits you make elsewhere in the window show in the box until you start typing in it.
  • What you applied, comments included, is what the next Save writes. Until you save, the window counts it as an unsaved change, even when you changed only a comment.

Unsaved changes

When the project has unsaved changes, New, Open, opening a recent project or an example, and closing the window first ask Unsaved changes, for example Save the changes to this project before opening another project?

  • Save saves the project, then goes on. For a project without a file, Senzor asks where to save first; if you cancel that dialog, nothing else happens and the project stays as it is.
  • Discard drops the changes and goes on.
  • Cancel keeps the project open with its changes. Escape or a click outside the dialog does the same.

A name you are still typing into an ID or name box counts as a change, so the question also comes up for a rename you have not confirmed yet.

On this page