RS485 Frame Sensor
The rs485_frame sensor platform exposes hub-state diagnostics (frame counters,
CRC failures, queue depth, etc.) as Home Assistant sensors. It requires the
RS485 Frame hub to be configured.
User payload decoding is not done on this platform. To decode the contents
of received frames, use on_frame: on the hub
with platform: template sensors — that pattern handles every case from a
single bit-field LED mask through a multi-field temperature/text frame.
Configuration variables
Section titled “Configuration variables”-
rs485_frame_id (Required, ID): The ID of the
rs485_framehub. -
decode (Required, string): Which hub diagnostic value to publish. Each decode value carries Home-Assistant-conformant defaults (state class, unit, and for
last_keepalive_msa device class) so you do not have to set them yourself:decode Description state_classunit_of_measurementother frames_receivedValidated frames received. total_increasingframescrc_failuresFrames that failed validation (CRC or structural). total_increasingframescommands_sentUser commands transmitted (idle keepalives excluded). total_increasingcommandscommand_dropsCommands dropped (queue full or sniffer mode). total_increasingcommandslast_keepalive_msGate-frame interval in ms. measurementmsdevice_class: durationqueue_depthCurrent TX queue depth (including any pending delayed). measurementcommands
All other options from Sensor.
Every diagnostic also defaults to entity_category: diagnostic. You can override
any of the per-decode defaults by setting the same key explicitly in YAML.
Sensors publish on change only. A counter that has not advanced does not generate
API traffic, so no throttle filter is required for steady-state operation.
Example
Section titled “Example”sensor: - platform: rs485_frame rs485_frame_id: pool name: "Frames Received" decode: frames_received
- platform: rs485_frame rs485_frame_id: pool name: "CRC Failures" decode: crc_failures
- platform: rs485_frame rs485_frame_id: pool name: "Queue Depth" decode: queue_depthInterpreting the counters
Section titled “Interpreting the counters”- A rising
crc_failureswith zeroframes_receivedusually means the wrong baud rate or UART settings. - A small steady
crc_failuresalongside healthyframes_receivedsuggestscrc.typeorcrc.rx_acceptneeds adjustment. command_dropsshould stay at 0 in normal operation. Withqueue_policy: replace_latest, every press that arrives while another command is pending increments the counter — useful for detecting button mash. Withqueue_policy: fifo, drops indicate the queue is too small.last_keepalive_msshows the bus poll interval. Sudden changes here often indicate bus contention or controller reboots.