Install
openclaw skills install @stshakh/narodmon-telegram-summaryUse when setting up daily sensor summary reports from narodmon.ru to Telegram. Covers REST API authentication, sensorsHistory/sensorsValues calls, matplotlib chart generation with min/max annotations, Telegram Bot API photo delivery, and Hermes cron job setup.
openclaw skills install @stshakh/narodmon-telegram-summarySends a daily chart of narodmon.ru sensor readings (last 24h) to a Telegram chat via Bot API. Runs as a Hermes no_agent cron job — pure Python script, no LLM tokens spent per run.
Configuration is stored in a JSON file (see templates/narodmon_config.json) — no credentials hardcoded in the script.
Don't use for: one-time sensor queries (just use curl), or non-narodmon IoT platforms.
POST http://api.narodmon.ru (JSON body, UTF-8)User-Agent: MyAppName # latin letters, mandatory
Narodmon-Api-Key: *** # from Профиль → Мои приложения
Content-Type: application/json # for POST
cmd — API method nameuuid — MD5 hash (lowercase), generated once, identifies the app installationlang — "ru", "en", or "uk"| Method | Purpose |
|---|---|
appInit | Init, sensor type reference, favorites. Requires version field. |
userLogon | Auth: hash = MD5(uuid + MD5(password)). Returns uid, tz, login, vip. Call once per 24h max. |
sensorsNearby | Find sensors by coordinates. my=1 for own sensors (requires auth). |
sensorsValues | Current readings by sensor ID array (≤30, limited by PubsLimit). |
sensorsHistory | History by period. Accepts id (single) or sensors (array). Periods: hour, day, week, month, year. offset shifts back. |
userLogon — max once per 24h.Option A — via API (automatic):
userLogon with login + hash to bind uuid to accountsensorsNearby with my=1 returns only your devices+sensorsOption B — manual:
narodmon.ru/SXXXXX where XXXXX is the sensor IDpython3 -c "import hashlib; print(hashlib.md5('MyAppUniqueName'.encode()).hexdigest())"
Save this UUID — it's permanent for this app installation.
Copy templates/narodmon_config.json and fill in your credentials:
{
"api_url": "http://api.narodmon.ru",
"api_key": "your_api_key",
"uuid": "your_md5_uuid",
"login": "your_login",
"password": "your_password",
"lang": "ru",
"utc_offset": 3,
"output_path": "/tmp/narodmon_daily.png",
"telegram": {
"token": "your_bot_token",
"chat_id": "your_chat_id"
},
"sensors": [
{"id": 12345, "label": "Улица", "color": "#2196F3"},
{"id": 12346, "label": "Дом", "color": "#FF5722"},
{"id": 12347, "label": "Баня", "color": "#4CAF50"},
{"id": 12348, "label": "Давление", "color": "#9C27B0", "secondary": true}
]
}
Add "secondary": true for non-temperature sensors (pressure, humidity) to plot them on a secondary Y-axis.
The script accepts --config argument pointing to the JSON config. Create a .sh wrapper:
#!/bin/bash
exec /path/to/venv/python /path/to/scripts/narodmon_daily.py --config /path/to/narodmon_config.json
Make executable. Use the Python interpreter that has matplotlib installed.
cronjob(action='create', schedule='0 9 * * *', no_agent=True, script='narodmon_daily.sh', name='narodmon-daily-summary')
no_agent=True — script runs directly, stdout delivered verbatim, no LLM tokensRun the script manually and check:
Authorized: uid=XXXXChart saved: /tmp/narodmon_daily.pngTelegram: photo sent (message_id=NN)The script generates a dual-axis matplotlib chart:
HTTPS unreachable from VPS. https://narodmon.ru may timeout (geo-block or IP filter). Use http://api.narodmon.ru — works for public sensors. For private sensors, HTTP still works but password hash travels unencrypted. Acceptable for most home setups.
Missing required headers. User-Agent and Narodmon-Api-Key are both mandatory. Without User-Agent, server returns {"error":"NO_VERSION_INFO","errno":400} or rejects silently.
appInit requires version. If you call appInit without version field, you get NO_VERSION_INFO error. Always pass "version":"1.0" at minimum.
sensorsValues limited to 30 sensors (or fewer, per your PubsLimit). Check Профиль → Мои приложения → PubsLimit.
userLogon rate limit. Call auth at most once per 24h. The script calls it once per run (daily), which is safe. If you increase cron frequency, cache the auth state.
matplotlib not in system Python. Install it in the Python environment that the cron script uses. Verify with python -c "import matplotlib".
Cron script path. Hermes no_agent cron scripts must be relative filenames in the Hermes scripts directory — not absolute paths. Use a .sh wrapper that calls the Python script with full paths.
Config file permissions. The JSON config contains credentials in plaintext. Restrict file permissions (chmod 600 narodmon_config.json). Do not commit to version control.
sensorsHistory accepts both id and sensors. Use sensors array for multiple sensors in one request. Response has sensors[] (metadata) and data[] (time-value pairs with sensor id field for matching).
Timezone. API returns UnixTime (UTC+0). Convert to local with datetime.fromtimestamp(t, tz=timezone(timedelta(hours=utc_offset))). The server timezone is Europe/Moscow — don't pass local time as-is to API.
--config pathno_agent=True, script='narodmon_daily.sh'0 9 * * * for 09:00 daily)