home-assistant

Control Home Assistant devices via REST API with curl requests.

10|Updated Nov 29, 2025
One-click install
npx skills add https://github.com/benjaminshafii/digital-empire --skill home-assistant-benjaminshafii
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: home-assistant
Source: https://github.com/benjaminshafii/digital-empire/tree/main/.opencode/skill/home-assistant
Command: npx skills add https://github.com/benjaminshafii/digital-empire --skill home-assistant-benjaminshafii

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill enables programmatic control of Home Assistant devices via REST API, simplifying automation and remote management.

Core Features & Use Cases

  • Query entity states: Retrieve current status of any entity from the Home Assistant instance.
  • Control devices: Turn on/off lights, switches, or adjust climate settings via REST endpoints.
  • Use Case: Automate daily routines such as turning off lights at sunset or dimming lights when watching a movie.

Quick Start

Check API status and retrieve states: source .env && curl -s -H "Authorization: Bearer $HA_TOKEN" "$HA_URL/api/" Get a specific entity: source .env && curl -s -H "Authorization: Bearer $HA_TOKEN" "$HA_URL/api/states/light.living_room" Turn on a light: source .env && curl -s -X POST -H "Authorization: Bearer $HA_TOKEN"
-H "Content-Type: application/json"
-d '{"entity_id": "light.living_room"}'
"$HA_URL/api/services/light/turn_on"

Frequently Asked Questions about home-assistant

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I control Home Assistant devices via REST API?

Control Home Assistant devices via REST API by sending standard HTTP curl requests to your localized instance. You can trigger services to turn lights on or off and adjust climate settings without manual UI interaction.

What do I need to query entity states from Home Assistant?

To query entity states from Home Assistant, you need a configured HA_URL and HA_TOKEN stored in environment variables or a .env file. You then pass the HA_TOKEN as a Bearer authorization header in your HTTP request.

Can I use curl to automate Home Assistant routines without the UI?

You can use curl to automate Home Assistant routines without the UI by sending HTTP POST requests to specific REST endpoints. This allows you to programmatically trigger services across multiple entities to manage daily routines like dimming lights.

Does Home Assistant REST API require token authentication?

Home Assistant REST API requires token authentication using a Bearer token. You must include the Authorization header with your HA_TOKEN in every curl request to successfully query states or trigger services on your instance.

How do I turn on a light using the Home Assistant REST API?

Turn on a light using the Home Assistant REST API by sending an HTTP POST request with curl to the /api/services/light/turn_on endpoint. Include your Bearer HA_TOKEN and a JSON payload containing the target entity_id.