Entities

Config Key: entities

Each entity that room-assistant exposes is managed by a central registry and has a locally unique ID. You can apply some configuration options to any entity to modify the behavior.

Settings

NameTypeDefaultDescription
behaviorsBehaviorsOptions that modify the behavior of the entities.

Behaviors

Behaviors may be set per entity ID, with the ID being the key and an object with some of the properties below as value in the configuration map.

NameTypeDefaultDescription
debounceDebounceAllows you to debounce state updates for entities.
rollingAverageRolling AverageMakes sensors output the average value based on a sliding window.

Debounce

Debouncing is especially helpful for sensors that jump states quickly in an incorrect manner. This could for example be the case for some GPIO sensors or thermopiles. This behavior is based on the Lodash debounce implementationopen in new window and the options will therefore behave the same.

NameTypeDefaultDescription
waitNumberNumber of seconds to wait after the last time the state was updated before publishing it to integrations.
maxWaitNumberMaximum number of seconds that a state update may be delayed. If left undefined there will be no limit.
leadingBooleanfalseInvoke the update on the leading edge of the timeout.
trailingBooleantrueInvoke the update on the trailing edge of the timeout.
Example Config
entities:
  behaviors:
    d6t_occupancy_count:
      debounce:
        wait: 0.75
        maxWait: 2

Rolling Average

This behavior is useful for when you have a sensor that on average has the correct value, but sometimes changes to wrong states. It will make the sensor output the average value that it has seen over the window period that you configured. Depending on the state type the average calculation behaves differently:

  • For numeric states, the weighted average of all values seen in the window period will be calculated.
  • For other states, the state that the original sensor spent the longest time in over the last window seconds will be chosen as the output.

The state itself is updated every second.

NameTypeDefaultDescription
windowNumberNumber of seconds to look back for when calculating the average state.
Example Config
entities:
  behaviors:
    bluetooth-classic-xx-tracker:
      rollingAverage:
        window: 300