HA add-on: add configurable primary model (model_primary option)

This commit is contained in:
TheLast
2026-01-27 22:46:32 +02:00
parent a5b06a9fcb
commit f84f6f8b18
2 changed files with 14 additions and 1 deletions
+6
View File
@@ -19,14 +19,20 @@ options:
# Optional: lock DMs to specific Telegram user ids (comma-separated).
# If set, add-on will use dmPolicy=allowlist and allowFrom=<ids>.
telegram_allow_from: ""
# Model selection (string like "openai-codex/gpt-5.2" or "ollama/gpt-oss:20b")
model_primary: "openai-codex/gpt-5.2"
homeassistant_token: ""
mikrotik_host: "192.168.88.1"
mikrotik_ssh_user: "papur"
mikrotik_ssh_key_path: "/data/keys/mikrotik_papur_nopw"
schema:
telegram_bot_token: str
timezone: str
telegram_allow_from: str?
model_primary: str
homeassistant_token: str?
mikrotik_host: str
mikrotik_ssh_user: str
+8 -1
View File
@@ -12,6 +12,7 @@ fi
BOT_TOKEN=$(jq -r '.telegram_bot_token // empty' "$OPTIONS_FILE")
TZNAME=$(jq -r '.timezone // "Europe/Sofia"' "$OPTIONS_FILE")
ALLOW_FROM_RAW=$(jq -r '.telegram_allow_from // empty' "$OPTIONS_FILE")
MODEL_PRIMARY=$(jq -r '.model_primary // "openai-codex/gpt-5.2"' "$OPTIONS_FILE")
HA_TOKEN=$(jq -r '.homeassistant_token // empty' "$OPTIONS_FILE")
MT_HOST=$(jq -r '.mikrotik_host // "192.168.88.1"' "$OPTIONS_FILE")
MT_USER=$(jq -r '.mikrotik_ssh_user // "papur"' "$OPTIONS_FILE")
@@ -52,7 +53,11 @@ cat > /data/.clawdbot/clawdbot.json <<EOF
gateway: { mode: "local" },
agents: {
defaults: {
workspace: "/data/clawd"
workspace: "/data/clawd",
model: { primary: "${MODEL_PRIMARY}" },
models: {
"${MODEL_PRIMARY}": {}
}
},
list: [
{ id: "main" }
@@ -69,6 +74,8 @@ cat > /data/.clawdbot/clawdbot.json <<EOF
}
EOF
echo "Model primary=${MODEL_PRIMARY}"
echo "Telegram dmPolicy=${DM_POLICY}${ALLOW_FROM_RAW:+ (allowFrom=${ALLOW_FROM_RAW})}"
echo "Telegram allowFrom JSON: ${ALLOW_FROM_JSON:-<none>}"