Inspection
One way to enter or update information is via an inspection by a person. An inspection is a form with multiple fields. Each field is a different topic. The values can be specified with different controls such as buttons, checkboxes and drop down lists. An overview of all controls and how they can be defined can be found in the reference section. Forms are specified in a special language which can be compared to markdown.
The reason for using a textual description instead of a point-and-click user interface is because changing and modification of forms is much faster. You can quickly create or modify forms with copy-paste in a text editor. It is also easier to keep track of versions, share forms and automatically generate forms by a computer program.
Create
To create a new form select Forms
from the menu and click on +
. A new form is created and you specify controls by selecting Edit
from the item menu. In the text box you can now enter the specification for the form. The first line is the name of the form and the form fields are defined by subsequent lines separated by empty space. By default all fields are text fields. To create a new form named Apartment inspection
with a text field Reference
enter:
Apartment inspection
Reference
Living room
[Good,Average,Bad,NA]
Kitchen
[Good,Average,Bad,NA]
Bathroom
[Good,Average,Bad,NA]
Garden
[Good,Average,Bad,NA]
Electricity usage
[000.0]
|6
Date
|6
Click Update form
to see how the form looks. The minimum specification for a control is a single word, which is interpreted as a text input. Different types of controls can be defined by entering options on the next line between [
and ]
. For example, to define a button bar you can enter a comma separated list of options. For a number you can specify a decimal format like 0.00
. To indicate that a field is a date enter yyyy-mm-dd
.
By default the controls are the full width of the screen but you can specify the width using a 12 column layout. The example below shows that the two controls are each 6 columns wide, so they each take 50% of the screen width are are placed next to eachother.
Submit
To perform an inspection select the form from the list and fill out the form. After completion click on Submit
.
When submitting the contents of the form is used to update the state. The main topic is the the name of the form without 'inspection', the subtopic is the content of the reference
field and the last item of the topic is the name of the form field in lower case and spaces replaced by -
. When submitting a form the following information is sent to the server:
{
topic: apartment.a12,
state: {
living_room: good,
kitchen: 'good',
bathroom: 'bad',
garden: 'average',
electicity_usage: 1234
},
spacetime: [51.121221, 4.121345, 0, '2021-12-07 12:55]
}
On the server this results updates to the current state and new entries in the logs for the following topics:
apartement.a12.living_room = good
apartement.a12.kitchen = good
apartement.a12.bathroom = bad
apartement.a12.garden = average
apartement.a12.electricity_usage = 1245
You can change the value of the buttons from text to a numerical value by adjusting the specification of the button field. In the example below the value for the kitchen would be set to 10
, which can be useful for statistical analysis.
Living room
[Good:10,Average:5,Bad:1,NA:0]
QR Code
The inspection form can also be opened by entering an URL in a browser. The first part is the address of your server followed by 'inspect', the name of the form without 'inspect' and the reference. For example:
http://app.localhost/inspect/apartment/a13
You can create a QR code with this URL using an online QR code generator. Print the QR code and attach it to the room or device you want to inspect. An inspector can then scan the QR code with a smartphone and the form is automatically openened. Inspections can only be completed by authorized users. If an inspection form is opened the user is asked for the username and password. This only needs to be done once and with scanning subsequent QR codes the form is opened directly.