In automation systems, it is imperative to monitor the state of devices. Any sensor or actuator can fail at the most inopportune moment. Need information that the sensor is in working condition.
The intraHouse system has two error handling mechanisms.
The first is based on error handling on the plugin side. When developing a plugin, possible device errors can be taken into account. And then, in case of their occurrence, the plugin sends information about the error to the server. But sometimes it happens that the plugin itself does not know about the device error. And transmits nothing to the north for a long time.
The second mechanism. On the server side. Two types of errors are handled here.
Error – timeout. The server itself monitors the timeout of receipt of information from devices. If the device (via the plugin) does not report itself during a certain time, the error flag of this device is set.
Error – out of range. If the device receives a value outside the acceptable range.
Note. All error handling mechanisms work simultaneously.
Visually, the device error is displayed as a red triangle in the upper left corner of the device:
The first error handling mechanism (on the plugin side) is programmed in the plugin itself and is not configurable.
The second mechanism (on the server side) is configured in the device configuration:
1. Set the error flag if information from the device did not come within X sec.
From any analog sensor information should come within no more than 100-200 seconds.
From the door opening sensor (reed switch) information can come very rarely. Then it is better to put 0 (zero).
In any case, this time depends on the device.
2. Set error flag if information from the sensor is out of the specified range.
If this jackdaw is installed, the system compares the incoming value from the sensor with the range of acceptable values - Min Value and Max Value
3. Do not accept the value from the sensor if it is out of range.
If the value is out of range, the system simply flips it open for indication or analysis in scenarios.
To the error (red triangle) displayed on the device do not forget about the size of the error indicator. By default, it is set to 30. But suddenly you changed it;) The size is configured here:
Error handling in scripts
Above, I showed how to display device errors on the screen. Now let’s handle error handling in scripts.
As an example, consider the scenario of controlling the heating by a temperature sensor.
From the temperature sensor (STEMP_1_1) the value (VALUE) is received and compared with the setpoint (SETPOINT). If the temperature is below the setpoint, turn on the radiator (RADIATOR_1_1). If more, turn off.
Everything is working. The temperature in the room is regulated.
Add error handling:
If the sensor works without error (NOT ERROR), then the heating battery is turned on / off depending on the temperature (VALUE) and the setting (SETPOINT).
If there is an error, then regulation does not occur.
Add an error message:
If an error occurs, the timer is activated for 120 seconds. After testing the timer, check if there is an error. If the error persists, send a message by e-mail.
That’s all. The battery is controlled by a temperature sensor with an error.
You could add some more points. For example, in case of a sensor error, switch to another sensor. You can try to do this yourself.