← 返回 Skills 市场
m0nkmaster

Hive Home

作者 Rob MacDonald · GitHub ↗ · v1.0.1 · MIT-0
cross-platform ✓ 安全检测通过
267
总下载
0
收藏
0
当前安装
2
版本数
在 OpenClaw 中安装
/install hivehome
功能描述
Control and query Hive Home (UK) smart heating, hot water, lights and devices via the unofficial API. Use when the user mentions Hive, Hive Home, Hive thermo...
使用说明 (SKILL.md)

Hive Home (UK)

Control Hive thermostats, hot water, lights and other devices programmatically. Hive does not provide a public API; this skill uses the community Pyhiveapi library, which talks to the same backend as the Hive app.

Prefer the bundled scripts for common actions. Run scripts/hive_control.py from the skill directory (or {baseDir}/scripts/hive_control.py when the agent has the skill path). Only generate custom Pyhiveapi code when the user needs something the scripts do not support (e.g. lights, multi-zone by name, or custom logic).

Important: The API is unofficial. Never hardcode credentials or 2FA codes in prompts, logs or code. Use environment variables or a secure secret store.

Bundled scripts

From the skill root (e.g. hivehome/ or the skill directory loaded by your agent):

# Status (heating + hot water)
python scripts/hive_control.py status

# Heating
python scripts/hive_control.py set-temp 21
python scripts/hive_control.py mode heat
python scripts/hive_control.py mode schedule
python scripts/hive_control.py boost 30 21    # 30 min at 21°C
python scripts/hive_control.py boost-off

# Hot water
python scripts/hive_control.py hotwater-boost 30
python scripts/hive_control.py hotwater-boost-off
python scripts/hive_control.py hotwater-mode schedule
python scripts/hive_control.py hotwater-mode off

# Multiple zones (default zone 0)
python scripts/hive_control.py --zone 1 set-temp 20

Requires HIVE_USERNAME, HIVE_PASSWORD; for non-interactive use (e.g. agent runs) set HIVE_DEVICE_GROUP_KEY, HIVE_DEVICE_KEY, HIVE_DEVICE_PASSWORD after one interactive first-time login.

Credentials

Required env vars: HIVE_USERNAME, HIVE_PASSWORD. For automation (no 2FA each run): HIVE_DEVICE_GROUP_KEY, HIVE_DEVICE_KEY, HIVE_DEVICE_PASSWORD.

Where to set them:

  • Generic / Cursor / CLI: Set in your shell (export HIVE_USERNAME=...) or in a local .env file that is not committed. Run the script in an environment where these are set.
  • OpenClaw: Set in ~/.openclaw/openclaw.json under skills.entries.hivehome.env. OpenClaw injects these into the process for the agent run; they are not put in prompts or logs.
  • Other agents: Use that agent’s recommended way to inject env vars or secrets so the skill’s scripts see them at runtime.

Agent instruction: If credentials are missing, do not ask the user to paste passwords or keys in chat. Tell them to set the required environment variables (or configure the skill in their agent’s config) and run the script again. See references/CREDENTIALS.md for platform-specific notes.

When to use this skill

  • User asks to control Hive heating, thermostat, or hot water.
  • User wants to script or automate Hive devices (heating, lights, plugs).
  • User mentions Hive, British Gas Hive, or the Hive app in the context of automation or code.

Prerequisites

  • Python 3 with pyhiveapi>=1.0.0 (session API): pip install "pyhiveapi>=1.0.0". If you see attribute or method errors, run pip install -U pyhiveapi and try again.
  • Hive account (UK; my.hivehome.com). First-time login requires SMS 2FA; subsequent logins can use device credentials to avoid 2FA.

Authentication

First-time login (username + password + 2FA)

Hive enforces two-factor authentication. After initial login, capture device credentials for future runs so the user does not need to enter a 2FA code every time.

import os
from pyhiveapi import Hive, SMS_REQUIRED

username = os.environ.get("HIVE_USERNAME")
password = os.environ.get("HIVE_PASSWORD")
if not username or not password:
    raise SystemExit("Set HIVE_USERNAME and HIVE_PASSWORD")

session = Hive(username=username, password=password)
login = session.login()

if login.get("ChallengeName") == SMS_REQUIRED:
    code = input("Enter 2FA code from SMS: ")
    session.sms2fa(code, login)

# Save these for next time (e.g. to env or a secure store)
device_data = session.auth.getDeviceData()
print("Store for device login:", device_data)

session.startSession()
# Now use session.heating, session.hotwater, session.light, etc.

Device login (no 2FA after first time)

Use after the user has run first-time login and stored device credentials. Set HIVE_DEVICE_GROUP_KEY, HIVE_DEVICE_KEY, HIVE_DEVICE_PASSWORD (or pass them another secure way).

import os
from pyhiveapi import Hive

session = Hive(
    username=os.environ["HIVE_USERNAME"],
    password=os.environ["HIVE_PASSWORD"],
    deviceGroupKey=os.environ["HIVE_DEVICE_GROUP_KEY"],
    deviceKey=os.environ["HIVE_DEVICE_KEY"],
    devicePassword=os.environ["HIVE_DEVICE_PASSWORD"],
)
session.deviceLogin()
session.startSession()

Device lists

After session.startSession(), devices are in session.deviceList by type:

heating = session.deviceList["climate"]
water_heaters = session.deviceList["water_heater"]
lights = session.deviceList["light"]
switches = session.deviceList["switch"]
sensors = session.deviceList["sensor"]
binary_sensors = session.deviceList["binary_sensor"]

Use the first (or chosen) device when calling the methods below.

Heating (thermostat)

if heating:
    zone = heating[0]
    # Read
    session.heating.getMode(zone)
    session.heating.getState(zone)
    session.heating.getCurrentTemperature(zone)
    session.heating.getTargetTemperature(zone)
    session.heating.getBoostStatus(zone)
    session.heating.getBoostTime(zone)
    session.heating.getOperationModes()  # e.g. SCHEDULE, HEAT, OFF

    # Write
    session.heating.setMode(zone, "SCHEDULE")
    session.heating.setMode(zone, "HEAT")
    session.heating.setTargetTemperature(zone, 21)
    session.heating.setBoostOn(zone, 30, 21)   # 30 min at 21°C
    session.heating.setBoostOff(zone)

Hot water

if water_heaters:
    hw = water_heaters[0]
    session.hotwater.getMode(hw)
    session.hotwater.getState(hw)
    session.hotwater.getBoost(hw)
    session.hotwater.setMode(hw, "OFF")
    session.hotwater.setMode(hw, "SCHEDULE")
    session.hotwater.setBoostOn(hw, 30)
    session.hotwater.setBoostOff(hw)

Lights

if lights:
    light = lights[0]
    session.light.getState(light)
    session.light.getBrightness(light)
    session.light.getColorTemp(light)
    session.light.getColor(light)
    # Set state (exact method names depend on pyhiveapi version; see reference)

Quick reference

  • Modes (heating): SCHEDULE, HEAT, OFF (and others per getOperationModes()).
  • Temperatures: Use integers (e.g. 21 for 21°C). Check session.heating.getMinTemperature(zone) / session.heating.getMaxTemperature(zone) for limits.
  • Boost: Heating boost takes (minutes, target_temp); hot water boost takes (minutes) only.

Additional resources

External endpoints

This skill ships scripts (scripts/hive_control.py) that call the Pyhiveapi Python library. The agent should run these scripts for common actions. When the user needs unsupported behaviour (e.g. lights), the agent may generate Pyhiveapi code. In all cases, only the following endpoints are used. No direct HTTP is made from the skill; Pyhiveapi encapsulates it.

Purpose Endpoint / host Data sent
Login (first time) beekeeper.hivehome.com / api.prod.bgchprod.info (via Pyhiveapi) Hive username, password; after 2FA, device registration
Device login Same Username, password, device group key, device key, device password
Device control (heating, hot water, lights, etc.) Same Session token; device IDs and command payloads (e.g. target temperature, mode)

Credentials and 2FA codes must be supplied via environment variables or user input; the skill never contains or logs them. The bundled script includes a SECURITY MANIFEST header (env vars and endpoints used).

Security and privacy

  • What leaves the machine: Hive account credentials (username, password, and optionally device keys) and API requests (device state, setpoints, mode changes) are sent to Hive’s backend (Centrica/British Gas). The skill does not send data elsewhere.
  • What stays local: Credentials should be stored only in the user’s environment or secret store; the skill instructs the agent never to hardcode or log them.
  • Autonomous invocation: When this skill is enabled, the agent may suggest or generate code that calls the Hive API when the user asks about heating, thermostats, or Hive. The user controls whether to run that code and what credentials to provide.

Trust statement

By using this skill, you send your Hive account credentials and device commands to Hive’s servers (beekeeper.hivehome.com / api.prod.bgchprod.info). Only install and use this skill if you trust that infrastructure and the Pyhiveapi library. This skill is not affiliated with Hive or British Gas.

安全使用建议
This skill appears to do what it says: run the bundled Python script which uses the community pyhiveapi library to talk to Hive’s backend. Before installing: (1) Only provide your Hive credentials via secure environment/secret injection (do not paste them in chat); (2) store device keys securely if you want to skip 2FA; (3) be aware the API is unofficial — the library talks to Hive endpoints and may break if Hive changes things; (4) avoid following the reference note about using mitmproxy unless you understand traffic interception and legal/privacy implications; and (5) if you require higher assurance, review the pyhiveapi package source and the included scripts to confirm there is no unexpected network or file access.
功能分析
Type: OpenClaw Skill Name: hivehome Version: 1.0.1 The hivehome skill provides a legitimate interface for controlling Hive Home smart devices using the community-standard pyhiveapi library. The bundled script (scripts/hive_control.py) and instructions (SKILL.md) follow security best practices by mandating the use of environment variables for credentials and explicitly instructing the agent not to request secrets in chat. All network communication is directed to official Hive API endpoints (beekeeper.hivehome.com), and no evidence of data exfiltration, obfuscation, or malicious execution was found.
能力评估
Purpose & Capability
Name/description (control Hive devices) match the requested environment variables (HIVE_USERNAME, HIVE_PASSWORD) and the included Python CLI. The primary credential is the Hive username which is appropriate for this integration.
Instruction Scope
SKILL.md and the CLI script limit actions to authenticating and calling Hive device APIs. The only noteworthy expansion is guidance in references/REFERENCE.md about using DevTools or mitmproxy to discover endpoints — that is beyond normal user needs and has privacy/operational implications if followed (it’s not required for typical use).
Install Mechanism
No install spec; this is instruction-only plus a bundled script. Dependency is pyhiveapi via pip which is reasonable and expected; nothing is downloaded from untrusted arbitrary URLs.
Credentials
Requested env vars are limited to Hive credentials and optional device keys for avoiding 2FA; this is proportionate to the stated functionality and matches the documentation. No unrelated secrets or system paths are requested.
Persistence & Privilege
Skill is not always-enabled, does not request elevated system presence, and does not modify other skills or global agent settings. The agent can invoke it autonomously (platform default) but that is not combined with other concerning privileges.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install hivehome
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /hivehome 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.1
Hivehome 1.0.1 - Updated code examples and quick reference for heating to use new pyhiveapi method names (e.g. getCurrentTemperature, getTargetTemperature, getBoostStatus, setBoostOn). - Updated temperature limit references to use getMinTemperature and getMaxTemperature methods. - No functional or code changes; documentation only.
v1.0.0
Initial release of Hive Home (UK) skill. - Control and query Hive heating, hot water, lights, and other smart devices via the unofficial API using Pyhiveapi. - Provides bundled Python scripts for common heating and hot water actions. - Requires Hive UK account credentials via environment variables; 2FA setup and device credentials supported. - Supports automation, scripting, and use in agent environments with env var injection. - Full usage instructions and references included in documentation.
元数据
Slug hivehome
版本 1.0.1
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 2
常见问题

Hive Home 是什么?

Control and query Hive Home (UK) smart heating, hot water, lights and devices via the unofficial API. Use when the user mentions Hive, Hive Home, Hive thermo... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 267 次。

如何安装 Hive Home?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install hivehome」即可一键安装,无需额外配置。

Hive Home 是免费的吗?

是的,Hive Home 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Hive Home 支持哪些平台?

Hive Home 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Hive Home?

由 Rob MacDonald(@m0nkmaster)开发并维护,当前版本 v1.0.1。

💬 留言讨论