input
Description
The input block is used to read the value returned by the selected property of the chosen device and make it available to the rest of the project logic. It is intended mainly for read-only properties such as temperature, input state, light level, another measurement, or any other value reported by the device.
The block has no flow inputs.
The block provides two outputs:
- the current value returned by the device
- information about whether the device is currently attached
Configuration parameters
| Parameter name | Value |
|---|---|
Device identifier (device_id) |
Required parameter. It specifies the device from which the value should be read. |
Device property name (device_property_name) |
Required parameter. It specifies the device property from which the value returned by the device should be read, for example an input state, temperature, light level, or another measurement. |
Input handling
The input block has no inputs. It does not accept any events from other blocks.
The only data source for the block is the selected device and the specified property of that device. Every time the device reports a change of that property, the block updates its outputs and the description visible below the block.
Detailed operating rules:
- if the device is attached, the first output carries the current value returned by the selected device property
- if the device is attached, the second output carries the logical value
true - if the device is detached, the second output carries the logical value
false - if the device provides its own text description of the current value, that description is shown below the block
- if the device does not provide its own description, the block tries to show the standard text representation of the current value
- if the device is attached but the current value cannot be represented as text, the description below the block is
unknown - if the device is detached, the description below the block is
detached
The block does not filter or convert values coming from the device. On output 1, it provides exactly the same logic_value that was returned by the selected device property.
Block outputs
The block has two outputs:
| Output number and name | Output description |
|---|---|
1: Value returned by the device |
This output carries the current value returned by the selected device property. This applies mainly to read-only values such as an input state, temperature, or measured brightness level. |
2: Attachment status |
This output carries the logical value true when the device is attached and false when the device is detached. |
The description visible below the block reflects the current state:
detachedwhen the device is detached- the textual representation of the current device value when it is available
unknownwhen the device is attached but the current value cannot be represented as text
If several input blocks refer to the same device, the description may include a numeric prefix, for example 3(2): detached or 2: true. Such a prefix indicates how many input blocks are associated with the same device and how many of them refer to exactly the same property.
Errors visible to the user
The block can return the following errors:
| Error code | Error description |
|---|---|
Missing device_id configuration. |
The device identifier was not provided or the parameter has an invalid value. |
Missing device_property_name configuration. |
The device property name was not provided or the parameter has an invalid value. |
Init failed. |
The block failed to initialize correctly and cannot operate. |
The detached state means there is currently no connection to the device. It is not a block configuration error.
Examples
- If the
inputblock is configured to read a binary input state and the device reports the value true, then output1will carry true and output2will carry true. - If a temperature sensor returns a new measurement, for example
23.5, the block will pass that value unchanged to output1. - When the device becomes detached, output
2will change tofalseand the description below the block will change todetached. - If the device is attached but its current value has no available textual description, the description below the block will show
unknown.