get_sun_times
Retrieve sunrise, sunset, and twilight times for your home location to automate lighting and schedules.
Instructions
Get sun times (sunrise, sunset, twilight) based on home coordinates.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- src/domoticz_mcp/server.py:941-946 (handler)Handler function for the get_sun_times tool. Calls the Domoticz API endpoint 'getsunrisenset' to retrieve sunrise, sunset, and twilight times based on home coordinates.
@mcp.tool() async def get_sun_times() -> str: """Get sun times (sunrise, sunset, twilight) based on home coordinates.""" async with create_client() as client: response = await _do_request(client, "GET", f"{DOMOTICZ_API_URL}?type=command¶m=getsunrisenset") return response.text - src/domoticz_mcp/server.py:941-942 (registration)The tool is registered via the @mcp.tool() decorator on the get_sun_times function. No separate registration file exists; the decorator on line 941 handles registration with the FastMCP instance.
@mcp.tool() async def get_sun_times() -> str: