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-9/

Smart Home Scene Controller

Build a smart home scene controller that manages different room ambiance settings by creating and applying scenes for various activities.

Capabilities

Scene Creation

Create scenes that capture the state of multiple entities (lights, switches, media players) for different activities.

  • Creating a "Movie Night" scene with living room lights at 10% brightness, TV on, and blinds closed should succeed @test
  • Creating a "Morning Routine" scene with bedroom lights at 80% brightness, thermostat at 72°F, and coffee maker on should succeed @test
  • Creating an empty scene with no entities should still create a valid scene @test

Scene Activation

Apply scenes to restore the specified states of all entities in the scene.

  • Activating the "Movie Night" scene should set all entities to their defined states @test
  • Activating a scene with a 2-second transition should apply states gradually over 2 seconds @test

Scene Deletion

Remove dynamically created scenes when they are no longer needed.

  • Deleting an existing scene should remove it from the system @test
  • Attempting to delete a non-existent scene should handle the error gracefully @test

Multi-Entity State Management

Handle scenes that control multiple different types of entities with various attributes.

  • A scene with 5 different lights (varying brightness and colors) should apply all states correctly @test
  • A scene with mixed entity types (lights, switches, climate) should apply all states correctly @test

Implementation

@generates

API

from homeassistant.core import HomeAssistant
from typing import Dict, Any, Optional

class SceneController:
    """Controller for managing smart home scenes."""

    def __init__(self, hass: HomeAssistant):
        """Initialize the scene controller.

        Args:
            hass: Home Assistant instance
        """
        pass

    async def create_scene(
        self,
        scene_id: str,
        entity_states: Dict[str, Dict[str, Any]]
    ) -> None:
        """Create a new scene with specified entity states.

        Args:
            scene_id: Unique identifier for the scene
            entity_states: Dictionary mapping entity IDs to their state dicts
                          Example: {"light.living_room": {"state": "on", "brightness": 10}}
        """
        pass

    async def activate_scene(
        self,
        scene_id: str,
        transition: Optional[int] = None
    ) -> None:
        """Activate a scene to apply its entity states.

        Args:
            scene_id: Identifier of the scene to activate
            transition: Optional transition time in seconds
        """
        pass

    async def delete_scene(self, scene_id: str) -> None:
        """Delete a dynamically created scene.

        Args:
            scene_id: Identifier of the scene to delete
        """
        pass

    async def get_scene_entities(self, scene_id: str) -> Dict[str, Dict[str, Any]]:
        """Retrieve the entity states defined in a scene.

        Args:
            scene_id: Identifier of the scene

        Returns:
            Dictionary mapping entity IDs to their state configurations
        """
        pass

Dependencies { .dependencies }

homeassistant { .dependency }

Provides home automation core functionality including scene management services.

@satisfied-by

Version

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