CtrlK
CommunityDocumentationLog inGet started
Tessl Logo

tessl/pypi-homeassistant

tessl install tessl/pypi-homeassistant@2025.9.0

Open-source home automation platform running on Python 3.

Agent Success

Agent success rate when using this tile

69%

Improvement

Agent success rate improvement when using this tile compared to baseline

1.19x

Baseline

Agent success rate without this tile

58%

task.mdevals/scenario-3/

Smart Room Automation System

Create a home automation system that manages a smart room's lighting and climate using multiple triggers and conditions.

Requirements

Your system should implement an automation that:

  1. Controls evening lighting when:

    • Motion is detected in the room, AND
    • It's between 6 PM and 11 PM, AND
    • The light level is below a configured threshold
  2. Manages climate when:

    • The room temperature exceeds a comfort threshold
  3. Responds to manual override events by:

    • Temporarily disabling the automation when a custom event is fired
    • Re-enabling after a configured delay period

The automation must use multiple trigger types (state change, time, event), apply conditions before executing actions, and handle concurrent triggers appropriately.

Implementation

@generates

API

def setup_smart_room_automation(
    hass,
    room_motion_sensor: str,
    room_light_sensor: str,
    room_temp_sensor: str,
    lights_entity: str,
    climate_entity: str,
    config: dict
) -> dict:
    """
    Set up a smart room automation with multi-trigger support.

    Args:
        hass: Home Assistant instance
        room_motion_sensor: Entity ID of the motion sensor (e.g., 'binary_sensor.room_motion')
        room_light_sensor: Entity ID of the light sensor (e.g., 'sensor.room_light_level')
        room_temp_sensor: Entity ID of the temperature sensor (e.g., 'sensor.room_temperature')
        lights_entity: Entity ID of the lights (e.g., 'light.room_lights')
        climate_entity: Entity ID of the climate control (e.g., 'climate.room_hvac')
        config: Configuration dictionary containing thresholds and settings
            - light_threshold: Numeric light level threshold (lux)
            - temp_threshold: Temperature threshold (°C)
            - override_delay: Delay in seconds before re-enabling automation
            - automation_mode: Mode for handling concurrent triggers

    Returns:
        Dictionary containing the automation configuration
    """
    pass

Test Cases

Evening Light Activation

  • When motion is detected after 6 PM with low light levels, the lights should turn on @test
  • When motion is detected after 6 PM but light levels are sufficient, the lights should not turn on @test
  • When motion is detected before 6 PM or after 11 PM, the lights should not turn on @test

Temperature-Based Climate Control

  • When room temperature exceeds the configured threshold, the climate control should activate @test

Manual Override

  • When an override event is fired, the automation should be disabled @test
  • After the configured delay, the automation should automatically re-enable @test

Dependencies { .dependencies }

homeassistant { .dependency }

Provides home automation framework with automation engine, multi-trigger support, and state management.

Version

Workspace
tessl
Visibility
Public
Created
Last updated
Describes
pypipkg:pypi/homeassistant@2025.9.x
tile.json