Skip to content

RS485 Frame Number

The rs485_frame number platform sends a raw frame payload onto a DLE-framed RS485 bus when the value changes. It requires the RS485 Frame hub to be configured.

Use this platform when you need to send a numeric value as a custom-encoded payload (e.g., a VSP pump speed percent) that cannot be expressed as a fixed key command.

  • rs485_frame_id (Required, ID): The ID of the rs485_frame hub.
  • min_value (Required, float): Minimum allowed value.
  • max_value (Required, float): Maximum allowed value.
  • step (Required, float): Step size.
  • lambda (Required, lambda): Encodes the numeric value into a raw payload. Signature: optional<std::vector<uint8_t>>(float x). Return {} to send nothing. The returned bytes are wrapped in DLE framing and CRC by the hub before transmission.

All other options from Number.

number:
- platform: rs485_frame
rs485_frame_id: pool
name: "VSP Speed"
min_value: 0
max_value: 100
step: 1
unit_of_measurement: "%"
lambda: |-
// encode x into the frame payload; byte layout is protocol-specific
uint8_t pct = static_cast<uint8_t>(x);
return std::vector<uint8_t>{0x0c, 0x01, 0x00, pct};