air-conditioner
Description
The air-conditioner block is used to integrate an air conditioner controlled over Modbus RTU via RS485. The block periodically reads the device state and allows it to be controlled from the logic project and through the associated vlogic virtual device.
The block supports five independent functional areas:
- reference temperature
- work mode
- blowing force
- current temperature
- device on/off state
For the generic model, each of these areas can be enabled or disabled independently using its configuration group checkbox. If a given area is disabled, the block does not read it from Modbus and does not react to commands related to it.
The block has one main input and three inputs labeled with the tag block, used to force the device off, force heating, or force cooling. It does not expose standard logic outputs. Its state is visible mainly through the virtual device associated with the block.
The first read from the device takes place about 2 seconds after project initialization is finished. Subsequent reads are performed cyclically, with the interval set by “Refresh interval” in milliseconds.
Configuration parameters
| Parameter name | Value |
|---|---|
Name (name) |
Optional name displayed on the block in the editor. |
Device model (deviceModel) |
Selecting “Generic device” makes manual register configuration available. Selecting Mitsubishi BMS i-MXW uses the built-in map and hides the five manual configuration groups. The model is also passed to the virtual device. |
Device address (deviceAddress) |
Required Modbus slave address in the range 1 to 255. |
Endianess (endianess) |
Method of interpreting multi-byte data for the generic model. Select LittleEndian, BigEndian, SwapBytes, or SwapWords according to the device documentation. For Mitsubishi BMS i-MXW, the byte order is selected automatically. |
Refresh interval (refreshInterval) |
Required time between consecutive read cycles in milliseconds. Set a value in the 1-3600000 ms range. |
Response timeout (responseTimeout) |
Required maximum time to wait for the device response in milliseconds. Allowed range: 10-60000 ms. |
Client config (server) |
Required selection of the modbus-client configuration supplying the RS485 port settings. Set the connection parameters in the selected configuration's editor. RS485 settings must be consistent with the other Modbus blocks in the project. |
For “Generic device” in “Device model”, set “Endianess” and select the checkboxes of the groups needed below. Selecting a checkbox shows that group's fields and enables its handling; clearing it hides the fields and disables handling. Repeated labels “Register address”, “Function code”, “Value type”, and “Divisor” refer to the group in which you set them.
For the Mitsubishi BMS i-MXW model, the block uses a built-in register map. The built-in handling covers device on/off, work mode, reference temperature, blowing force, and current temperature. In this configuration, “Endianess” and the generic register map for these functions do not need to be provided. The required common parameters are “Device address”, “Refresh interval”, “Response timeout”, and “Client config”. The i-MXW device address must be in the 1-60 range.
For the Mitsubishi BMS i-MXW model, set “Baudrate” to 9600, “Parity” to None, and “Stop bits” to 1 in the “Client config” editor (9600 8N1).
In the reference temperature, work mode, blowing force, and on/off groups, changing “Function code” updates the “Value type” list. Select the function code and type according to the device documentation and the allowed combinations described below. In “Read temperature configuration”, both function codes use the same type list.
Reference temperature
Group “Reference temperature configuration”.
| Parameter name | Value |
|---|---|
Reference temperature configuration (enableReferenceTemperature) |
Enables reading and writing of the reference temperature. |
Register address (referenceTemperatureRegisterAddress) |
Register address in the range 0-65535. |
Function code (referenceTemperatureFunctionCode) |
Read/write mode. Allowed values: 0x03/0x06 or 0x03/0x10. |
Value type (referenceTemperatureValueType) |
Data type stored in the register. For 0x03/0x06, only SIGNED_NUMBER16 and UNSIGNED_NUMBER16 are allowed. For 0x03/0x10, the allowed values are SIGNED_NUMBER16, UNSIGNED_NUMBER16, SIGNED_NUMBER32, UNSIGNED_NUMBER32, and FLOAT. |
Divisor (referenceTemperatureMultiplierDivisor) |
Set an integer in the 1-5000 range according to the device's temperature scale. When reading, the value from Modbus is divided by this parameter. When writing, the reference temperature is multiplied by it. |
Min temperature (referenceTemperatureMin) |
Minimum allowed temperature value. It cannot be lower than 0°C. |
Max temperature (referenceTemperatureMax) |
Maximum allowed temperature value. It cannot be higher than 80°C. |
“Min temperature” must be lower than “Max temperature”. If a value outside the configured range is sent to the input, the block does not report a user-visible error. Instead, it clamps the written value to the configured minimum or maximum.
For the Mitsubishi BMS i-MXW model, the reference temperature range depends on the currently read work mode:
- cooling: 10.0-30.0°C
- heating: 10.0-30.0°C
- auto/dead zone: 18.0-30.0°C
- ventilation only: reference temperature changes are ignored
The range visible in the virtual device is updated only after the real work mode has been read from the device. Internal temperature limits configured in the i-MXW device are not read by the block. If the device's real limits are narrower than the range shown by the block, the device may reject a temperature write.
Work mode
Group “Air conditioner working mode configuration”.
| Parameter name | Value |
|---|---|
Air conditioner working mode configuration (enableWorkMode) |
Enables reading and writing of the work mode. |
Register address (workModeRegisterAddress) |
Register address in the range 0-65535. |
Function code (workModeFunctionCode) |
Allowed values: 0x03/0x06 or 0x03/0x10. |
Value type (workModeValueType) |
The list depends on “Function code” in this group: use UNSIGNED_NUMBER16 for 0x03/0x06; UNSIGNED_NUMBER32 is also available for 0x03/0x10. |
Value setting the heating mode (workModeHeatingValue) |
Number written to the register for heating mode. |
Value setting the cooling mode (workModeCoolingValue) |
Number written to the register for cooling mode. |
Value setting auto mode (workModeAutoValue) |
Number written to the register for auto mode. |
Set at least two of the three options: “Value setting the heating mode”, “Value setting the cooling mode”, and “Value setting auto mode”. Configured values must be unique.
The virtual device may also expose ventilation-only mode if it is supported by a specific device model. For configuration based on the generic register map, mode availability is determined only by the “Value setting the heating mode”, “Value setting the cooling mode”, and “Value setting auto mode” values.
For the Mitsubishi BMS i-MXW model, the supported modes are cooling, heating, auto/dead zone, and ventilation only.
Blowing force
Group “Set blowing”.
| Parameter name | Value |
|---|---|
Set blowing (enableBlowingForce) |
Enables reading and writing of the blowing force. |
Register address (blowingForceRegisterAddress) |
Register address in the range 0-65535. |
Function code (blowingForceFunctionCode) |
Allowed values: 0x03/0x06 or 0x03/0x10. |
Value type (blowingForceValueType) |
For 0x03/0x06, only UNSIGNED_NUMBER16 is allowed. For 0x03/0x10, the allowed values are UNSIGNED_NUMBER16 and UNSIGNED_NUMBER32. |
Minimum airflow value (blowingForceMinimumIntensity) |
Minimum allowed intensity value. |
Maximum airflow value (blowingForceMaximumIntensity) |
Maximum allowed intensity value. |
“Minimum airflow value” must be lower than “Maximum airflow value”.
For the Mitsubishi BMS i-MXW model, the blowing force range is 0-3, where 0 means automatic fan speed, and 1, 2, and 3 mean minimum, medium, and maximum speed respectively.
Current temperature
Group “Read temperature configuration”.
| Parameter name | Value |
|---|---|
Read temperature configuration (enableCurrentTemperature) |
Enables reading of the current temperature. |
Register address (currentTemperatureRegisterAddress) |
Register address in the range 0-65535. |
Function code (currentTemperatureReadFunctionCode) |
Allowed values: 0x03 for holding registers or 0x04 for input registers. |
Value type (currentTemperatureValueType) |
Allowed values: SIGNED_NUMBER16, UNSIGNED_NUMBER16, SIGNED_NUMBER32, UNSIGNED_NUMBER32, FLOAT. |
Divisor (currentTemperatureDivisor) |
Set an integer in the 1-100000 range according to the device's temperature scale. After reading, the register value is divided by this parameter. |
For the Mitsubishi BMS i-MXW model, the current temperature is selected from the sensors in the following order: T1, T2, T3. If a sensor has an active fault alarm, the block skips it and tries to use the next sensor. If no valid temperature can be obtained from any sensor, the current temperature value in the virtual device changes to the unknown state.
Device on/off state
Group “Air conditioner on/off configuration”.
| Parameter name | Value |
|---|---|
Air conditioner on/off configuration (enableOnOffDevice) |
Enables reading and writing of the device on/off state. |
Register address (onOffDeviceRegisterAddress) |
Address in the range 0-65535. |
Function code (onOffDeviceFunctionCode) |
Allowed values: 0x01/0x05, 0x03/0x06, 0x03/0x10. |
Value type (onOffDeviceValueType) |
The list depends on “Function code” in this group. Selecting 0x01/0x05 or 0x03/0x06 leaves UNSIGNED_NUMBER16 in the form; selecting 0x03/0x10 also makes UNSIGNED_NUMBER32 available. |
Device enable value (onDeviceValue) |
Value written and recognized as the ON state. |
Device disable value (offDeviceValue) |
Value written and recognized as the OFF state. |
The “Device enable value” and “Device disable value” values must be different. For the 0x01/0x05 mode, only the values 0 and 1 make sense.
Write retries
The write retry limit is set by maxWriteAttempts in the selected modbus-client configuration in flows.json. This is a client setting, rather than a separate parameter of the air-conditioner block. It accepts an integer in the 0–65535 range or a string of digits, such as "3". It is independent of the read retry limit maxAttempts.
The value specifies the number of additional retries after the first attempt:
| Retry limit | Maximum number of attempts for one write |
|---|---|
0 |
1 |
1 |
2 |
3 (default) |
4 |
65535 |
65536 |
A missing field or an invalid value uses the default limit of 3 and does not by itself block the client configuration. Older flows without this field also use three additional write retries. Availability of the field in the editor form depends on deployment of support for this setting in the Node-RED nodes.
The shared limit is the highest maxWriteAttempts value across all modbus-client configurations in the current project. If all have 0, writes are not retried. With two clients set to 0 and 2, all writes can have two additional retries, including writes from the client set to zero. If there is no project or no client configuration, the limit is 3. Each new write receives its limit once; later configuration changes do not change the retries available to writes already waiting to be performed.
Retries cover write commands from the main input, the tag inputs, and the associated virtual device when confirmation times out, the device responds with an error, or the RS485 controller reports a communication error. Invalid data and local request preparation or send failures do not trigger further retries. Success ends the write immediately, without using the remaining attempts; retries do not guarantee success.
Other reads and writes, including those to other devices, wait until the current write succeeds or finally fails. A higher limit can therefore delay subsequent commands and data refresh. If confirmation is lost, the device may receive the same command again; execution exactly once is not guaranteed.
The air conditioner state is still confirmed by reads from the device. Sending a command or receiving a write confirmation does not optimistically change the displayed value. Information about the actual work mode, reference temperature, blowing force, and on/off state comes from reads.
Input handling
The block has one main input. The following data types are supported:
coolingcommand from thecommandblock: switches the device to cooling modeheatingcommand from thecommandblock: switches the device to heating modeautocommand from thecommandblock: switches the device to auto modeupcommand from thecommandblock: increases the blowing force by 1downcommand from thecommandblock: decreases the blowing force by 1- logical value true: turns the device on
- logical value false: turns the device off
- numeric value: sets the reference temperature
Additional operating rules:
- The
cooling,heating, andautocommands from thecommandblock work only when work mode handling is enabled and the corresponding register value has been configured. - The
upanddowncommands from thecommandblock work only when blowing force handling is enabled and the block knows the current value read from the device. upanddownnever go outside the configured minimum and maximum intensity range.- A numeric value received at the input is interpreted as the reference temperature. When writing, the block limits it to the “Min temperature” - “Max temperature” range.
- Values that do not match any of the rules above are ignored.
Inputs labeled with the tag block
| Input line | Action |
|---|---|
tag1 |
Forces the air conditioner off. |
tag2 |
Forces heating mode while the air conditioner is operating. |
tag3 |
Forces cooling mode while the air conditioner is operating. |
Each of these lines accepts Boolean values only. true enables the corresponding force, while false disables it. null, all other data types, and tags other than tag1-tag3 are ignored.
The forces are independent, and the resulting operating rule uses the following priorities:
- forced off takes priority over forced heating and forced cooling,
- forcing heating and cooling at the same time also results in forced off,
- if only forced heating or only forced cooling is active, the block keeps the device in the selected mode while it is operating.
Disabling a higher-priority force does not clear the remaining forces. The block then reapplies the rule resulting from their current values, but it does not turn the device on or restore its previous mode.
Forced off requires device on/off handling to be enabled. Forced heating or cooling requires device on/off and work mode handling to be enabled, with the corresponding heating or cooling mode configured. An attempt to enable a force that the device does not support is ignored.
An active forcing rule also applies to commands from sources other than the tag inputs, such as the main input or the associated virtual device:
- forced off blocks commands that turn the device on,
- with forced heating or cooling, external work mode change commands are ignored,
- a command that turns the device off is always allowed.
Forced heating or cooling does not turn an inactive device on by itself. After the device is turned on explicitly or externally, the block tries to set the required mode. During these attempts, the air conditioner may briefly operate in its previous mode. If the required mode is still not confirmed after three attempts, the block turns the device off. It remains off until the next explicit or external turn-on; the block does not turn it on again automatically. The active force remains set, so mode control starts again after the next turn-on.
These mode forcing attempts and forced off are independent of the communication retries controlled by maxWriteAttempts. Each write sent as part of forcing may have its own communication retries. Setting all write retry limits to 0 disables these retries, but does not disable the forcing rules.
If multiple sources provide a value for the same tag, the last valid value delivered takes precedence. For project readability, however, connecting one source to each tagged input line is recommended.
When the project is started or reloaded, the initial tag values are restored first, and only then is the resulting operating rule applied. This prevents the device from being controlled according to a temporary combination of values during project initialization.
Block outputs
The air-conditioner block does not expose standard logic outputs for further connections in the flow.
The air conditioner state is exposed through the associated virtual device. This device provides:
- reference temperature
- allowed reference temperature range
- work mode and information about which modes are available
- blowing force together with the range of allowed values
- current temperature
- on/off state
- device model
Each of these values can have one of three states:
- valid value
- unknown value, immediately after a final read failure once the globally configured retries are exhausted, or when the device returned data outside the expected range
- disabled value, when the given functional area was not enabled in the configuration
The virtual device also shows the forced off, forced heating, and forced cooling states. These three states are read-only and can only be changed from the logic project through the corresponding tag inputs.
Block status description
During normal operation, the status visible below the block shows the currently available air conditioner data. Configuration error messages and RS485 layer problems take precedence over the device data description.
The description consists of segments separated by |. The segments always appear in the following order:
- power state:
On,Off, orPower ? - work mode:
Heating,Cooling,Auto,Ventilation, orMode ? - current temperature:
Temp <value>°CorTemp ? - reference temperature:
Set <value>°CorSet ? - blowing force:
Fan <value>orFan ?
For the Mitsubishi BMS i-MXW model, automatic fan speed is shown as Fan Auto. Functional areas disabled in the configuration are omitted from the description. A ? means that an area is enabled but its value is currently unknown. It is shown in a partial description when at least one other value is available.
Example of a complete description:
On | Cooling | Temp 24.5°C | Set 22°C | Fan 2
Example of a partial description:
On | Mode ? | Temp 24.5°C | Set ? | Fan 2
After the device is confirmed to be off, the work mode, reference temperature, and blowing force are hidden. If current temperature reading is enabled, the description is, for example, Off | Temp 24.5°C or Off | Temp ?. If that reading is disabled, the description is Off.
If at least one reading is enabled but no valid values, read errors, or unavailable results have been reported yet, the block shows Waiting for device data while waiting for data. When all enabled values are unknown, the first final read error after the globally configured retries are exhausted, or the first result treated as unavailable by the block, immediately produces the description Device data unavailable, without waiting for subsequent read cycles. An unavailable result may also be a successfully received response containing an unrecognized or disallowed value. If at least one value remains available, the block shows a partial description with ? for the remaining values instead of either of these messages.
If none of the five readings is enabled, the description remains Working.
Errors visible to the user
The block can display the following error messages:
| Error code | Error description |
|---|---|
Invalid name configuration. |
The “Name” parameter has an invalid format. |
Invalid device model configuration. |
The “Device model” parameter has an invalid format. |
Invalid device address configuration. |
The “Device address” parameter is invalid or outside the 1-255 range. |
Invalid endianess configuration. |
The “Endianess” parameter has an unsupported value. |
Invalid refresh interval configuration. |
The “Refresh interval” parameter is invalid or outside the 1-3600000 ms range. |
Invalid response timeout configuration. |
The “Response timeout” parameter is invalid or outside the 10-60000 ms range. |
Missing RS485 configuration. |
The “Client config” parameter does not point to a valid modbus-client block. |
Mitsubishi BMS i-MXW requires RS485 baudrate 9600. |
The Mitsubishi BMS i-MXW model requires “Baudrate” set to 9600 in the selected client configuration. |
Mitsubishi BMS i-MXW requires RS485 parity none. |
The Mitsubishi BMS i-MXW model requires “Parity” set to None in the selected client configuration. |
Mitsubishi BMS i-MXW requires RS485 stop bits 1. |
The Mitsubishi BMS i-MXW model requires “Stop bits” set to 1 in the selected client configuration. |
Invalid enable reference temperature configuration. |
The “Reference temperature configuration” parameter is not a valid logical value. |
Invalid reference temperature register address configuration. |
Check “Register address” in the “Reference temperature configuration” and “Set blowing” groups. The address in each enabled group must be in the 0-65535 range. |
Invalid reference temperature function code configuration. |
The “Function code” parameter in the “Reference temperature configuration” group has an unsupported value. |
Invalid reference temperature value type configuration. |
The “Value type” parameter in the “Reference temperature configuration” group is invalid or incompatible with “Function code” in the same group. |
Invalid multiplier/divisor configuration. |
The “Divisor” parameter in the “Reference temperature configuration” group is invalid. Set an integer in the 1-5000 range according to the device's temperature scale. |
Invalid reference temperature minimum value. |
The “Min temperature” parameter is invalid or lower than 0°C. |
Invalid reference temperature maximum value. |
The “Max temperature” parameter is invalid or higher than 80°C. |
Invalid reference temperature minimum/maximum values. |
“Min temperature” is not lower than “Max temperature”. |
Invalid enable work mode configuration. |
The “Air conditioner working mode configuration” parameter is not a valid logical value. |
Invalid work mode register address configuration. |
The “Register address” parameter in the “Air conditioner working mode configuration” group is invalid or outside the 0-65535 range. |
Invalid work mode function code configuration. |
The “Function code” parameter in the “Air conditioner working mode configuration” group has an unsupported value. |
Invalid work mode value type configuration. |
The “Value type” parameter in the “Air conditioner working mode configuration” group has an unsupported value. |
Missing heating/cooling/auto value configuration. |
At least two valid values are required across “Value setting the heating mode”, “Value setting the cooling mode”, and “Value setting auto mode”. |
Duplicate heating/cooling work mode value configuration. |
“Value setting the heating mode” and “Value setting the cooling mode” have the same value. |
Duplicate heating/auto work mode value configuration. |
“Value setting the heating mode” and “Value setting auto mode” have the same value. |
Duplicate cooling/auto work mode value configuration. |
“Value setting the cooling mode” and “Value setting auto mode” have the same value. |
Invalid enable blowing force configuration. |
The “Set blowing” parameter is not a valid logical value. |
Invalid blowing force function code configuration. |
The “Function code” parameter in the “Set blowing” group has an unsupported value. |
Invalid blowing force value type configuration. |
The “Value type” parameter in the “Set blowing” group is invalid or incompatible with “Function code” in the same group. |
Invalid blowing force minimum intensity configuration. |
The “Minimum airflow value” parameter is invalid. |
Invalid blowing force maximum intensity configuration. |
The “Maximum airflow value” parameter is invalid. |
Invalid blowing force minimum/maximum intensity configuration. |
“Minimum airflow value” is not lower than “Maximum airflow value”. |
Invalid enable current temperature configuration. |
The “Read temperature configuration” parameter is not a valid logical value. |
Invalid current temperature register address configuration. |
Check “Register address” in the “Read temperature configuration” and “Air conditioner on/off configuration” groups. The address in each enabled group must be in the 0-65535 range. |
Invalid current temperature read function code configuration. |
The “Function code” parameter in the “Read temperature configuration” group has an unsupported value. |
Invalid current temperature value type configuration. |
The “Value type” parameter in the “Read temperature configuration” group has an unsupported value. |
Invalid current temperature divisor configuration. |
The “Divisor” parameter in the “Read temperature configuration” group is invalid. Set an integer in the 1-100000 range according to the device's temperature scale. |
Invalid enable on off device configuration. |
The “Air conditioner on/off configuration” parameter is not a valid logical value. |
Invalid on off device function code configuration. |
The “Function code” parameter in the “Air conditioner on/off configuration” group has an unsupported value. |
Invalid on off device value type configuration. |
The “Value type” parameter in the “Air conditioner on/off configuration” group has an unsupported value. |
Invalid on device value configuration. |
The “Device enable value” parameter is invalid or incompatible with the selected write method. |
Invalid off device value configuration. |
The “Device disable value” parameter is invalid or incompatible with the selected write method. |
Expected different on/off device value configuration. |
“Device enable value” and “Device disable value” have the same value. |
RS485 setup incomplete. |
The RS485 configuration is incomplete. Check the selected modbus-client settings. |
RS485 port missing. |
The RS485 port is unavailable. Check the connection of the device providing the port. |
Examples
The following examples use the generic model with the relevant configuration groups enabled and no active forces on the tag inputs. Select addresses, function codes, and value types according to the air conditioner's documentation.
- With an effective write retry limit of
1, if the first attempt to set the reference temperature receives no response and the second receives a valid confirmation, the write succeeds. The new temperature becomes visible only after it is read back from the air conditioner. - With the default effective limit of
3, if all four attempts of this write receive no response, the write ends with a final error. The displayed state still comes from reads, rather than the requested value. - If the
coolingcommand from thecommandblock is sent to the main input, the block writes the value configured in “Value setting the cooling mode” to the register. - If the value true is sent to the main input, the block writes the ON state defined by “Device enable value”.
- If the number
31is sent to the main input and “Max temperature” is set to28, the block writes the value corresponding to28to the device. - If the current blowing force is
2and theupcommand from thecommandblock is sent to the input, the new value is increased to3, as long as it still fits within the allowed range. - If current temperature reading is enabled, with a global setting of 3 retries, a single request can have up to 4 attempts: the first attempt and three retries. After the fourth failure of that request, the temperature immediately becomes unknown, without waiting for subsequent read cycles or retaining the last valid value as current. A later successful read restores a valid temperature, even if it is the same as before the error.