Skip to content

Sensor Configuration

The card supports two types of sensor display:

Individual Sensors (sensors)

Display specific sensor entities in your preferred order. Sensors can be specified in two ways:

Simple String Format

sensors:
  - sensor.living_room_temperature_main # Specific sensor
  - sensor.living_room_humidity_main # Specific sensor
  - sensor.living_room_co2 # Additional sensor

Object Format

sensors:
  - entity_id: sensor.living_room_temperature_main
  - entity_id: sensor.living_room_humidity_main
  - entity_id: sensor.living_room_co2

Object Format with Custom Icon

You can configure a custom icon for sensors without requiring state-based matching:

sensors:
  - entity_id: sensor.bwt_perla_regenerativ_level
    icon: phu:water-softener
  - entity_id: sensor.temperature
    icon: mdi:thermometer

State-based icons take priority over the configured icon, which serves as a fallback/default.

Object Format with State-Based Styling and Labels

You can configure sensors with state-based styling and custom labels, similar to entity configuration:

sensors:
  - entity_id: sensor.door_sensor
    label: 'Door' # Fallback label
    states:
      - state: 'on'
        icon_color: red
        icon: mdi:door-open
        label: 'Open' # Displayed instead of state value when state is "on"
        styles:
          background-color: rgba(255, 0, 0, 0.2)
          border: 1px solid red
      - state: 'off'
        icon_color: green
        icon: mdi:door-closed
        label: 'Closed' # Displayed instead of state value when state is "off"
        styles:
          background-color: rgba(0, 255, 0, 0.2)
  - entity_id: sensor.temperature
    label: 'Temperature' # Fallback label
    states:
      - state: '75'
        icon_color: orange
        icon: mdi:thermometer-alert
        label: 'Hot' # Displayed instead of state value when state is "75"
        styles:
          padding: 4px
          border-radius: 4px

Threshold-Based Styling

Configure dynamic colors, icons, and labels based on numeric sensor values using thresholds:

sensors:
  - entity_id: sensor.temperature
    label: 'Temperature' # Fallback label
    thresholds:
      - threshold: 25
        operator: gt
        icon_color: red
        icon: mdi:thermometer-alert
        label: 'Hot' # Custom label when temperature > 25°C
        styles:
          animation: pulse 2s ease-in-out infinite
      - threshold: 20
        operator: gte
        icon_color: green
        icon: mdi:thermometer
        label: 'Normal' # Custom label when temperature >= 20°C
      - threshold: 15
        operator: lt
        icon_color: blue
        icon: mdi:thermometer-low
        label: 'Cold' # Custom label when temperature < 15°C
  - entity_id: sensor.humidity
    thresholds:
      - threshold: 60
        operator: gt
        icon_color: red
        icon: mdi:water-alert
        styles:
          color: red # make the label red
      - threshold: 40
        operator: gte
        icon_color: green
        icon: mdi:water
      - threshold: 40
        operator: lt
        icon_color: blue
        icon: mdi:water-outline

Supported operators: gt (>), gte (>=), lt (<), lte (<=), eq (=). Default is gte.

Thresholds are evaluated in descending order (highest threshold first), and the first matching threshold is applied. This allows you to create ranges like "green between 40-60%" by configuring thresholds appropriately.

Attribute-based thresholds:

You can also compare against entity attributes instead of the state value:

sensors:
  - entity_id: sensor.weather_station
    thresholds:
      - threshold: 30
        operator: gt
        icon_color: red
        attribute: temperature # Compare against temperature attribute instead of state

When a threshold matches, the card will:

  • Display the custom icon (if configured)
  • Apply the custom icon color
  • Display the custom label (if configured) instead of the sensor's state value
  • Apply any CSS styles defined in the styles property

Priority order:

  1. State-based colors/icons (exact state matches) - highest priority
  2. Threshold colors/icons (based on numeric values)
  3. Configured icon (from icon property)
  4. Default entity icon (from Home Assistant)

Displaying Entity Attributes Instead of State

You can configure sensors to display a specific attribute value instead of the entity state:

sensors:
  # Display the 'temperature' attribute instead of the state value
  - entity_id: sensor.weather_station
    attribute: temperature

  # Display a formatted attribute value
  - entity_id: sensor.air_quality
    attribute: aqi # Shows the AQI value instead of the state

  # Attribute with label fallback
  - entity_id: sensor.weather
    label: 'Weather'
    attribute: condition # Shows weather condition attribute instead of state

When an attribute is specified, the sensor will display the formatted attribute value using Home Assistant's attribute display formatting. This is useful when you want to show a specific attribute (like temperature, humidity, battery_level, etc.) instead of the entity's primary state value.

When the sensor state matches a configured state, the card will:

  • Display the custom icon (e.g., mdi:door-open when state is "on")
  • Apply the custom icon color
  • Display the custom label (if configured) instead of the sensor's state value
  • Apply any CSS styles defined in the styles property

Labels for Sensors

Sensors can have custom labels configured at multiple levels:

  1. State label (highest priority) - Displayed when a matching state configuration has a label property
  2. Entity-level label - Displayed when the sensor has a label property configured
  3. Attribute value - Displayed when an attribute property is configured (replaces state display)
  4. Sensor state value (fallback) - Displayed when no label or attribute is configured (e.g., "75°F", "50%", "450 ppm")
sensors:
  # Sensor with state-based labels
  - entity_id: sensor.door_sensor
    label: 'Door Sensor' # Fallback label
    states:
      - state: 'on'
        icon_color: red
        icon: mdi:door-open
        label: 'Open' # Displayed instead of "on" when state matches
      - state: 'off'
        icon_color: green
        icon: mdi:door-closed
        label: 'Closed' # Displayed instead of "off" when state matches

  # Sensor with only entity-level label
  - entity_id: sensor.humidity
    label: 'Humidity' # Always displayed instead of state value

  # Sensor with no label (displays state value normally)
  - entity_id: sensor.co2
    # No label configured - will display sensor state value (e.g., "450 ppm")

  # Sensor displaying an attribute instead of state
  - entity_id: sensor.weather_station
    attribute: temperature # Displays temperature attribute instead of state value

  # Sensor with attribute and label fallback
  - entity_id: sensor.battery_monitor
    label: 'Battery'
    attribute: battery_level # Shows battery level attribute, falls back to label if attribute missing

  # Sensor with custom icon
  - entity_id: sensor.bwt_perla_regenerativ_level
    icon: phu:water-softener

Note: When labels are configured for sensors, they replace the sensor's state display. When an attribute is specified, it displays the formatted attribute value instead of the state. When labels are not configured, sensors display their normal state values.

Icon Priority

Icons are determined in the following priority order:

  1. State-based icon (from states configuration when state matches) - highest priority
  2. Configured icon (icon property) - fallback/default
  3. Default entity icon (from Home Assistant)

This allows you to set a default icon for a sensor while state-based icons will override it when specific conditions are met.

Mixed Format

You can mix both formats in the same configuration:

sensors:
  - sensor.living_room_temperature_main # String format
  - entity_id: sensor.living_room_humidity_main # Object format
  - sensor.living_room_co2 # String format

Averaged Sensors (sensor_classes)

Display averaged readings for device classes across the area:

sensor_classes:
  - temperature # Average of all temperature sensors
  - humidity # Average of all humidity sensors
  - pressure # Average of all pressure sensors

Combined Configuration

You can use both together - individual sensors display first, then averages:

sensors:
  - sensor.living_room_co2 # Shown first
  - entity_id: sensor.living_room_pressure # Object format also supported
sensor_classes:
  - temperature # Averaged, shown after individual
  - humidity # Averaged, shown after individual

How It Works

The card automatically:

  1. Finds all sensors in the area with the specified device classes
  2. Groups them by unit of measurement (°F, °C, %, etc.)
  3. Calculates averages for each group
  4. Displays the averaged values

Note: If an area has default temperature or humidity sensors configured in Home Assistant's area settings, the card will use those specific sensors instead of collecting all sensors of that device class. This prevents duplicate sensors and ensures consistency with Home Assistant's area configuration.

Default Behavior

# Default configuration (automatic)
sensor_classes:
  - temperature
  - humidity
  - illuminance

Custom Device Classes

# Custom sensor classes
sensor_classes:
  - temperature
  - humidity
  - pressure
  - illuminance
  - co2

Reference: This uses similar logic as Home Assistant's area card.

Display Priority

Sensors are displayed in this order:

  1. Individual sensors (from sensors config) - in specified order
  2. Averaged sensors (from sensor_classes) - grouped by device class

Relationship with Individual Sensors

  • If using sensor_classes, you don't need to manually include those entities in sensors
  • Individual sensors in sensors will always display first
  • Averaged sensors appear after individual sensors

Sensor Layout Options

  • default: Displays sensors in the label area alongside room statistics
  • stacked: Displays sensors vertically stacked in the label area
  • bottom: Displays sensors at the bottom of the card for maximum visibility

Sensor Layouts

Interactive Sensors

Sensors in the info section now support interactive behavior:

Clickable Individual Sensors

Individual sensors (configured via sensors) are clickable and will open the Home Assistant "more info" dialog when tapped:

sensors:
  - sensor.living_room_temperature # Clickable - opens more info dialog
  - sensor.living_room_humidity # Clickable - opens more info dialog

This allows you to quickly access detailed sensor information, history, and controls directly from the card.

Non-Interactive Averaged Sensors

Averaged sensors (from sensor_classes) are not clickable as they represent calculated values from multiple sensors:

sensor_classes:
  - temperature # Not clickable - calculated average
  - humidity # Not clickable - calculated average

This design choice prevents confusion since averaged sensors don't represent a single entity that can be interacted with.

Sensor Display Options

You can customize how sensor information is displayed using feature flags:

Hide Sensor Icons

Hide the icons next to sensor values while keeping the text labels:

features:
  - hide_sensor_icons
sensors:
  - sensor.living_room_temperature # Shows: "72°F" (no icon)

Hide Sensor Labels

Hide the text labels next to sensor icons (opposite of hide_sensor_icons):

features:
  - hide_sensor_labels
sensors:
  - sensor.living_room_temperature # Shows: 🌡️ (icon only, no text)

Icons Only Display

For a minimal icon-only display:

features:
  - hide_sensor_labels
sensor_layout: bottom
sensors:
  - sensor.living_room_temperature
  - sensor.living_room_humidity

This is useful for compact layouts where you want visual indicators without text.

Sensor Icons

Legacy Sensor Configuration (Deprecated)

For backward compatibility, you can still use:

temperature_sensor: sensor.living_room_temperature
humidity_sensor: sensor.living_room_humidity

Note: Please migrate to the sensors array as these legacy properties will be removed in a future version.