5be3f78fe60faff265ebde924a68f27dd87d80e4
- Replace send_message_tool import with hermes send CLI subprocess - Remove broken _ensure_gw_config() that clobbered env vars - Remove unused CircuitBreaker class and tenacity import - Clean up docstring and unused imports - Token fix: requires real TELEGRAM_BOT_TOKEN in ~/.hermes/.env - Systemd drop-in: /etc/systemd/system/hermes-relay.service.d/telegram.conf
Hermes Relay
Flask bridge tussen Node-RED en Hermes Agent.
Architectuur
Node-RED (192.168.1.125) ──POST /ask──▶ Hermes Relay (192.168.1.74:8650)
│
├──▶ hermes chat -q (subprocess)
│ │
│ ▼
│ JSON response ──▶ Node-RED
│
└──▶ hermes send --to telegram
│
▼
Telegram chat
Endpoints
POST /ask
Verwacht JSON body:
{ "payload": "Wat is het weer in Best?" }
Response:
{
"status": "ok",
"answer": "Het is 22°C en zonnig in Best...",
"elapsed_seconds": 8.3,
"telegram_sent": true
}
GET /health
Health check voor monitoring.
Setup
cd /root/hermes-relay
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
# Test
python app.py
# Of als service
sudo systemctl enable hermes-relay
sudo systemctl start hermes-relay
Node-RED Nodes
Versturen (HTTP Request node)
- Method: POST
- URL:
http://192.168.1.74:8650/ask - Return: a parsed JSON object
- Timeout: 120000 (ms) — Hermes kan even duren
Ontvangen
Het antwoord komt terug als msg.payload:
msg.payload.answer— het Hermes antwoordmsg.payload.elapsed_seconds— hoe lang het duurdemsg.payload.telegram_sent— of het ook naar Telegram is gestuurdmsg.payload.status— "ok" of "error"
Health check (optioneel)
- Method: GET
- URL:
http://192.168.1.74:8650/health
Description
Releases
2
Languages
Python
100%