目录

Vela HomePilot

HomePilot adds a small smart-home tool set to the openvela packages_ai_agent runtime. It provides room/device discovery, light/HVAC/curtain controls, sensor reads, energy estimates, scene planning, and whole-home state queries.

The overlay is C99 and is structured for upstream review:

  • agent_overlay/tools: JSON callback adapters for the eight registered tools.
  • agent_overlay/domain: policy clamps, scoring, and scene planning.
  • agent_overlay/model: deterministic home model, state-machine setters, and host-visible state snapshots.
  • tests/host: host C tests built with -Wall -Wextra -Werror.
  • scripts: overlay staging, host checks, deterministic routing evaluation, live backend evaluation, and environment-gated QEMU helpers.

Host Verification

chmod +x scripts/*.sh
./scripts/run_host_tests.sh
./scripts/integration_check.sh
python3 scripts/compare_naive.py
./scripts/llm_eval.sh

run_host_tests.sh builds and runs the C tests, then scores deterministic tool routing over tests/prompts.jsonl. integration_check.sh stages the overlay into a cached packages_ai_agent checkout, verifies that patches/ai_agent_register.patch applies, checks the tool count against MAX_TOOLS, and compiles overlay sources against the real framework headers and cJSON.

llm_eval.sh runs configured live backends when keys are present in .env. Without keys it still runs the deterministic simulator gate. Captured traces are runtime artifacts under logs/ and are intentionally ignored.

openvela Integration

export OPENVELA_ROOT=<openvela-root>
export AI_AGENT_DIR=<packages-ai-agent-root>
./scripts/apply_overlay.sh
./scripts/build_qemu.sh
./scripts/run_qemu.sh

After booting and starting ai_agent, configure a backend key and ask for device control or scene goals:

set_llm deepseek <key>
ask 打开客厅灯,亮度60%
ask 现在室温多少?
ask 我要睡觉了,帮我调整全屋

The QEMU scripts require a full openvela source tree, the target board configuration, an emulator path, and backend credentials. Host tests do not replace that firmware run.

Tool List

Tool Purpose
home_device_list List rooms, devices, and capabilities.
light_set_state Set light power, brightness, and color temperature.
env_sensor_read Read temperature, humidity, CO2, and lux.
hvac_set_mode Set HVAC mode under 18-28C constraints.
curtain_set_position Set curtain position under 0-100 constraints.
energy_estimate Return simulated whole-home power and scores.
scene_apply Apply home_arrival, sleep, away, or eco scenes.
home_state_query Query current whole-home state, optionally by room.

All energy and comfort values are simulation estimates, not metered hardware values.

Documentation

关于
3.1 MB
邀请码
    Gitlink(确实开源)
  • 加入我们
  • 官网邮箱:gitlink@ccf.org.cn
  • QQ群
  • QQ群
  • 公众号
  • 公众号

版权所有:中国计算机学会技术支持:开源发展技术委员会
京ICP备13000930号-9 京公网安备 11010802047560号