home-assistant
Query a Home Assistant instance for presence, sensor data, calendar events, and cameras
от gptme★ 19 звёзд на GitHub
Установить home-assistant в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
Home Assistant Skill
Query a Home Assistant instance for presence, sensor data, calendar events, and cameras.
Setup
Set both credentials together in the process environment, a .env at your agent
workspace root, or ~/.config/secrets/ha.env (use mode 600 for credential files).
HA_SECRETS_DIR overrides the per-consumer directory.
HA_HOST=https://<your-ha-host>
HA_API_KEY=<long-lived-access-token>
Lookup order: process environment → first .env found walking from the current
directory to root → per-consumer ha.env. The first source declaring either HA
variable owns both. Partial or empty credentials fail closed; they are never
completed from another source, so a checkout cannot redirect a private token by
supplying only HA_HOST. Unrelated .env settings do not block the fallback.
Cloud connectivity: If your HA instance uses Nabu Casa, the host resolves publicly
(CNAME → *.ui.nabu.casa). No /etc/hosts entry or VPN needed.
Generate a long-lived token: HA UI → Profile → Long-Lived Access Tokens → Create.
Quick Commands
HA=gptme-contrib/skills/home-assistant/scripts/ha.py
# Test connectivity
uv run python3 $HA status
# Owner's current location / presence
uv run python3 $HA location
# Full real-world context (location, weather, next event, recent automations)
# — useful before voice calls, standups, or scheduling decisions
uv run python3 $HA context
uv run python3 $HA --json context
# All person/device tracker states
uv run python3 $HA persons
# Upcoming calendar events
uv run python3 $HA calendar
# List all cameras
uv run python3 $HA cameras
# Get any entity state
uv run python3 $HA state <entity_id>
# List all entities (optionally filtered by domain)
uv run python3 $HA states
uv run python3 $HA states --domain sensor
uv run python3 $HA states --domain device_tracker
# JSON output for scripting
uv run python3 $HA location --json
Common Entity ID Patterns
HA entity IDs follow predictable patterns — discover yours with ha.py states:
| Domain | Example | Notes |
|---|---|---|
person.<name> |
person.alice |
state: home/away/zone_name |
device_tracker.* |
device_tracker.alice_phone |
GPS source for person entity |
sensor.*_battery_level |
sensor.alice_phone_battery_level |
% |
calendar.main |
calendar.main |
Primary Google calendar |
weather.forecast_* |
weather.forecast_home |
Current weather |
camera.* |
camera.front_door |
Camera snapshot |
zone.home |
zone.home |
Home geofence |
Use ha.py states --domain sensor to browse what's available on your instance.
REST API Reference
Base URL: $HA_HOST/api/
Auth header: Authorization: Bearer $HA_API_KEY
Key endpoints:
GET /api/states— all entity statesGET /api/states/<entity_id>— single entityGET /api/config— HA config (location, timezone)GET /api/calendars/<entity_id>?start=<iso-utc>&end=<iso-utc>— calendar events (note:Zsuffix required for UTC, not+00:00)GET /api/camera_proxy/<entity_id>— camera snapshot (binary JPEG)
Google Calendar (Alternative)
If the agent's Google account is shared as a reader on the owner's main calendar,
use gog (gogcli) directly without HA:
# Upcoming events
gog calendar events "<owner-google-account>" --results-only -j
# Compact view
gog calendar events "<owner-google-account>" --results-only -j | python3 -c "
import json, sys
for e in json.load(sys.stdin):
start = e.get('start', {}).get('dateTime', e.get('start', {}).get('date', '?'))[:16]
print(f'{start} {e.get(\"summary\", \"(no title)\")}')
"
Giving Another Agent the Same Capability
- SSH to the other agent's VM
- Add
HA_HOSTandHA_API_KEYto their.env - Pull latest gptme-contrib — the script is at
gptme-contrib/skills/home-assistant/scripts/ha.py
For Google Calendar: share the owner's calendar with the agent's Google account (reader access).
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
- scripts/ha.py
FAQ
Что делает скилл home-assistant?
Query a Home Assistant instance for presence, sensor data, calendar events, and cameras
Как установить скилл home-assistant?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл home-assistant запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
skill-creator
AnthropicCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
discernment-nudge
AnthropicAfter you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
data-consolidate
AnthropicJoins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
inspection-to-capa
AnthropicRuns the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…