tessl install tessl/pypi-homeassistant@2025.9.0Open-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%
Build a smart home scene controller that manages different room ambiance settings by creating and applying scenes for various activities.
Create scenes that capture the state of multiple entities (lights, switches, media players) for different activities.
Apply scenes to restore the specified states of all entities in the scene.
Remove dynamically created scenes when they are no longer needed.
Handle scenes that control multiple different types of entities with various attributes.
@generates
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
"""
passProvides home automation core functionality including scene management services.
@satisfied-by