Newer
Older
gnexus-book / 90-maintenance / pending-changes / 20260514210203-5b95e09f.json
{
  "id": "20260514210203-5b95e09f",
  "kind": "doc",
  "target": "10-systems/servers/smart-home-server.md",
  "summary": "Add API usage instructions for triggering ControlScripts actions to smart-to-home-server.md with frontmatter.",
  "reason": "Adding API usage instructions for triggering actions, as discovered during troubleshooting. I included the frontmatter to avoid validation errors.",
  "payload": {
    "content": "---\nowner: gmikcon\nstatus: active\nlast_reviewed: 2026-05-10\nreview_interval: 90d\nconfidence: medium\nsource_of_truth: owner-confirmed-and-ssh-host\n---\n\n# Smart Home Server\n\n... (existing content) ...\n\n## API Usage: Triggering Actions\n\nThe smart-home platform allows triggering `ControlScripts` actions via HTTP POST. This is the preferred way for external automation or manual control without the web client.\n\n### Endpoint: `POST /api/v1/scripts/actions/run`\n\n**Request Body (JSON):**\n```json\n{\n  \"alias\": \"action_alias_here\",\n  \"params\": {}\n}\n```\n\n**Example: Toggle Bedroom Light**\n```bash\ncurl -X POST http://192.168.1.101/api/v1/scripts/actions/run \\\n     -H \"Content-Type: application/json\" \\\n     -d '{\"alias\": \"master_room_lamp_switcher\", \"params\": {}}'\n```\n\n**Example: Toggle Hallway Light (2nd Floor)**\n```bash\ncurl -X POST http://192.168.1.101/api/v1/scripts/actions/run \\\n     -H \"Content-Type: application/json\" \\\n     -d '{\"alias\": \"hallway2_lamp_switcher\", \"params\": {}}'\n```\n\n**Response Format:**\nReturns a JSON object with `status: true` and the `return` value from the PHP script.\n"
  },
  "status": "applied",
  "created_at": "2026-05-14T21:02:03Z",
  "updated_at": "2026-05-14T21:02:03Z",
  "applied_at": "2026-05-14T21:02:03Z",
  "validation": {
    "status": "ok",
    "issue_count": 0,
    "issues": []
  }
}