executing-plans
executing-plans
Use when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available
api-and-automationUse Mycodo REST API authentication, versioned endpoints, Pyro DaemonControl, mycodo-client, and multi-channel automation safely.
Independent GitHub snapshot · Automated classification · Original documentation governs
Use this sub-skill when the task involves Mycodo automation through HTTPS REST
endpoints, local Pyro daemon calls, the mycodo-client command line, or
multi-channel measurement queries. This skill is self-contained; do not reopen
repository docs, examples, or tests to use it at runtime.
DaemonControl, and local
mycodo-client automation.curl, Python requests, and reusable scripts.460 operation failures,
TLS errors, Pyro timeouts, credential problems, and unsafe system mutations.DaemonControl / Pyro when code runs on the Mycodo host and needs
daemon operations with Python return values, especially Output, Input, PID,
Function Action, Widget, and daemon control calls.mycodo-client when operating locally from shell scripts, service
hooks, or manual maintenance and the installed command is available.Read or run these files instead of looking up upstream material:
Accept/auth headers, or
interpreting status codes.DaemonControl, Pyro URI/timeout options, or mycodo-client
command-line flags.--host, --endpoint,
--method, and an API key from --api-key or MYCODO_API_KEY. It defaults
to Accept: application/vnd.mycodo.v1+json, prints status plus a small header
subset, and pretty-prints JSON or text bodies.https://<mycodo-host>/api/....https://<mycodo-host>/api.curl -k, requests verify=False,
or the bundled helper's --insecure only for hosts the user trusts.Accept: application/vnd.mycodo.v1+json for API v1.X-API-KEY: <base64-api-key-shown-in-user-settings> for automation.
The request loader also accepts Authorization: Basic <same-base64-api-key>
and a query-string api_key=<same-base64-api-key>, but query strings are more
likely to leak through logs.Authorization: Bearer <key> as deployment-specific
unless the live instance proves Bearer support; the inspected request loader
authenticates API-key query, Basic, and X-API-KEY forms./api on the target host and record the
method, path, required permission, request body, and response shape.GET endpoints first: /api/daemon/, /api/settings/...,
/api/inputs/, /api/outputs/, /api/measurements/..., and /api/choices/....POST endpoints, require explicit user confirmation of target
IDs and physical effect: Output state/duty/volume, Input force measurement,
controller activation, measurement creation, note creation, or daemon
termination.2xx means success; 4xx means
request/auth/permission/payload problems; 5xx means server-side failure.
Mycodo can return 460 when a daemon operation reports failure.Use local daemon access only on a trusted Mycodo host where the Mycodo package,
configuration, database, and Pyro daemon are available. The default Pyro URI is
PYRO:mycodo.pyro_server@127.0.0.1:9080; it is not an HTTPS remote API. The
public installed layout commonly uses /opt/Mycodo and an environment under
/opt/Mycodo/env, but always follow the user's installed layout.
Typical decision points:
/api/daemon/,
DaemonControl().check_daemon(), or mycodo-client --checkdaemon.DaemonControl or
REST /api/outputs/<output_id>; include output_channel/channel.mycodo-client, but avoid irreversible
flags such as daemon termination unless explicitly approved.Before sending any request or local daemon command that can mutate state:
--insecure/-k only for trusted local/self-signed hosts.This skill was produced from CPU/source inspection of the repository and bundled runtime evidence. Raspberry Pi GPIO/I2C/UART/1-Wire/Bluetooth/camera behavior, systemd/nginx/InfluxDB services, Docker deployment, backup/restore operations, and full installer execution were not exercised. Treat those as operational surfaces that require live-system confirmation before mutation.
Read-only request with the bundled helper:
MYCODO_API_KEY="<base64-key-from-user-settings>" \
python scripts/mycodo_api_request.py \
--host https://mycodo.local \
--endpoint /api/daemon/ \
--method GET \
--insecure
Read-only curl pattern:
curl -k -sS "https://mycodo.local/api/settings/inputs" \
-H "Accept: application/vnd.mycodo.v1+json" \
-H "X-API-KEY: <base64-key-from-user-settings>"
Local Python daemon probe:
from mycodo.mycodo_client import DaemonControl
control = DaemonControl(pyro_timeout=10)
print(control.check_daemon())
If any example fails, use references/troubleshooting.md before retrying with broader permissions or mutating commands.