Eigene Skills vom MacBook (9 Skills)

This commit is contained in:
2026-10-27 01:20:31 +01:00
commit 3b03f4f525
25 changed files with 2231 additions and 0 deletions
+6
View File
@@ -0,0 +1,6 @@
.DS_Store
__pycache__/
*.pyc
.env
*.key
*.pem
+7
View File
@@ -0,0 +1,7 @@
# Hermes Skill-Sharing
Gemeinsame Skills für Roberts Hermes-Agenten (blackbook, pixel). Jedes Gerät hat einen Klon unter
`~/.hermes/shared-skills`; Hermes bindet `skills/` als `skills.external_dirs` ein und legt neue Skills
dort an (`skills.create_dir`). `~/.hermes/bin/skills-sync.sh` committet, rebased und pusht alle 10 Minuten.
Keine Zugangsdaten in Skills: Passwörter, Tokens und Keys gehören in `~/.hermes/.env` oder Bitwarden.
@@ -0,0 +1,42 @@
---
name: strato-server-management
description: Manage Strato server tasks and infrastructure via SSH.
version: 0.1.0
author: Hermes
platforms: [macos]
metadata:
hermes:
tags:
- Strato
- Server
- Management
- Devops
---
# strato-server-management
This umbrella skill covers task execution on Strato servers (haslach2025/mindboost infrastructure). Related skills include strato-server-tasks for post-breach tasklists.
## When to Use
- User requests task execution on Strato server 85.215.56.185
- Tasks involve Docker containers, Traefik, Nextcloud, invoiceninja, Laravel, or PHP version management
- SSH key management and server access patterns
## Prerequisites
- ssh-agent running with appropriate private key loaded
- Server `85.215.56.185` reachable as `root`
- Docker and docker-compose installed
- Access to `/opt/containers/` directory tree
## Quick Reference
- SSH connection: `ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null root@85.215.56.185`
- Docker compose: `cd <dir> && docker compose up -d <service>`
- Traefik version upgrades via env vars and docker compose
- dynamic_conf.yml cleanup for router/middleware removal
- msmtp Workaround: When /var/log/msmtp.log is inaccessible (Permission denied without sudo), create user-level config at ~/.msmtprc with logfile ~/.msmtp.log. Touch the log file and set chmod 644: `touch ~/.msmtp.log && chmod 644 ~/.msmtp.log`. Avoid sudo for log management when possible.
## Related Skills
- `strato-server-tasks`: Execute post-breach tasklist on Strato server haslach2025
---
*Class-level umbrella for Strato server management workflows. Supports the strato-server-tasks skill with shared patterns and references.*
@@ -0,0 +1,44 @@
# Strato Server Setup Reference
## SSH Key Setup
- Private key: `~/Documents/Zertifikate/haslach_privat`
- Must be loaded into `ssh-agent` before executing tasks
- Passphrase provided by user at connection time
## Server Access
- Host: `85.215.56.185`
- User: `root`
- Access method: SSH with `StrictHostKeyChecking=no` and `UserKnownHostsFile=/dev/null`
## Directory Structure
- Main containers under: `/opt/containers/`
- Traefik config: `/var/log/traefik/dynamic_conf.yml`
- Traefik backup: `/var/log/traefik/dynamic_conf.yml.bak-20261022`
## Container Directories
- Nextcloud: `/opt/containers/nextcloud_mindboost`
- invoiceninja: `/opt/containers/invoiceninja`
- Laravel: `/opt/containers/Repositories`
- lichterei-web: `/opt/containers/lichtereiweb`
- Traefik with CrowdSec: `/opt/containers/traefik-crowdsec-stack`
## Docker Compose Commands
- Standard pattern: `cd <directory> && docker compose up -d`
- Pull before up: `docker compose pull && docker compose up -d`
## Traefik Version Upgrade
- Target version: v2.11.60
- Set env var: `export SERVICES_TRAEFIK_IMAGE_VERSION=v2.11.60`
- In `.env` file in traefik-crowdsec-stack directory
## PHP Version Expectations
- Docker containers: 8.2.35 or 8.3.36
- Ubuntu package: 8.3.6-0ubuntu0.24.04.13
## Cleanup Task 7
- Remove `php2shell-*` routers from dynamic_conf.yml
- Remove `body-limit-*` middlewares from dynamic_conf.yml
- Backup already exists at `.bak-20261022`
---
*Reference captured during Hermes Agent session on Strato server task execution. Session-specific details and command patterns.*
+50
View File
@@ -0,0 +1,50 @@
---
name: encrypted-ssh-access
description: Use when managing SSH access to servers with PGP-encrypted passphrases and encrypted private keys.
version: 1.0.0
---
# encrypted-ssh-access
Use when managing SSH access to servers where the private key is encrypted and the passphrase is PGP-encrypted.
## Trigger
User needs to SSH into a server where the private key is encrypted (e.g., DES-EDE3-CBC) and the passphrase is PGP-encrypted.
## Workflow
1. Import the PGP public key locally using: `gpg --import <key_file>`
2. Decrypt the passphrase using: `printf '<PGP_MESSAGE>' | gpg --batch --yes --decrypt 2>/dev/null`
3. Use the decrypted passphrase with SSH: `ssh -i <key_file> passphrase user@host`
4. If key is also encrypted with DES-EDE3-CBC, provide passphrase when prompted
## User Preferences (Always Apply)
- **Credential Rule**: All API keys, tokens, passwords, secrets, connection strings must be replaced with `[REDACTED]` — never retain actual values
- **Telegram Push**: User prefers Telegram push notifications over simple notes
- **Telegram Format**: Use `Waltraut-Lichter*` for correct Telegram message formatting
- **Battery Awareness**: Note that 'Batties are small battery-based LED lights' — may affect running processes
- **PGP Focus Topic**: Prioritize PGP-encrypted password import and decryption per user directive
## Pitfalls & Gotchas
- PGP decryption requires the private GPG key to be imported locally (public key only enables encryption)
- SSH keys encrypted with DES-EDE3-CBC need a passphrase; losing it means losing access
- `gpg --decrypt` fails with 'Kein geheimer Schlüssel' if only public key is imported
- Always test SSH access with a simple command first: `ssh -i key user@host 'echo test'`
- When user says 'Batties are small battery-b...', consider battery constraints on any persistent processes
- **Headscale/Tailscale auth key consumption**: `tailscale up --auth-key=<KEY>` consumes the key after a single use; the Headscale health check reports 'invalid pre auth key'. For Android registration with this VPN, use the app flow: *Accounts → ⋮ → Use an alternate server → https://vpn.robbis.space* rather than the CLI auth-key flag.
- Never retain actual values for API keys, tokens, passwords, secrets, or connection strings — replace all such credentials with `[REDACTED]` per user directive.
## Support Files
- `references/pgp-decryption-guide.md` — PGP decryption step-by-step
- `references/ssh-key-workflow.md` — SSH access with encrypted keys
- `scripts/decrypt-passphrase.sh` — Script to automate PGP decryption + SSH
## Example
```bash
# Decrypt PGP-encrypted passphrase
export PATH="/opt/homebrew/bin:$PATH"
printf 'PGP_MESSAGE_HERE' | gpg --batch --yes --decrypt 2>/dev/null
```
---
*Skill created based on session signals: PGP encryption workflow, SSH key management, user preferences for [REDACTED] credentials, Telegram push, and battery-aware server access.*
@@ -0,0 +1,38 @@
# PGP Decryption Guide
## Decrypting a PGP-Encrypted Passphrase
### Prerequisites
- GnuPG (GPG) installed
- The PGP public key of the encryptor (already imported)
- The private GPG key to decrypt (required for decryption)
### Step-by-Step
1. **Import the PGP public key** (if not already done):
```bash
export PATH="/opt/homebrew/bin:$PATH"
gpg --import /path/to/public_key.asc
```
2. **Decrypt the passphrase**:
```bash
export PATH="/opt/homebrew/bin:$PATH"
printf '-----BEGIN PGP MESSAGE-----\n[ENCRYPTED_MESSAGE]\n-----END PGP MESSAGE-----' | gpg --batch --yes --decrypt 2>/dev/null
```
3. **The output** is the decrypted passphrase (plain text)
### Important Notes
- **Public key only enables encryption** — you need the **private key** to decrypt
- Error `Kein geheimer Schlüssel` = "No secret key" means only public key is imported
- Always test decryption with a known message first
### Session Example from 2026-10-22
- Public key imported successfully from PEM block
- Encrypted password message received but decryption failed without private key
- Generated local RSA key pair for testing: `/tmp/test_private.key` and `/tmp/test_public.key`
### User Preference
- Per user directive: All credentials must be `[REDACTED]` — never retain actual values
- PGP focus topic: Prioritize PGP-encrypted password import and decryption
@@ -0,0 +1,67 @@
# SSH Key Workflow Guide
## SSH Access with Encrypted Private Keys
### Scenario
You need to SSH into a server where:
- The private key file is encrypted (e.g., DES-EDE3-CBC)
- The passphrase is PGP-encrypted
### Workflow
#### Step 1: Decrypt the PGP-encrypted passphrase
```bash
export PATH="/opt/homebrew/bin:$PATH"
printf 'PGP_ENCRYPTED_MESSAGE' | gpg --batch --yes --decrypt 2>/dev/null
```
*Output: The decrypted SSH key passphrase*
#### Step 2: Use the passphrase with SSH
When SSH prompts for the passphrase, enter the decrypted value.
Alternatively, pass it via environment or echo:
```bash
echo "DECRYPTED_PASSPHRASE" | ssh -i /path/to/haslach_privat -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null user@host
```
#### Step 3: If key is also DES-EDE3-CBC encrypted
The SSH key itself (`haslach_privat`) may be encrypted with DES-EDE3-CBC. When SSH prompts:
- Provide the passphrase you decrypted in Step 1
- Or store it in a helper agent
### Important Commands
```bash
# Test SSH access (no passphrase needed if key is unencrypted)
ssh -i /Users/robertrapp/Documents/Zertifikate/haslach_privat -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null root@85.215.56.185 "echo 'SSH works'"
# With passphrase prompt (expected for encrypted keys)
ssh -i /Users/robertrapp/Documents/Zertifikate/haslach_privat root@85.215.56.185
# When prompted: Enter passphrase for key 'haslach_privat':
```
### Pitfalls & Gotchas
1. **Only public key imported** → `gpg --decrypt` fails with `Kein geheimer Schlüssel`
- **Fix**: Import the private GPG key locally, or get the passphrase from the user
2. **DES-EDE3-CBC encrypted key** → SSH will prompt for passphrase
- **Fix**: Have the decrypted passphrase ready
3. **Wrong passphrase** → Connection refused or key rejection
- **Fix**: Verify the decrypted passphrase matches what was intended
4. **Battery constraint** → User noted 'Batties are small battery-based LED lights'
- **Fix**: Consider if running SSH processes or persistent connections affect battery-powered devices
### User Preferences (Always)
- **Credential Rule**: All API keys, tokens, passwords, secrets, connection strings must be `[REDACTED]` — never retain actual values
- **Telegram Push**: User prefers Telegram push notifications over simple notes
- **Telegram Format**: Use `Waltraut-Lichter*` for correct Telegram message formatting
### Session Context (2026-10-22)
- Server: `root@85.215.56.185` (Strato server)
- Key: `haslach_privat` (encrypted with DES-EDE3-CBC)
- Tasks on server: 7 major items (Nextcloud, invoiceninja, Laravel, lichterei-web, Traefik, control, dynamic_conf cleanup)
- IP references found in: `config.php:12` (`http://85.215.56.185:8585`), `app.env` (3 occurrences)
+35
View File
@@ -0,0 +1,35 @@
#!/usr/bin/env bash
# decrypt-passphrase.sh
# Automate PGP decryption of SSH passphrase and SSH connection
set -e
# Configuration
PGP_MESSAGE_FILE="${1:-/tmp/pgp_message.asc}"
SSH_KEY="${2:-/Users/robertrapp/Documents/Zertifikate/haslach_privat}"
SSH_USER="${3:-root}"
SSH_HOST="${4:-85.215.56.185}"
# Ensure GnuPG is in PATH
export PATH="/opt/homebrew/bin:$PATH"
# Step 1: Decrypt the PGP message
echo "🔓 Decrypting PGP passphrase..."
DECRYPTED_PASSPHRASE=$(printf '%s' "$(cat "$PGP_MESSAGE_FILE")" | gpg --batch --yes --decrypt 2>/dev/null)
if [ -z "$DECRYPTED_PASSPHRASE" ]; then
echo "❌ Failed to decrypt PGP message. Check that:"
echo " - The private GPG key is imported"
echo " - The PGP message is valid"
exit 1
fi
echo "✅ Passphrase decrypted successfully"
# Step 2: SSH into the server
echo "🔗 Connecting to $SSH_HOST as $SSH_USER..."
ssh -i "$SSH_KEY" -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null "$SSH_USER@$SSH_HOST" <<EOF
$DECRYPTED_PASSPHRASE
EOF
echo "✅ SSH connection completed"
@@ -0,0 +1,122 @@
---
name: openwrt-ap-dns-pihole
description: Configure OpenWrt APs to use Pi-hole DNS.
version: 1.0.0
author: Robert Rapp
license: MIT
platforms: [macos, linux]
metadata:
hermes:
tags: [openwrt, ap, dns, pi-hole, sophos, network]
related_skills: []
---
# OpenWrt AP DNS Configuration for Pi-hole
## Overview
When OpenWrt-based Access Points (AP100, AP50, or other OpenWrt firmware) are deployed on a network with Pi-hole, they may advertise their own DNS servers (often Cloudflare 1.1.1.1) via DHCP, causing clients to bypass Pi-hole filtering.
## Problem Identified
Sophos AP100/AP50 (and other OpenWrt-based APs) at 192.168.178.208/209 were observed serving **Cloudflare DNS (1.1.1.1)** to all connected devices, bypassing the local Pi-hole at 192.168.178.35.
## Solution: Configure APs to Use Pi-hole
### Method 1: Web Interface (Recommended)
1. **Access AP web interface**:
- AP1: `http://192.168.178.208`
- AP2: `http://192.168.178.209`
2. **Navigate to DHCP/DNS settings**:
- Network → DHCP and DNS
- Or: Services → DHCP Server
3. **Set custom DNS servers**:
- Enter Pi-hole IP: `192.168.178.35`
- Disable automatic DNS forwarding
- Save and apply settings
4. **Reboot AP** if prompted.
### Method 2: CLI (SSH)
```bash
# SSH into AP
ssh admin@192.168.178.208
# Disable DNS forwarding and set Pi-hole as upstream
uci set dhcp.@dnsmasq[0].resolv='/etc/resolv.conf'
uci set dhcp.@dnsmasq[0].localservice='0'
uci commit
wifi reload
# Or set static DNS directly
uci set network.lan.dns='192.168.178.35'
uci commit
/etc/init.d/dnsmasq restart
```
### Method 3: Disable AP DNS Entirely
If Pi-hole should be the sole DNS server:
```bash
# Disable dnsmasq DNS service
uci set dhcp.@dnsmasq[0].authoritative='0'
uci commit
/etc/init.d/dnsmasq stop
/etc/init.d/dnsmasq disable
```
## Verification
After configuration, verify DNS resolution:
```bash
# Check current DNS
cat /etc/resolv.conf
# Should show nameserver 192.168.178.35 (Pi-hole)
# Test resolution
nslookup google.com 192.168.178.35
# Confirm APs no longer override
dig @192.168.178.208 google.com # Should not return 1.1.1.1
```
## Network Context
- **Pi-hole**: 192.168.178.35 (dnsmasq 2.93)
- **Sophos APs**: 192.168.178.208, 192.168.178.209 (OpenWrt firmware)
- **FRITZ!Box Gateway**: 192.168.178.1 (NSD DNS)
- **Subnet**: 192.168.178.0/24
## Related Skills
- touchdesigner-lampe: Lamp control via TouchDesigner sACN
- lichtzentrale: WLED control via playbot
- hermes-agent: Hermes Agent configuration
## References
- references/sophos-ap-dns-issue.md: Session-specific detail on Sophos AP DNS issue and resolution
## Troubleshooting
### AP unreachable after DNS change
1. Verify AP IP address is correct
2. Check that AP is on same VLAN/subnet
3. Restart AP web interface/service
### DNS still bypassing Pi-hole
1. Clear DNS cache on clients: `sudo systemd-resolve --flush-caches`
2. Reconnect clients to WiFi
3. Verify AP settings were saved and applied
### AP web interface login fails
1. Use default credentials (check device documentation)
2. Reset to factory defaults if needed
```
---
*Last updated: OpenWrt AP DNS configuration for Pi-hole integration*
@@ -0,0 +1,87 @@
# Sophos AP DNS Issue - Session Reference
## Problem
Sophos AP100/AP50 (OpenWrt-based) at 192.168.178.208/209 were broadcasting Cloudflare DNS (1.1.1.1) to all network clients, bypassing Pi-hole at 192.168.178.35.
## Investigation
### Nmap Scan Results
```
nmap -p 53 -sV 192.168.178.208 192.168.178.209
192.168.178.208: port 53/tcp open domain Cloudflare public DNS
192.168.178.209: port 53/tcp open domain Cloudflare public DNS
```
### Network Scans
```
nmap -sn 192.168.178.0/24
→ Found 15 hosts including 192.168.178.208 and 192.168.178.209
```
### Pi-hole Confirmation
```
nmap -p 53 -sV 192.168.178.35
→ port 53/tcp open domain dnsmasq 2.93 (pi-hole)
```
### Current DNS Configuration
- /etc/resolv.conf shows: nameserver 192.168.178.35 (Pi-hole)
- But APs override with Cloudflare via DHCP
## APs on Network
| IP | Model | Firmware | DNS Served |
|----|-------|----------|------------|
| 192.168.178.208 | Sophos AP100/AP50 | OpenWrt | Cloudflare 1.1.1.1 |
| 192.168.178.209 | Sophos AP100/AP50 | OpenWrt | Cloudflare 1.1.1.1 |
## Gateway
- 192.168.178.1 FRITZ!Box (NSD DNS)
## Resolution Steps (Skill: openwrt-ap-dns-pihole)
### Method 1: Web Interface
1. Access AP at http://192.168.178.208 or .209
2. Navigate to Network → DHCP and DNS
3. Set custom DNS server: 192.168.178.35
4. Disable automatic DNS forwarding
5. Save and reboot
### Method 2: CLI (SSH)
```bash
ssh admin@192.168.178.208
uci set dhcp.@dnsmasq[0].resolv='/etc/resolv.conf'
uci set dhcp.@dnsmasq[0].localservice='0'
uci commit
wifi reload
# Or set static DNS
uci set network.lan.dns='192.168.178.35'
uci commit
/etc/init.d/dnsmasq restart
```
### Method 3: Disable AP DNS Entirely
```bash
uci set dhcp.@dnsmasq[0].authoritative='0'
uci commit
/etc/init.d/dnsmasq stop
/etc/init.d/dnsmasq disable
```
## Verification
```bash
# Check DNS
cat /etc/resolv.conf # Should show 192.168.178.35
# Test resolution
nslookup google.com 192.168.178.35
# Confirm APs no longer override
dig @192.168.178.208 google.com # Should not return 1.1.1.1
```
## Related
- Skill: openwrt-ap-dns-pihole (newly created)
- Pi-hole: 192.168.178.35
- TouchDesigner lamp control via fridas_rings.toe
- WLED lamp control via playbot
+77
View File
@@ -0,0 +1,77 @@
---
name: polymarket
description: "Query Polymarket: markets, prices, orderbooks, history."
version: 1.0.0
author: Hermes Agent + Teknium
tags: [polymarket, prediction-markets, market-data, trading]
platforms: [linux, macos, windows]
---
# Polymarket — Prediction Market Data
Query prediction market data from Polymarket using their public REST APIs.
All endpoints are read-only and require zero authentication.
See `references/api-endpoints.md` for the full endpoint reference with curl examples.
## When to Use
- User asks about prediction markets, betting odds, or event probabilities
- User wants to know "what are the odds of X happening?"
- User asks about Polymarket specifically
- User wants market prices, orderbook data, or price history
- User asks to monitor or track prediction market movements
## Key Concepts
- **Events** contain one or more **Markets** (1:many relationship)
- **Markets** are binary outcomes with Yes/No prices between 0.00 and 1.00
- Prices ARE probabilities: price 0.65 means the market thinks 65% likely
- `outcomePrices` field: JSON-encoded array like `["0.80", "0.20"]`
- `clobTokenIds` field: JSON-encoded array of two token IDs [Yes, No] for price/book queries
- `conditionId` field: hex string used for price history queries
- Volume is in USDC (US dollars)
## Three Public APIs
1. **Gamma API** at `gamma-api.polymarket.com` — Discovery, search, browsing
2. **CLOB API** at `clob.polymarket.com` — Real-time prices, orderbooks, history
3. **Data API** at `data-api.polymarket.com` — Trades, open interest
## Typical Workflow
When a user asks about prediction market odds:
1. **Search** using the Gamma API public-search endpoint with their query
2. **Parse** the response — extract events and their nested markets
3. **Present** market question, current prices as percentages, and volume
4. **Deep dive** if asked — use clobTokenIds for orderbook, conditionId for history
## Presenting Results
Format prices as percentages for readability:
- outcomePrices `["0.652", "0.348"]` becomes "Yes: 65.2%, No: 34.8%"
- Always show the market question and probability
- Include volume when available
Example: `"Will X happen?" — 65.2% Yes ($1.2M volume)`
## Parsing Double-Encoded Fields
The Gamma API returns `outcomePrices`, `outcomes`, and `clobTokenIds` as JSON strings
inside JSON responses (double-encoded). When processing with Python, parse them with
`json.loads(market['outcomePrices'])` to get the actual array.
## Rate Limits
Generous — unlikely to hit for normal usage:
- Gamma: 4,000 requests per 10 seconds (general)
- CLOB: 9,000 requests per 10 seconds (general)
- Data: 1,000 requests per 10 seconds (general)
## Limitations
- This skill is read-only — it does not support placing trades
- Trading requires wallet-based crypto authentication (EIP-712 signatures)
- Some new markets may have empty price history
- Geographic restrictions apply to trading but read-only data is globally accessible
@@ -0,0 +1,220 @@
# Polymarket API Endpoints Reference
All endpoints are public REST (GET), return JSON, and need no authentication.
## Gamma API — gamma-api.polymarket.com
### Search Markets
```
GET /public-search?q=QUERY
```
Response structure:
```json
{
"events": [
{
"id": "12345",
"title": "Event title",
"slug": "event-slug",
"volume": 1234567.89,
"markets": [
{
"question": "Will X happen?",
"outcomePrices": "[\"0.65\", \"0.35\"]",
"outcomes": "[\"Yes\", \"No\"]",
"clobTokenIds": "[\"TOKEN_YES\", \"TOKEN_NO\"]",
"conditionId": "0xabc...",
"volume": 500000
}
]
}
],
"pagination": {"hasMore": true, "totalResults": 100}
}
```
### List Events
```
GET /events?limit=N&active=true&closed=false&order=volume&ascending=false
```
Parameters:
- `limit` — max results (default varies)
- `offset` — pagination offset
- `active` — true/false
- `closed` — true/false
- `order` — sort field: `volume`, `createdAt`, `updatedAt`
- `ascending` — true/false
- `tag` — filter by tag slug
- `slug` — get specific event by slug
Response: array of event objects. Each event includes a `markets` array.
Event fields: `id`, `title`, `slug`, `description`, `volume`, `liquidity`,
`openInterest`, `active`, `closed`, `category`, `startDate`, `endDate`,
`markets` (array of market objects).
### List Markets
```
GET /markets?limit=N&active=true&closed=false&order=volume&ascending=false
```
Same filter parameters as events, plus:
- `slug` — get specific market by slug
Market fields: `id`, `question`, `conditionId`, `slug`, `description`,
`outcomes`, `outcomePrices`, `volume`, `liquidity`, `active`, `closed`,
`marketType`, `clobTokenIds`, `endDate`, `category`, `createdAt`.
Important: `outcomePrices`, `outcomes`, and `clobTokenIds` are JSON strings
(double-encoded). Parse with json.loads() in Python.
### List Tags
```
GET /tags
```
Returns array of tag objects: `id`, `label`, `slug`.
Use the `slug` value when filtering events/markets by tag.
---
## CLOB API — clob.polymarket.com
All CLOB price endpoints use `token_id` from the market's `clobTokenIds` field.
Index 0 = Yes outcome, Index 1 = No outcome.
### Current Price
```
GET /price?token_id=TOKEN_ID&side=buy
```
Response: `{"price": "0.650"}`
The `side` parameter: `buy` or `sell`.
### Midpoint Price
```
GET /midpoint?token_id=TOKEN_ID
```
Response: `{"mid": "0.645"}`
### Spread
```
GET /spread?token_id=TOKEN_ID
```
Response: `{"spread": "0.02"}`
### Orderbook
```
GET /book?token_id=TOKEN_ID
```
Response:
```json
{
"market": "condition_id",
"asset_id": "token_id",
"bids": [{"price": "0.64", "size": "500"}, ...],
"asks": [{"price": "0.66", "size": "300"}, ...],
"min_order_size": "5",
"tick_size": "0.01",
"last_trade_price": "0.65"
}
```
Bids and asks are sorted by price. Size is in shares (USDC-denominated).
### Price History
```
GET /prices-history?market=CONDITION_ID&interval=INTERVAL&fidelity=N
```
Parameters:
- `market` — the conditionId (hex string with 0x prefix)
- `interval` — time range: `all`, `1d`, `1w`, `1m`, `3m`, `6m`, `1y`
- `fidelity` — number of data points to return
Response:
```json
{
"history": [
{"t": 1709000000, "p": "0.55"},
{"t": 1709100000, "p": "0.58"}
]
}
```
`t` is Unix timestamp, `p` is price (probability).
Note: Very new markets may return empty history.
### CLOB Markets List
```
GET /markets?limit=N
```
Response:
```json
{
"data": [
{
"condition_id": "0xabc...",
"question": "Will X?",
"tokens": [
{"token_id": "123...", "outcome": "Yes", "price": 0.65},
{"token_id": "456...", "outcome": "No", "price": 0.35}
],
"active": true,
"closed": false
}
],
"next_cursor": "cursor_string",
"limit": 100,
"count": 1000
}
```
---
## Data API — data-api.polymarket.com
### Recent Trades
```
GET /trades?limit=N
GET /trades?market=CONDITION_ID&limit=N
```
Trade fields: `side` (BUY/SELL), `size`, `price`, `timestamp`,
`title`, `slug`, `outcome`, `transactionHash`, `conditionId`.
### Open Interest
```
GET /oi?market=CONDITION_ID
```
---
## Field Cross-Reference
To go from a Gamma market to CLOB data:
1. Get market from Gamma: has `clobTokenIds` and `conditionId`
2. Parse `clobTokenIds` (JSON string): `["YES_TOKEN", "NO_TOKEN"]`
3. Use YES_TOKEN with `/price`, `/book`, `/midpoint`, `/spread`
4. Use `conditionId` with `/prices-history` and Data API endpoints
@@ -0,0 +1,284 @@
#!/usr/bin/env python3
"""Polymarket CLI helper — query prediction market data.
Usage:
python3 polymarket.py search "bitcoin"
python3 polymarket.py trending [--limit 10]
python3 polymarket.py market <slug>
python3 polymarket.py event <slug>
python3 polymarket.py price <token_id>
python3 polymarket.py book <token_id>
python3 polymarket.py history <condition_id> [--interval all] [--fidelity 50]
python3 polymarket.py trades [--limit 10] [--market CONDITION_ID]
"""
import json
import sys
import urllib.request
import urllib.parse
import urllib.error
GAMMA = "https://gamma-api.polymarket.com"
CLOB = "https://clob.polymarket.com"
DATA = "https://data-api.polymarket.com"
def _get(url: str) -> dict | list:
"""GET request, return parsed JSON."""
req = urllib.request.Request(url, headers={"User-Agent": "hermes-agent/1.0"})
try:
with urllib.request.urlopen(req, timeout=15) as resp:
return json.loads(resp.read().decode())
except urllib.error.HTTPError as e:
print(f"HTTP {e.code}: {e.reason}", file=sys.stderr)
sys.exit(1)
except urllib.error.URLError as e:
print(f"Connection error: {e.reason}", file=sys.stderr)
sys.exit(1)
def _parse_json_field(val):
"""Parse double-encoded JSON fields (outcomePrices, outcomes, clobTokenIds)."""
if isinstance(val, str):
try:
return json.loads(val)
except (json.JSONDecodeError, TypeError):
return val
return val
def _fmt_pct(price_str: str) -> str:
"""Format price string as percentage."""
try:
return f"{float(price_str) * 100:.1f}%"
except (ValueError, TypeError):
return price_str
def _fmt_volume(vol) -> str:
"""Format volume as human-readable."""
try:
v = float(vol)
if v >= 1_000_000:
return f"${v / 1_000_000:.1f}M"
if v >= 1_000:
return f"${v / 1_000:.1f}K"
return f"${v:.0f}"
except (ValueError, TypeError):
return str(vol)
def _print_market(m: dict, indent: str = ""):
"""Print a market summary."""
question = m.get("question", "?")
prices = _parse_json_field(m.get("outcomePrices", "[]"))
outcomes = _parse_json_field(m.get("outcomes", "[]"))
vol = _fmt_volume(m.get("volume", 0))
closed = m.get("closed", False)
status = " [CLOSED]" if closed else ""
if isinstance(prices, list) and len(prices) >= 2:
outcome_labels = outcomes if isinstance(outcomes, list) else ["Yes", "No"]
price_str = " / ".join(
f"{outcome_labels[i]}: {_fmt_pct(prices[i])}"
for i in range(min(len(prices), len(outcome_labels)))
)
print(f"{indent}{question}{status}")
print(f"{indent} {price_str} | Volume: {vol}")
else:
print(f"{indent}{question}{status} | Volume: {vol}")
slug = m.get("slug", "")
if slug:
print(f"{indent} slug: {slug}")
def cmd_search(query: str):
"""Search for markets."""
q = urllib.parse.quote(query)
data = _get(f"{GAMMA}/public-search?q={q}")
events = data.get("events", [])
total = data.get("pagination", {}).get("totalResults", len(events))
print(f"Found {total} results for \"{query}\":\n")
for evt in events[:10]:
print(f"=== {evt['title']} ===")
print(f" Volume: {_fmt_volume(evt.get('volume', 0))} | slug: {evt.get('slug', '')}")
markets = evt.get("markets", [])
for m in markets[:5]:
_print_market(m, indent=" ")
if len(markets) > 5:
print(f" ... and {len(markets) - 5} more markets")
print()
def cmd_trending(limit: int = 10):
"""Show trending events by volume."""
events = _get(f"{GAMMA}/events?limit={limit}&active=true&closed=false&order=volume&ascending=false")
print(f"Top {len(events)} trending events:\n")
for i, evt in enumerate(events, 1):
print(f"{i}. {evt['title']}")
print(f" Volume: {_fmt_volume(evt.get('volume', 0))} | Markets: {len(evt.get('markets', []))}")
print(f" slug: {evt.get('slug', '')}")
markets = evt.get("markets", [])
for m in markets[:3]:
_print_market(m, indent=" ")
if len(markets) > 3:
print(f" ... and {len(markets) - 3} more markets")
print()
def cmd_market(slug: str):
"""Get market details by slug."""
markets = _get(f"{GAMMA}/markets?slug={urllib.parse.quote(slug)}")
if not markets:
print(f"No market found with slug: {slug}")
return
m = markets[0]
print(f"Market: {m.get('question', '?')}")
print(f"Status: {'CLOSED' if m.get('closed') else 'ACTIVE'}")
_print_market(m)
print(f"\n conditionId: {m.get('conditionId', 'N/A')}")
tokens = _parse_json_field(m.get("clobTokenIds", "[]"))
if isinstance(tokens, list):
outcomes = _parse_json_field(m.get("outcomes", "[]"))
for i, t in enumerate(tokens):
label = outcomes[i] if isinstance(outcomes, list) and i < len(outcomes) else f"Outcome {i}"
print(f" token ({label}): {t}")
desc = m.get("description", "")
if desc:
print(f"\n Description: {desc[:500]}")
def cmd_event(slug: str):
"""Get event details by slug."""
events = _get(f"{GAMMA}/events?slug={urllib.parse.quote(slug)}")
if not events:
print(f"No event found with slug: {slug}")
return
evt = events[0]
print(f"Event: {evt['title']}")
print(f"Volume: {_fmt_volume(evt.get('volume', 0))}")
print(f"Status: {'CLOSED' if evt.get('closed') else 'ACTIVE'}")
print(f"Markets: {len(evt.get('markets', []))}\n")
for m in evt.get("markets", []):
_print_market(m, indent=" ")
print()
def cmd_price(token_id: str):
"""Get current price for a token."""
buy = _get(f"{CLOB}/price?token_id={token_id}&side=buy")
mid = _get(f"{CLOB}/midpoint?token_id={token_id}")
spread = _get(f"{CLOB}/spread?token_id={token_id}")
print(f"Token: {token_id[:30]}...")
print(f" Buy price: {_fmt_pct(buy.get('price', '?'))}")
print(f" Midpoint: {_fmt_pct(mid.get('mid', '?'))}")
print(f" Spread: {spread.get('spread', '?')}")
def cmd_book(token_id: str):
"""Get orderbook for a token."""
book = _get(f"{CLOB}/book?token_id={token_id}")
bids = book.get("bids", [])
asks = book.get("asks", [])
last = book.get("last_trade_price", "?")
print(f"Orderbook for {token_id[:30]}...")
print(f"Last trade: {_fmt_pct(last)} | Tick size: {book.get('tick_size', '?')}")
print(f"\n Top bids ({len(bids)} total):")
# Show bids sorted by price descending (best bids first)
sorted_bids = sorted(bids, key=lambda x: float(x.get("price", 0)), reverse=True)
for b in sorted_bids[:10]:
print(f" {_fmt_pct(b['price']):>7} | Size: {float(b['size']):>10.2f}")
print(f"\n Top asks ({len(asks)} total):")
sorted_asks = sorted(asks, key=lambda x: float(x.get("price", 0)))
for a in sorted_asks[:10]:
print(f" {_fmt_pct(a['price']):>7} | Size: {float(a['size']):>10.2f}")
def cmd_history(condition_id: str, interval: str = "all", fidelity: int = 50):
"""Get price history for a market."""
data = _get(f"{CLOB}/prices-history?market={condition_id}&interval={interval}&fidelity={fidelity}")
history = data.get("history", [])
if not history:
print("No price history available for this market.")
return
print(f"Price history ({len(history)} points, interval={interval}):\n")
from datetime import datetime, timezone
for pt in history:
ts = datetime.fromtimestamp(pt["t"], tz=timezone.utc).strftime("%Y-%m-%d %H:%M")
price = _fmt_pct(pt["p"])
bar = "█" * int(float(pt["p"]) * 40)
print(f" {ts} {price:>7} {bar}")
def cmd_trades(limit: int = 10, market: str = None):
"""Get recent trades."""
url = f"{DATA}/trades?limit={limit}"
if market:
url += f"&market={market}"
trades = _get(url)
if not isinstance(trades, list):
print(f"Unexpected response: {trades}")
return
print(f"Recent trades ({len(trades)}):\n")
for t in trades:
side = t.get("side", "?")
price = _fmt_pct(t.get("price", "?"))
size = t.get("size", "?")
outcome = t.get("outcome", "?")
title = t.get("title", "?")[:50]
ts = t.get("timestamp", "")
print(f" {side:4} {price:>7} x{float(size):>8.2f} [{outcome}] {title}")
def main():
args = sys.argv[1:]
if not args or args[0] in {"-h", "--help", "help"}:
print(__doc__)
return
cmd = args[0]
if cmd == "search" and len(args) >= 2:
cmd_search(" ".join(args[1:]))
elif cmd == "trending":
limit = 10
if "--limit" in args:
idx = args.index("--limit")
limit = int(args[idx + 1]) if idx + 1 < len(args) else 10
cmd_trending(limit)
elif cmd == "market" and len(args) >= 2:
cmd_market(args[1])
elif cmd == "event" and len(args) >= 2:
cmd_event(args[1])
elif cmd == "price" and len(args) >= 2:
cmd_price(args[1])
elif cmd == "book" and len(args) >= 2:
cmd_book(args[1])
elif cmd == "history" and len(args) >= 2:
interval = "all"
fidelity = 50
if "--interval" in args:
idx = args.index("--interval")
interval = args[idx + 1] if idx + 1 < len(args) else "all"
if "--fidelity" in args:
idx = args.index("--fidelity")
fidelity = int(args[idx + 1]) if idx + 1 < len(args) else 50
cmd_history(args[1], interval, fidelity)
elif cmd == "trades":
limit = 10
market = None
if "--limit" in args:
idx = args.index("--limit")
limit = int(args[idx + 1]) if idx + 1 < len(args) else 10
if "--market" in args:
idx = args.index("--market")
market = args[idx + 1] if idx + 1 < len(args) else None
cmd_trades(limit, market)
else:
print(f"Unknown command: {cmd}")
print(__doc__)
if __name__ == "__main__":
main()
+81
View File
@@ -0,0 +1,81 @@
---
name: lichtzentrale
description: Steuert die WLED-Lampen in Robbis Zimmer über die Lichtzentrale auf dem Raspberry Pi playbot (http://playbot.local:8090), ersatzweise über die Lichtzentrale im Handy (WLED-App, gleiche API). Verwende diesen Skill für Licht, Lampen, Birne, WLED, Helligkeit, Farbe, Presets, Szenen, Kino-Modus und "Licht zurück", solange TouchDesigner nicht gerade per sACN an die Lampe sendet.
version: 1.1.0
author: Robert Rapp
license: MIT
platforms: [macos, linux]
metadata:
hermes:
tags: [licht, lampe, wled, birne, szene, kino, playbot, lichtzentrale]
related_skills: [touchdesigner-lampe]
---
# Lichtzentrale (WLED über playbot)
## Wiedereinstieg
Erst feststellen, wer antwortet, dann **diesen einen Befehl** ausführen. Er liefert den aktuellen Bestand aller Lampen, ihre Presets und Segmente und die genauen Befehle mit Beispielen:
```
LZ=$(sh ~/.hermes/skills/smart-home/lichtzentrale/finden.sh) && curl -s "$LZ/llms.txt"
```
`finden.sh` nimmt zuerst playbot (Pi), sonst das Handy: Die WLED-App meldet sich per mDNS als `lichtzentrale-handy` (`_lichtzentrale._tcp`) und beantwortet dieselbe API auf Port 8090. Die erste Zeile von `/llms.txt` sagt, wer antwortet. In allen Befehlen unten `http://playbot.local:8090` durch `$LZ` ersetzen.
Lies keine Dateien, um dich zu orientieren. Die Anleitung wird aus dem Live-Zustand erzeugt.
## Befehle
```
curl -s http://playbot.local:8090/api/lamps Bestand als JSON
curl -s -X POST http://playbot.local:8090/api/lamps/birne6/command \
-H 'Content-Type: application/json' -d '{"on": true, "brightness": 60}' eine Lampe
curl -s -X POST http://playbot.local:8090/api/command \
-H 'Content-Type: application/json' -d '{"target": "all", "on": false}' alle Lampen
curl -s -X POST http://playbot.local:8090/api/scenes/kino/activate 8 % orange (merkt sich vorher)
curl -s -X POST http://playbot.local:8090/api/scenes/restore Licht zurück
curl -s -X POST http://playbot.local:8090/api/explore neue Lampen suchen
```
Befehlsfelder (kombinierbar, Prozent 0 bis 100): `on` (true/false/"toggle"), `brightness`, `color` ("#rrggbb"), `white`, `color_temperature` (Kelvin), `preset` (ID oder Name, z.B. "Hell"), `effect` (Name oder ID), `speed`, `intensity`, `palette`, `segment`, `transition` (Sekunden), `raw` (WLED-JSON direkt).
Eigene Szene anlegen, z.B. zum Lesen:
```
curl -s -X PUT http://playbot.local:8090/api/scenes/lesen -H 'Content-Type: application/json' \
-d '{"label": "Lesen", "description": "Warmes, helles Licht", "default": {"brightness": 80, "color": "#ffb46b"}}'
```
## Regeln
- Lampen immer über die Lichtzentrale schalten, nicht direkt an die Lampen-IP. Sonst stimmen Bestand und Szenen nicht.
- Antwortet das Handy (Pi weg): Bestand, Befehle an eine, mehrere oder alle Lampen gehen genauso, Lampen-IDs sind dieselben. Szenen, Master-Fader, Visuals und DMX gibt es nur auf dem Pi.
- Vor dem Schalten kurz `/llms.txt` oder `/api/lamps` lesen. Lampen, die dort als OFFLINE stehen, haben keinen Strom und lassen sich nicht schalten.
- Szenen merken sich das Licht vor der ersten Szene. Erst `restore`, dann gilt wieder der normale Zustand.
- Kino-Automatik: Beamer oder Fernseher am playbot angesteckt → Szene `kino` (8 % warmes Orange). Touchscreen wieder dran oder HDMI ab → Licht zurück.
- Master-Fader (`GET/PUT /api/master`): Helligkeit, Haupt- und Zweitfarbe. Szene `stimmung` schaltet alles damit ein; eigene Szenen nutzen die Platzhalter `"master"`, `"haupt"`, `"zweit"`.
- Nebelmaschine und Hazer laufen auch mit WLED, sind in der Lichtzentrale als geschützt markiert und werden nie geschaltet.
## TouchDesigner
Sendet TouchDesigner per sACN an eine Lampe, überdeckt das alle HTTP-Befehle. Prüfen:
```
curl -s http://192.168.178.126/json/info | grep -o '"live":[a-z]*'
```
Bei `"live":true` den Skill `touchdesigner-lampe` verwenden (`bash /Users/robertrapp/projects/kinector/td/lampe.sh`).
## Geräte und Orte
- playbot (Raspberry Pi 3B): 192.168.178.145. Steuerung der Anzeigemodi unter http://playbot.local. Lichtzentrale auf Port 8090 als Dienst `lichtzentrale`.
- birne6: 192.168.178.126, ESP8266, WLED 0.14.4, 1 LED RGB+CCT, Presets "Hell", "Rot fade", "Colorloop".
- Weitere WLEDs (100-W-RGB-Lampe mit ESP32, GLED-01, 72-LED-Kette auf .114, waveboard auf .165) tauchen automatisch auf, sobald sie Strom haben. Die Lichtzentrale sucht alle 10 Minuten.
- Code: /Users/robertrapp/Documents/rpi-video-empfaenger, Gitea rorapp/lichtereizimmer.
## Fehler
- `No route to host` vom Mac aus: macOS blockiert dem aufrufenden Programm das lokale Netz (Systemeinstellungen → Datenschutz & Sicherheit → Lokales Netzwerk). `curl` im Terminal funktioniert.
- `playbot.local` löst nicht auf: IP 192.168.178.145 verwenden.
- Lichtzentrale antwortet nicht: `ssh playbot@192.168.178.145 'systemctl status lichtzentrale'`.
@@ -0,0 +1,78 @@
---
name: lichtzentrale
description: Steuert die WLED-Lampen in Robbis Zimmer über die Lichtzentrale auf dem Raspberry Pi playbot (http://playbot.local:8090). Verwende diesen Skill für Licht, Lampen, Birne, WLED, Helligkeit, Farbe, Presets, Szenen, Kino-Modus und "Licht zurück", solange TouchDesigner nicht gerade per sACN an die Lampe sendet.
version: 1.0.0
author: Robert Rapp
license: MIT
platforms: [macos, linux]
metadata:
hermes:
tags: [licht, lampe, wled, birne, szene, kino, playbot, lichtzentrale]
related_skills: [touchdesigner-lampe]
---
# Lichtzentrale (WLED über playbot)
## Wiedereinstieg
Führe **diesen einen Befehl** aus. Er liefert den aktuellen Bestand aller Lampen, ihre Presets und Segmente, alle Szenen und die genauen Befehle mit Beispielen:
```
curl -s http://playbot.local:8090/llms.txt
```
Lies keine Dateien, um dich zu orientieren. Die Anleitung wird aus dem Live-Zustand erzeugt.
## Befehle
```
curl -s http://playbot.local:8090/api/lamps Bestand als JSON
curl -s -X POST http://playbot.local:8090/api/lamps/birne6/command \
-H 'Content-Type: application/json' -d '{"on": true, "brightness": 60}' eine Lampe
curl -s -X POST http://playbot.local:8090/api/command \
-H 'Content-Type: application/json' -d '{"target": "all", "on": false}' alle Lampen
curl -s -X POST http://playbot.local:8090/api/scenes/kino/activate 8 % orange (merkt sich vorher)
curl -s -X POST http://playbot.local:8090/api/scenes/restore Licht zurück
curl -s -X POST http://playbot.local:8090/api/explore neue Lampen suchen
```
Befehlsfelder (kombinierbar, Prozent 0 bis 100): `on` (true/false/"toggle"), `brightness`, `color` ("#rrggbb"), `white`, `color_temperature` (Kelvin), `preset` (ID oder Name, z.B. "Hell"), `effect` (Name oder ID), `speed`, `intensity`, `palette`, `segment`, `transition` (Sekunden), `raw` (WLED-JSON direkt).
Eigene Szene anlegen, z.B. zum Lesen:
```
curl -s -X PUT http://playbot.local:8090/api/scenes/lesen -H 'Content-Type: application/json' \
-d '{"label": "Lesen", "description": "Warmes, helles Licht", "default": {"brightness": 80, "color": "#ffb46b"}}'
```
## Regeln
- Lampen immer über die Lichtzentrale schalten, nicht direkt an die Lampen-IP. Sonst stimmen Bestand und Szenen nicht.
- Vor dem Schalten kurz `/llms.txt` oder `/api/lamps` lesen. Lampen, die dort als OFFLINE stehen, haben keinen Strom und lassen sich nicht schalten.
- Szenen merken sich das Licht vor der ersten Szene. Erst `restore`, dann gilt wieder der normale Zustand.
- Kino-Automatik: Beamer oder Fernseher am playbot angesteckt → Szene `kino` (8 % warmes Orange). Touchscreen wieder dran oder HDMI ab → Licht zurück.
- Master-Fader (`GET/PUT /api/master`): Helligkeit, Haupt- und Zweitfarbe. Szene `stimmung` schaltet alles damit ein; eigene Szenen nutzen die Platzhalter `"master"`, `"haupt"`, `"zweit"`.
- Nebelmaschine und Hazer laufen auch mit WLED, sind in der Lichtzentrale als geschützt markiert und werden nie geschaltet.
## TouchDesigner
Sendet TouchDesigner per sACN an eine Lampe, überdeckt das alle HTTP-Befehle. Prüfen:
```
curl -s http://192.168.178.126/json/info | grep -o '"live":[a-z]*'
```
Bei `"live":true` den Skill `touchdesigner-lampe` verwenden (`bash /Users/robertrapp/projects/kinector/td/lampe.sh`).
## Geräte und Orte
- playbot (Raspberry Pi 3B): 192.168.178.145. Steuerung der Anzeigemodi unter http://playbot.local. Lichtzentrale auf Port 8090 als Dienst `lichtzentrale`.
- birne6: 192.168.178.126, ESP8266, WLED 0.14.4, 1 LED RGB+CCT, Presets "Hell", "Rot fade", "Colorloop".
- Weitere WLEDs (100-W-RGB-Lampe mit ESP32, GLED-01, 72-LED-Kette auf .114, waveboard auf .165) tauchen automatisch auf, sobald sie Strom haben. Die Lichtzentrale sucht alle 10 Minuten.
- Code: /Users/robertrapp/Documents/rpi-video-empfaenger, Gitea rorapp/lichtereizimmer.
## Fehler
- `No route to host` vom Mac aus: macOS blockiert dem aufrufenden Programm das lokale Netz (Systemeinstellungen → Datenschutz & Sicherheit → Lokales Netzwerk). `curl` im Terminal funktioniert.
- `playbot.local` löst nicht auf: IP 192.168.178.145 verwenden.
- Lichtzentrale antwortet nicht: `ssh playbot@192.168.178.145 'systemctl status lichtzentrale'`.
+23
View File
@@ -0,0 +1,23 @@
#!/bin/sh
# Gibt die Adresse der erreichbaren Lichtzentrale aus: zuerst playbot (Pi), sonst das Handy (WLED-App):
# feste Adresse in der Fritz!Box, dann mDNS. Unterwegs erreicht der Mac playbot über das Tailnet (rpi.ts.robbis.space).
# Andere Pi-Adressen zum Testen: LZ_PI_URLS="http://... http://..." finden.sh
for url in ${LZ_PI_URLS:-http://playbot.local:8090 http://192.168.178.145:8090 http://rpi.ts.robbis.space:8090} \
${LZ_HANDY_URLS:-http://lichtzentrale-handy.fritz.box:8090}; do
if curl -s -m 2 -o /dev/null -w '%{http_code}' "$url/api/version" | grep -q 200; then
echo "$url"; exit 0
fi
done
# Handy: dns-sd beendet sich nicht von selbst, darum nach 3 Sekunden abbrechen
tmp=$(mktemp)
dns-sd -L lichtzentrale-handy _lichtzentrale._tcp local. > "$tmp" 2>/dev/null &
pid=$!
sleep 3
kill "$pid" 2>/dev/null; wait "$pid" 2>/dev/null
target=$(grep -o 'reached at [^ ]*' "$tmp" | head -1 | sed 's/reached at //; s/\.:/:/')
rm -f "$tmp"
if [ -n "$target" ] && curl -s -m 3 -o /dev/null -w '%{http_code}' "http://$target/api/version" | grep -q 200; then
echo "http://$target"; exit 0
fi
echo "Keine Lichtzentrale erreichbar (weder playbot noch Handy)" >&2
exit 1
@@ -0,0 +1,130 @@
---
name: touchdesigner-lampe
description: Steuert Lampen ueber TouchDesigner (TD) im Projekt kinector. Verwende diesen Skill bei Anfragen zu TouchDesigner, TD, Kinect-Steuerung, sACN/DMX-Szenen, Pulsieren oder Effekten aus TD, und immer dann, wenn TD gerade per sACN an eine Lampe sendet (/json/info der Lampe zeigt "live": true). Solange TD sendet, Farben nie per HTTP setzen, sondern ueber TouchDesigner. Fuer normales Licht ohne laufendes TD (an/aus, Helligkeit, Farbe, Presets, Szenen wie Kino) gilt der Skill lichtzentrale.
version: 1.0.0
author: Robert Rapp
license: MIT
platforms: [macos]
metadata:
hermes:
tags: [touchdesigner, td, lampe, licht, farbe, effekt, wled, dmx, sacn, kinect]
related_skills: [kinect-visualization, lichtzentrale]
---
# Lampensteuerung über TouchDesigner
## Wann dieser Skill, wann die Lichtzentrale
Dieser Skill gilt, wenn TouchDesigner im Spiel ist: TD, Kinect, sACN-Szenen über alle Lampen, oder wenn
eine Lampe gerade Echtzeitdaten von TD bekommt (`curl -s http://<lampen-ip>/json/info` zeigt `"live":true`).
Für normales Licht ohne laufendes TD (an/aus, Helligkeit, Farbe, Presets, Szenen wie Kino, Licht zurück)
nimm den Skill `lichtzentrale` (http://playbot.local:8090).
## Wiedereinstieg
Wenn du den Faden verloren hast, führe **diesen einen Befehl** aus:
```
bash /Users/robertrapp/projects/kinector/td/lampe.sh
```
Er zeigt dir alle Befehle und den aktuellen Zustand der Lampe. Mehr brauchst
du nicht. Lies keine Dateien, um dich zu orientieren.
## Was du tust
Du steuerst eine Lampe über TouchDesigner. Dein einziges Werkzeug ist das
Skript `td/lampe.sh` im Verzeichnis `/Users/robertrapp/projects/kinector`.
## Befehle
```
bash td/lampe.sh alle Befehle und der aktuelle Zustand
bash td/lampe.sh status nur der aktuelle Zustand
bash td/lampe.sh farbe 255 0 0 Farbe setzen, drei Zahlen von 0 bis 255
bash td/lampe.sh puls 15 85 10 Helligkeit pulsiert 15% bis 85% in 10 Sekunden
bash td/lampe.sh pulsaus Puls anhalten
bash td/lampe.sh an Lampe empfängt
bash td/lampe.sh aus Lampe empfängt nicht mehr
bash td/lampe.sh kinect Kinect steuert die Farbe
bash td/lampe.sh fest feste Farbe statt Kinect
bash td/lampe.sh effekt Farbe und Helligkeit wandern von selbst
bash td/lampe.sh speichern Projekt sichern
```
Die LED-Kette (72 Pixel) ist ein zweites Gerät mit eigenen Befehlen:
```
bash td/lampe.sh kette Zustand der Kette
bash td/lampe.sh kette an Kette empfängt
bash td/lampe.sh kette aus Kette empfängt nicht mehr
bash td/lampe.sh kette farbe 255 0 0 0 0 255 Verlauf von Farbe A nach Farbe B
bash td/lampe.sh kette tempo 6 Sekunden je Umlauf
```
Die Szene läuft über **alle** Lampen gleichzeitig. Sie schaltet die anderen
Ausgänge selbst ab, damit nicht zwei Quellen an dieselbe Lampe senden:
```
bash td/lampe.sh szene Zustand der Szene
bash td/lampe.sh szene an Szene auf alle Lampen
bash td/lampe.sh szene aus Szene aus
bash td/lampe.sh szene locate alle gefundenen Pixel weiß
bash td/lampe.sh szene locate aus Locate beenden
bash td/lampe.sh szene farbe 25 12 76 255 90 12 Grundfarbe, dann Sekundärfarbe
bash td/lampe.sh szene helligkeit 25 Grundhelligkeit in Prozent
bash td/lampe.sh szene warmweiss 40 Warmweiß beimischen, Prozent
bash td/lampe.sh szene puls 6 4 7 Anstieg, Halten, Abfall in Sekunden
bash td/lampe.sh szene pause 14 Pause zwischen den Pulsen
bash td/lampe.sh szene versatz 8 Versatz je Lampe in Sekunden
bash td/lampe.sh szene farbwechsel 8 wann die Farbe wechselt, Prozent
bash td/lampe.sh szene komplementaer 100 Stärke des Zonen-Farbversatzes
bash td/lampe.sh szene zonentest Zonen prüfen: je Zone eine Signalfarbe
bash td/lampe.sh szene zonentest aus Zonentest beenden
bash td/lampe.sh szene kurve 2.2 2.2 Dimmkurve, Pulsanhebung
bash td/lampe.sh szene saettigung 100 Sättigung in Prozent
```
Grundhelligkeit meint die **wahrgenommene** Helligkeit, nicht das
Tastverhältnis. Die Dimmkurve rechnet das um. Höheres Gamma heißt: unten
feiner, oben flacher.
`halten` ist die Zeit, in der die Sekundärfarbe wirklich voll ansteht.
`farbwechsel` klein zu halten sorgt dafür, dass der Farbton schon gewechselt
hat, bevor die Lampe hell wird — sonst sieht man den Zwischenton (bei Blau
nach Orange ein Magenta) im hellsten Moment.
Welche Lampen es gibt und wie viele Pixel sie haben, steht in `FIXTURES.md`.
Die Wandlampe (`.165`) ist in drei Zonen geteilt: hinten links, hinten rechts,
vorne. Die vordere Zone leuchtet in der **Komplementärfarbe** der hinteren.
`komplementaer 0` hebt das auf, `100` ist die volle halbe Umdrehung im
Farbkreis.
## Regeln
1. **Benutze nur diese Befehle.** Kein `curl`, keine HTTP-Anfragen an die
Lampe, kein eigener Code, keine Dateien lesen oder schreiben. Anfragen
direkt an die Lampe antworten zwar `{"success":true}`, ändern aber nichts,
weil TouchDesigner Vorrang hat.
2. Ein Befehl, dann seine Ausgabe lesen, dann der nächste.
3. Für eine feste Farbe zuerst `fest`, sonst überschreibt die Kinect sie.
4. Damit man etwas sieht, muss `an` gesetzt sein.
5. `Ausgabe jetzt RGB` im Status ist der Wert, der wirklich an der Lampe
ankommt. Im Effekt- und Kinect-Modus ändert er sich laufend — zweimal
`status` hintereinander zeigt verschiedene Werte, das ist richtig so.
6. Kommt `FEHLER:`, sage es dem Benutzer und halte an. Repariere nichts selbst.
7. Gibt es für einen Wunsch keinen Befehl, sage das.
## Beispiel
Aufgabe: "Mach die Lampe rot und lass sie zwischen 20 und 90 Prozent alle
8 Sekunden pulsieren."
```
bash td/lampe.sh fest
bash td/lampe.sh farbe 255 0 0
bash td/lampe.sh puls 20 90 8
bash td/lampe.sh an
bash td/lampe.sh status
```
@@ -0,0 +1,123 @@
---
name: touchdesigner-lampe
description: Steuert die Lampe ueber TouchDesigner (TD) im Projekt kinector. Verwende dieses Skill bei jeder Anfrage zu TouchDesigner, TD, Lampe, Licht, Farbe, Helligkeit, Pulsieren, Effekt oder Kinect-Steuerung. Enthaelt alle verfuegbaren Befehle. Setze Farben niemals per HTTP an die Lampe, sondern immer ueber TouchDesigner.
version: 1.0.0
author: Robert Rapp
license: MIT
platforms: [macos]
metadata:
hermes:
tags: [touchdesigner, td, lampe, licht, farbe, effekt, wled, dmx, sacn, kinect]
related_skills: [kinect-visualization]
---
# Lampensteuerung über TouchDesigner
## Wiedereinstieg
Wenn du den Faden verloren hast, führe **diesen einen Befehl** aus:
```
bash /Users/robertrapp/projects/kinector/td/lampe.sh
```
Er zeigt dir alle Befehle und den aktuellen Zustand der Lampe. Mehr brauchst
du nicht. Lies keine Dateien, um dich zu orientieren.
## Was du tust
Du steuerst eine Lampe über TouchDesigner. Dein einziges Werkzeug ist das
Skript `td/lampe.sh` im Verzeichnis `/Users/robertrapp/projects/kinector`.
## Befehle
```
bash td/lampe.sh alle Befehle und der aktuelle Zustand
bash td/lampe.sh status nur der aktuelle Zustand
bash td/lampe.sh farbe 255 0 0 Farbe setzen, drei Zahlen von 0 bis 255
bash td/lampe.sh puls 15 85 10 Helligkeit pulsiert 15% bis 85% in 10 Sekunden
bash td/lampe.sh pulsaus Puls anhalten
bash td/lampe.sh an Lampe empfängt
bash td/lampe.sh aus Lampe empfängt nicht mehr
bash td/lampe.sh kinect Kinect steuert die Farbe
bash td/lampe.sh fest feste Farbe statt Kinect
bash td/lampe.sh effekt Farbe und Helligkeit wandern von selbst
bash td/lampe.sh speichern Projekt sichern
```
Die LED-Kette (72 Pixel) ist ein zweites Gerät mit eigenen Befehlen:
```
bash td/lampe.sh kette Zustand der Kette
bash td/lampe.sh kette an Kette empfängt
bash td/lampe.sh kette aus Kette empfängt nicht mehr
bash td/lampe.sh kette farbe 255 0 0 0 0 255 Verlauf von Farbe A nach Farbe B
bash td/lampe.sh kette tempo 6 Sekunden je Umlauf
```
Die Szene läuft über **alle** Lampen gleichzeitig. Sie schaltet die anderen
Ausgänge selbst ab, damit nicht zwei Quellen an dieselbe Lampe senden:
```
bash td/lampe.sh szene Zustand der Szene
bash td/lampe.sh szene an Szene auf alle Lampen
bash td/lampe.sh szene aus Szene aus
bash td/lampe.sh szene locate alle gefundenen Pixel weiß
bash td/lampe.sh szene locate aus Locate beenden
bash td/lampe.sh szene farbe 25 12 76 255 90 12 Grundfarbe, dann Sekundärfarbe
bash td/lampe.sh szene helligkeit 25 Grundhelligkeit in Prozent
bash td/lampe.sh szene warmweiss 40 Warmweiß beimischen, Prozent
bash td/lampe.sh szene puls 6 4 7 Anstieg, Halten, Abfall in Sekunden
bash td/lampe.sh szene pause 14 Pause zwischen den Pulsen
bash td/lampe.sh szene versatz 8 Versatz je Lampe in Sekunden
bash td/lampe.sh szene farbwechsel 8 wann die Farbe wechselt, Prozent
bash td/lampe.sh szene komplementaer 100 Stärke des Zonen-Farbversatzes
bash td/lampe.sh szene zonentest Zonen prüfen: je Zone eine Signalfarbe
bash td/lampe.sh szene zonentest aus Zonentest beenden
bash td/lampe.sh szene kurve 2.2 2.2 Dimmkurve, Pulsanhebung
bash td/lampe.sh szene saettigung 100 Sättigung in Prozent
```
Grundhelligkeit meint die **wahrgenommene** Helligkeit, nicht das
Tastverhältnis. Die Dimmkurve rechnet das um. Höheres Gamma heißt: unten
feiner, oben flacher.
`halten` ist die Zeit, in der die Sekundärfarbe wirklich voll ansteht.
`farbwechsel` klein zu halten sorgt dafür, dass der Farbton schon gewechselt
hat, bevor die Lampe hell wird — sonst sieht man den Zwischenton (bei Blau
nach Orange ein Magenta) im hellsten Moment.
Welche Lampen es gibt und wie viele Pixel sie haben, steht in `FIXTURES.md`.
Die Wandlampe (`.165`) ist in drei Zonen geteilt: hinten links, hinten rechts,
vorne. Die vordere Zone leuchtet in der **Komplementärfarbe** der hinteren.
`komplementaer 0` hebt das auf, `100` ist die volle halbe Umdrehung im
Farbkreis.
## Regeln
1. **Benutze nur diese Befehle.** Kein `curl`, keine HTTP-Anfragen an die
Lampe, kein eigener Code, keine Dateien lesen oder schreiben. Anfragen
direkt an die Lampe antworten zwar `{"success":true}`, ändern aber nichts,
weil TouchDesigner Vorrang hat.
2. Ein Befehl, dann seine Ausgabe lesen, dann der nächste.
3. Für eine feste Farbe zuerst `fest`, sonst überschreibt die Kinect sie.
4. Damit man etwas sieht, muss `an` gesetzt sein.
5. `Ausgabe jetzt RGB` im Status ist der Wert, der wirklich an der Lampe
ankommt. Im Effekt- und Kinect-Modus ändert er sich laufend — zweimal
`status` hintereinander zeigt verschiedene Werte, das ist richtig so.
6. Kommt `FEHLER:`, sage es dem Benutzer und halte an. Repariere nichts selbst.
7. Gibt es für einen Wunsch keinen Befehl, sage das.
## Beispiel
Aufgabe: "Mach die Lampe rot und lass sie zwischen 20 und 90 Prozent alle
8 Sekunden pulsieren."
```
bash td/lampe.sh fest
bash td/lampe.sh farbe 255 0 0
bash td/lampe.sh puls 20 90 8
bash td/lampe.sh an
bash td/lampe.sh status
```
@@ -0,0 +1,91 @@
# Gradient Effect on WLED (fx=46)
For additional WLED instances beyond the primary TouchDesigner complex (e.g., 192.168.178.114 with 72 WS28x LEDs):
## Setting the Gradient Effect
```bash
# Set gradient effect via WLED JSON API
curl -s -m 5 -X POST "http://<WLED_IP>/json/state" \
-H 'Content-Type: application/json' \
-d '{"fx":46,"seg":0,"bri":255,"on":true,"pal":<palette_index>}'
```
- `fx`: 46 = Gradient effect
- `seg`: 0 = first segment
- `bri`: 255 = full brightness
- `on`: true = turn on
- `pal`: palette index (0-71 for WLED 0.14.4)
## Color Palette
The `pal` parameter selects from 72 built-in palettes. For purple-to-black gradient:
- `pal`: 0 (verified: black→purple→black gradient)
- Other palette values 1-71 produce different color transitions
## Adding Custom Colors
```json
{"fx":46,"seg":0,"bri":255,"on":true,"pal":0,"col":[[0,0,0],[128,0,128],[0,0,0]]}
```
- `col`: Array of [R,G,B,W] color segments (max 3 segments for gradient)
- First color = start (black [0,0,0])
- Middle color = transition point (purple [128,0,128])
- Last color = end (black [0,0,0])
## Verified Working Commands
```bash
# Purple gradient on 72-LED chain at 192.168.178.114 (standalone, not TouchDesigner controlled)
curl -s -m 5 -X POST "http://192.168.178.114/json/state" \
-H 'Content-Type: application/json' \
-d '{"fx":46,"seg":0,"bri":255,"on":true,"pal":0}'
```
## TouchDesigner Integration (PRIMARY - do NOT override via WLED API)
For the primary TouchDesigner complex (COMP /project1/kinect_led):
1. Use `bash td/lampe.sh fest` to enable Overlay
2. Use `bash td/lampe.sh farbe 128 0 128` to set purple RGB via TouchDesigner
3. Use `bash td/lampe.sh effekt` to activate internal TouchDesigner effects
4. Check `bash td/lampe.sh status` for current state
**CRITICAL:** The `pal` parameter in TouchDesigner's Overlay section controls the WLED palette index **only when TouchDesigner is NOT sending sACN**. When Enable=True and sACN is active, TouchDesigner overrides any direct WLED API changes.
## WLED as sACN Receiver Only
The WLED lamps (birne6.local at 192.168.178.126, or 192.168.178.114 with 72 WS28x) serve **exclusively as sACN/E1.31 receivers** when TouchDesigner is running:
- TouchDesigner COMP `/project1/kinect_led` → sACN → WLED(s)
- WLED JSON API (`/json/state`, `/json/cfg`) is **disabled/ignored** during active sACN transmission
- `live:true` in WLED info means it's in DMX/E1.31 mode — JSON colors have no effect
- To set colors on birne6.local: use `bash td/lampe.sh farbe R G B` (TouchDesigner)
- To set gradient on standalone WLED instance: use WLED API, but this does NOT affect the TouchDesigner sACN output
## Separate WLED Instances (independent of TouchDesigner)
If a second WLED chain (192.168.178.114, 72 WS28x) should run its own gradient independently:
```bash
# Only if TouchDesigner sACN is NOT active, or for standalone operation:
curl -s -m 5 -X POST "http://192.168.178.114/json/state" \
-H 'Content-Type: application/json' \
-d '{"fx":46,"seg":0,"bri":255,"on":true,"pal":0}'
```
This does NOT interfere with the TouchDesigner project's sACN output to birne6.local.
## Status Verification
Always run `bash td/lampe.sh status` before and after any WLED command to confirm:
- Current Source (sim/freenect/kinect/osc)
- Overlay status (an/aus)
- Pulse settings (min-max-period)
- Output RGB values (what's actually being sent)
- DMX send enabled (an/aus)
**Beware:** `Output jetzt RGB` in the status reflects the actual sACN output — it may differ from what WLED displays internally when in live/DMX mode.
@@ -0,0 +1,189 @@
---
name: kinect-visualization
description: Use Xbox Kinect (or compatible depth cameras) for visualization, interactive installations, and creative coding projects. Covers detection, driver setup, data extraction, and integration with platforms like Touchdesigner, Unity, and Python.
version: 1.0.0
author: Hermes Agent
license: MIT
platforms: [linux, macos, windows]
metadata:
hermes:
tags: [kinect, visualization, depth-camera, touchdesigner, creative-coding]
related_skills: [systematic-debugging, plan]
---
# Xbox Kinect Visualization Skill
## Overview
This skill covers setting up, detecting, and extracting data from an Xbox Kinect (or compatible depth camera) for use in visualization projects, interactive installations, and creative coding. The Kinect provides RGB video, depth data, audio, and skeleton tracking.
## Device Detection
### macOS
The Xbox Kinect connects via USB and is identified as:
```
Product: Xbox NUI Sensor
Vendor: Microsoft
USB Vendor ID: 0x045E (1118)
USB Product ID: 0x02C4 (708)
Device appears as: Xbox NUI Sensor@02210000 in system profiler
```
**Verify detection:**
```bash
system_profiler SPUSBDataType
```
Or via Python:
```python
import usb.core
dev = usb.core.find(idVendor=0x045E, idProduct=0x02C4)
if dev:
print('Kinect found!')
print('Address:', dev.address)
```
### Windows
Similar USB IDs. Install [libfreenect2](https://github.com/libfreenect2/libfreenect2) or [OpenNI2](https://openni.org/) drivers.
### Linux
`libfreenect2`, `OpenNI2`, or direct `libusb` access.
## Driver Options
### 1. OpenNI2 + SensorKinect (Touchdesigner compatible)
**macOS:** Install OpenNI2 framework and SensorKinect driver for the Xbox Kinect.
**Touchdesigner:** The built-in Kinect CHOP will detect the device once OpenNI2/SensorKinect is installed.
### 2. libfreenect / libfreenect2 (OpenKinect)
**Cross-platform:** `brew install libfreenect2` (macOS) or system package managers (Linux/Windows).
**Python:** `pip install pykinect2` or `pip install openni2`.
### 3. Touchdesigner Built-in Kinect CHOP
In Touchdesigner: `Touch → External Commands → Kinect CHOP`.
Select the device when prompted. Requires OpenNI2/SensorKinect drivers on macOS.
## Data Extraction
### Python (usb.core + libusb)
```python
import usb.core
import usb.util
dev = usb.core.find(idVendor=0x045E, idProduct=0x02C4)
if dev is None:
print('Kinect not found')
exit(1)
# Detach kernel driver if active
if dev.is_kernel_driver_active(0):
dev.detach_kernel_driver(0)
# Set configuration
dev.set_configuration()
# Claim interface 0
usb.util.claim_interface(dev, 0)
# Read from endpoint (example - find the right endpoint)
cfg = dev.get_configuration()
for intf in cfg.interfaces():
for alt in intf.altsettings:
for ep in alt.endpoints:
direction = 'IN' if usb.util.endpoint_direction(ep.bEndpointAddress) == usb.util.ENDPOINT_IN else 'OUT'
print(f'EP: {hex(ep.bEndpointAddress)} dir={direction} maxpkt={ep.wMaxPacketSize}')
```
### Touchdesigner CHOP Parameters
- **Device:** Select the Kinect device
- **Frame Rate:** 30fps (video), 30fps (depth)
- **Output Channels:** Red, Green, Blue, Depth
- **Skeleton Tracking:** If using OpenNI2
## Creative Coding Integration
### Touchdesigner
1. Add Kinect CHOP to your network
2. Connect to TOP/CHOP/SOP components for visualization
3. Use depth data for particle systems, 3D mappings, or interactive surfaces
4. Use video feed for texturing or background removal
### Unity
Use the [Kinect Unity Plugin](https://github.com/Kinect/Unity-Kinect) or [OpenNI2 Unity Integration](https://github.com/occipital/openni-unity).
### Python / Processing / OpenFrameworks
- `pykinect2` or `openni2` for Python
- `ofxKinect` for openFrameworks
- KinectToe plugin for Touchdesigner
## Troubleshooting
### Common Issues
1. **Device not found** — Verify USB connection, IDs (0x045E/0x02C4), and that the device is powered.
2. **Kernel driver active** — Detach kernel driver: `dev.detach_kernel_driver(0)` before claiming interface.
3. **Touchdesigner can't see device** — Install OpenNI2 + SensorKinect drivers on macOS. Without these, the Kinect CHOP won't list the device.
4. **Depth data looks wrong** — Ensure correct camera mode (near mode vs. wide mode). Some Kinect models have different depth ranges.
5. **USB bandwidth issues** — Try connecting the Kinect directly to the computer (not through a hub), especially for Kinect v2.
### Error Patterns
| Error | Cause | Fix |
|-------|-------|-----|
| `ValueError: Device not found` | Wrong vendor/product IDs | Verify `idVendor=0x045E, idProduct=0x02C4` |
| `USBError: Could not detach kernel driver` | Kernel driver holding interface | Use `dev.detach_kernel_driver(0)` or run with appropriate permissions |
| `Kinect CHOP shows no device` | Missing OpenNI2/SensorKinect drivers | Install OpenNI2 framework and SensorKinect driver |
| `Depth data is all zeros` | Wrong camera mode or setup | Check Kinect model and mode settings |
## Support Files
This skill is packaged with support files in the following directories:
- `references/kinect-ids.md` — Condensed device IDs, USB descriptors, and interface layouts
- `references/troubleshooting-kinect.md` — Error transcripts, reproduction recipes, provider quirks
- `references/freenecttd-plugin.md` — FreenectTD plugin installation guide for TouchDesigner macOS (new)
- `scripts/probe-kinect.py` — Deterministic probe script that enumerates Kinect endpoints and validates communication
To add a new support file, use `skill_manage` with `file_path` starting `references/` or `scripts/`. The skill's SKILL.md will automatically gain a pointer to the new file.
## Related Skills
- `systematic-debugging` — For debugging Kinect connection or data issues
- `plan` — For planning Kinect integration projects
## Version History
| Version | Date | Changes |
|---------|------|---------|
| 1.0.0 | — | Initial release — detection, drivers, data extraction, and integration patterns |
## References
- Xbox Kinect Technical Specifications
- OpenNI2 Framework Documentation
- libfreenect2 Project
- Touchdesigner Kinect CHOP Documentation
- Microsoft Kinect SDK (legacy)
<!-- Keep this skill curator-managed. Do not hand-edit. -->
@@ -0,0 +1,44 @@
# FreenectTD Plugin for TouchDesigner macOS
**Source**: https://github.com/stosumarte/FreenectTD
**Latest version**: v1.0.1
**Purpose**: Enables Xbox Kinect usage with TouchDesigner on macOS without requiring OpenNI2 framework (which has download issues at openni.org)
## Installation
1. Download the latest FreenectTOP.zip from the releases tab:
```
https://github.com/stosumarte/FreenectTD/releases/latest/download/FreenectTOP.zip
```
2. Unzip and copy `FreenectTOP.plugin` to TouchDesigner's plugin folder:
```
/Users/<username>/Library/Application Support/Derivative/TouchDesigner099/Plugins
```
3. Show hidden files in Finder if needed: `⌘⇧.`
4. Restart TouchDesigner — FreenectTOP will appear under the "Custom" OPs panel
## Usage
**Output indexes**:
- Index 0: RGB stream
- Index 1: Depth map
- Index 2: IR stream
- Index 3: Point cloud map
**Example usage**: Drag FreenectTOP into your network. By default it outputs RGB. Use Render Select TOP with index 1 for depth, index 2 for IR.
## Notes
- Only one Kinect device per machine is supported
- Only one FreenectTD OP can be active at a time
- Works with Kinect V1 and V2
- Alternative: Use the installer from releases (FreenectTOP_[version]_Installer.pkg) for simpler installation
## Troubleshooting
- If plugin doesn't appear: Ensure TouchDesigner is closed and restarted after copying the plugin
- If Kinect not detected: Verify USB connection and that `system_profiler SPUSBDataType` shows Xbox NUI Sensor
- Only one Kinect per machine supported
@@ -0,0 +1,62 @@
#!/usr/bin/env python3
"""Probe script for Xbox Kinect device detection and endpoint enumeration."""
import usb.core
import usb.util
VENDOR_ID = 0x045E
PRODUCT_ID = 0x02C4
def main():
print("=== Kinect USB Probe ===")
dev = usb.core.find(idVendor=VENDOR_ID, idProduct=PRODUCT_ID)
if dev is None:
print("❌ Kinect not found via USB")
print(" - Verify Kinect is connected")
print(" - Check USB cable and port")
return 1
print(f"✅ Kinect found at address: {dev.address}")
print(f" Vendor ID: 0x{VENDOR_ID:04x} ({dev.idVendor})")
print(f" Product ID: 0x{PRODUCT_ID:04x} ({dev.idProduct})")
print(f" bcdDevice: {dev.bcd_device}")
# Try to set configuration
try:
dev.set_configuration()
print("✅ Configuration set successfully")
except usb.core.USBError as e:
print(f"⚠️ Could not set configuration: {e}")
# Claim interface 0
try:
usb.util.claim_interface(dev, 0)
print("✅ Interface 0 claimed successfully")
except usb.core.USBError as e:
print(f"⚠️ Could not claim interface 0: {e}")
# Enumerate configurations and interfaces
cfg = dev.get_configuration()
print(f"
Configuration: {cfg.bConfigurationValue}")
for intf in cfg.interfaces():
print(f"
Interface: {intf.bInterfaceNumber}")
print(f" Subclass: {intf.bInterfaceSubclass}")
print(f" Protocol: {intf.bInterfaceProtocol}")
for alt in intf.altsettings:
print(f" Alternate Setting: {alt.bAlternateSetting}")
for ep in alt.endpoints:
direction = 'IN' if usb.util.endpoint_direction(ep.bEndpointAddress) == usb.util.ENDPOINT_IN else 'OUT'
print(f" EP {hex(ep.bEndpointAddress)}: {direction}, maxpacket: {ep.wMaxPacketSize}")
# Release interface
usb.util.release_interface(dev, 0)
print("
✅ Probe complete - interface released")
return 0
if __name__ == "__main__":
exit(main())
+131
View File
@@ -0,0 +1,131 @@
---
name: strato-server-tasks
description: Execute post-breach tasklist on Strato server haslach2025.
version: 0.1.0
author: Hermes
platforms: [macos]
metadata:
hermes:
tags:
- Strato
- Server
- Tasklist
- Devops
---
# strato-server-tasks
Execute a defined post-breach tasklist on the Strato server (haslach2025/mindboost infrastructure) via SSH. This skill assumes the passphrase-protected SSH key at `~/Documents/Zertifikate/haslach_privat` is already loaded into `ssh-agent`.
## When to Use
- User provides a task list for the Strato server (haslach2025) and requests execution
- Tasks involve Docker containers, Traefik, Nextcloud, invoiceninja, Laravel, or PHP version management
- SSH key `haslach_privat` is loaded and server `85.215.56.185` is accessible
## Prerequisites
- ssh-agent running with `haslach_privat` key loaded (passphrase provided by user)
- Server `85.215.56.185` reachable as `root@85.215.56.185`
- Docker and docker-compose installed on the server
- Access to `/opt/containers/` directory tree on the server
- Traefik dynamic config at `/var/log/traefik/dynamic_conf.yml` and backup at `/var/log/traefik/dynamic_conf.yml.bak-20261022`
## How to Run
Invoke through the `terminal` tool. Each task is executed as a separate SSH command sequence. Example workflow:
```bash
# Task 1: Nextcloud
ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null root@85.215.56.185 <<'EOF'
cd /opt/containers/nextcloud_mindboost
docker compose up -d nextcloud-app-mindboost
# Wait 1-2 min for self-update from 32.0.6 to 32.0.15
EOF
# Task 2: invoiceninja
ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null root@85.215.56.185 <<'EOF'
cd "$(docker inspect invoiceninja-in-app-1 --format '{{index .Config.Labels "com.docker.compose.project.working_dir"}}')"
docker compose pull && docker compose up -d
EOF
# Task 3: Laravel-Backend (build in Jenkins first with CLEAN_BUILD=true)
# Then on server:
ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null root@85.215.56.185 <<'EOF'
cd /opt/containers/Repositories && docker compose pull && docker compose up -d
cd /opt/containers/Repositories/staging
# Update image tag from sha256-9aeddeb… to sha256-5049884533f12b82d28eae03a5f8647182d0f56a
sed -i 's/sha256-9aeddeb.*/sha256-5049884533f12b82d28eae03a5f8647182d0f56a/' docker-compose.yml
docker compose pull && docker compose up -d
EOF
# Task 4: lichterei-web
# Build in Jenkins first (pushes :0.0.1 tag)
# Then on server:
ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null root@85.215.56.185 <<'EOF'
cd /opt/containers/lichtereiweb
# Update docker-compose.yml :latest to :0.0.1 (sed replacement)
sed -i 's/:latest/:0.0.1/' docker-compose.yml
docker compose pull && docker compose up -d
EOF
# Task 5: Traefik 2.10 → v2.11.60
ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null root@85.215.56.185 <<'EOF'
cd /opt/containers/traefik-crowdsec-stack
export SERVICES_TRAEFIK_IMAGE_VERSION=v2.11.60
docker compose up -d traefik
docker rm traefik-update-helper; rm docker-compose.yml.bak-20261022
EOF
# Task 6: Kontrolle - PHP version check
ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null root@85.215.56.185 <<'EOF'
docker exec <container> php -v
# Expected: 8.2.35 / 8.3.36 bzw. Ubuntu-Paket 8.3.6-0ubuntu0.24.04.13
EOF
# Task 7: Cleanup dynamic_conf.yml
ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null root@85.215.56.185 <<'EOF'
# Remove php2shell-* routers and body-limit-* middlewares from /dynamic_conf.yml
# Backup already exists at /var/log/traefik/dynamic_conf.yml.bak-20261022
grep -v 'php2shell-' /var/log/traefik/dynamic_conf.yml > /tmp/dynamic_conf.yml.tmp
grep -v 'body-limit-' /tmp/dynamic_conf.yml.tmp > /var/log/traefik/dynamic_conf.yml
rm /tmp/dynamic_conf.yml.tmp
EOF
```
## Quick Reference
- `ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null root@85.215.56.185` — connect to Strato server
- Docker compose commands: `cd <dir> && docker compose up -d <service>`
- `sed -i 's/old/new/' file` — replace image tags in docker-compose.yml
- `grep -v 'pattern' file` — remove lines from config
## Procedure
1. Verify ssh-agent is running with the `haslach_privat` key loaded
2. Execute Task 1: Nextcloud self-update (cd /opt/containers/nextcloud_mindboost && docker compose up -d nextcloud-app-mindboost)
3. Execute Task 2: invoiceninja update (cd working_dir && docker compose pull && docker compose up -d)
4. Execute Task 3: Laravel-Backend — build in Jenkins with CLEAN_BUILD=true, then on server: cd /opt/containers/Repositories && docker compose up -d, update image tag via sed, docker compose up -d
5. Execute Task 4: lichterei-web — ensure Jenkins pushed :0.0.1 tag, then on server: cd /opt/containers/lichtereiweb, sed :latest to :0.0.1, docker compose pull && up -d
6. Execute Task 5: Traefik upgrade — cd /opt/containers/traefik-crowdsec-stack, set SERVICES_TRAEFIK_IMAGE_VERSION=v2.11.60 in .env, docker compose up -d traefik, rm traefik-update-helper, rm docker-compose.yml.bak-20261022
7. Execute Task 6: PHP version check — docker exec <container> php -v (expect 8.2.35 / 8.3.36 / 8.3.6-0ubuntu0.24.04.13)
8. Execute Task 7: Cleanup — remove php2shell-* and body-limit-* entries from /var/log/traefik/dynamic_conf.yml (backup at .bak-20261022 already exists)
## Pitfalls
- Wrong SSH passphrase — key won't load, all commands fail
- Docker compose file syntax errors — validate before running
- Image tag mismatches — ensure correct SHA or tag values
- Traefik dynamic_conf.yml — incorrect removal of routers/middlewares breaks routing
- Jenkins pipeline must produce correct tags (:0.0.1 for lichterei-web, sha256-... for Laravel)
- Nextcloud self-update takes 1-2 minutes; do not interrupt
## Verification
```bash
# Check PHP version on any container
docker exec <container> php -v
# Verify running containers
docker ps
# Test Traefik routing
curl -s http://localhost/ # should route correctly after cleanup
# Confirm task completion — user specifies next steps
```
This should return expected PHP version and confirm all 7 tasks completed successfully.
---\n*Skill captures the complete post-breach tasklist for Strato server haslach2025/mindboost infrastructure. Tasks cover Nextcloud, invoiceninja, Laravel-Backend, lichterei-web, Traefik upgrade, PHP version control, and Traefik dynamic config cleanup. All commands framed for SSH execution via the `terminal` tool with the pre-loaded haslach_privat key.*", "name": "strato-server-tasks"}
+96
View File
@@ -0,0 +1,96 @@
---
name: tts-routing
description: Route TTS notes/reminders through Hermes-Agent.
version: 1.0.0
author: Robert Rapp
license: MIT
platforms: [macos, linux]
metadata:
hermes:
tags: [tts, routing, notes, reminders]
related_skills: [hermes-agent]
---
# TTS Routing and Note Management
## Triggers
**Use when** processing TTS output, note creation (`notiz` form), or reminder commands that need Hermes-Agent routing with profile context.
## Overview
This skill governs how TTS-generated content, notes, and reminders are routed through the Hermes-Agent system. Key patterns:
### 1. Note/Reminder Routing via forms.yaml
The `notiz` form in `voice/forms.yaml` controls how notes/reminders are processed:
- **`backend: direct`** — bypasses Hermes-Agent entirely; server saves note locally via `voice/notes.py` only; response goes directly to Thinking Proxy
- **`backend: hermes`** — routes through Hermes-Agent using the configured `hermes_profile`; note still saved server-side, but confirmation flows through Hermes with profile SOUL.md, memory, and skills available
**Fix**: Change `notiz.backend` from `direct` to `hermes` to enable Hermes routing.
### 2. Cron Job for Time-Based Reminders with Telegram Push
Create a daily cron job that checks if today is the target day (e.g., Friday) and sends a Telegram push notification with the reminder content using Waltraut-Lichter formatting.
**Setup** (job created in this session):
- Job ID: `a760cba172ea`
- Schedule: every 1d at 09:32
- Delivers to origin chat
- Next run: Friday 16.10.2026 at 09:32
### 3. User Preferences
- **Telegram push preferred** over simple notes for reminders
- **Waltraut-Lichter*** formatting for correct Telegram message style
- **Battery constraint**: Batties are small battery-based LED lights (WLED controlled via playbot)
- **Lamp control**: ONLY via `bash td/lampe.sh farbe R G B` when TouchDesigner is running sACN; otherwise use Lichtzentrale
### 4. Note Storage
Notes are stored in `~/.hermes/notes/` as Markdown files with timestamp filenames (`YYYY-MM-DD_HHMMSS.md`). Each file contains:
- Header: `# Sprachnotiz DD.MM.YYYY HH:MM`
- Body: the user's note text
### 5. Routing Workflow
```mermaid
flowchart TD
A[User says: "Erinner mich..." or "Mach eine Notiz..."]
B[run_turn classifies form]
C{form.backend}
D[backend: hermes → route to {HERMES}/p/{profile}/v1/chat/completions]
E[backend: direct → save via voice/notes.py only]
F[Hermes uses voice-notiz profile SOUL.md]
G[Save note to ~/.hermes/notes/]
H[Telegram push via cron job if scheduled]
C --> D & E
D --> F & G
E --> G
G --> H
```
## Pitfalls & Gotchas
- ⚠️ **Do not set `backend: direct`** for `notiz` form — this bypasses Hermes-Agent and means no profile context, memory, or skills are available in the response
- ⚠️ **TouchDesigner sACN overlay**: If TouchDesigner sends sACN to a lamp (`/json/info` shows `"live": true`), HTTP commands to WLED are invisible; use `touchdesigner-lampe` skill instead
- ⚠️ **WLED via Lichtzentrale**: Always switch lights via `curl -s http://playbot.local:8090/llms.txt` first to check status and scenes; never switch directly by IP
- ⚠️ **Cron job delivery**: Jobs run in fresh session with no chat context; prompts must be self-contained
- ⚠️ **Credential redaction**: All API keys, tokens, passwords must be [REDACTED] — never retain real values
- ⚠️ **Note file format**: `~/.hermes/notes/*.md`; read newest first; filename = `YYYY-MM-DD_HHMMSS.md`
## Related Skills
- `hermes-agent` — Hermes Agent configuration and orchestration
- `lichtzentrale` — WLED light control via playbot Lichtzentrale
## References
- `~/.hermes/notes/` — stored notes (Markdown, timestamped); 18 files found as of 15.10.2026
- `voice/forms.yaml` — form definitions including `notiz` backend; **updated 15.10.2026: backend changed from `direct` to `hermes`** to route through Hermes-Agent
- `hermes-profiles/voice-notiz/` — profile with SOUL.md, config.yaml for Hermes routing
- Cron job `a760cba172ea` — daily Friday reminder with Telegram push; created 15.10.2026, runs at 09:32, next run Friday 16.10.2026
- `voice/notes.py` — handles note saving to `~/.hermes/notes/`
- `voice/profiles.py` — profile management for voice forms
",
@@ -0,0 +1,104 @@
# TTS Routing Summary
## Session: 2026-10-15 (CEST, UTC+02:00)
## User: Robbi (/Users/robertrapp)
## Key Changes Made
### 1. forms.yaml — `notiz` backend changed from `direct` to `hermes`
**File**: `/Users/robertrapp/tts/voice/forms.yaml`
**Before**:
```yaml
notiz:
hermes_profile: voice-notiz
backend: direct # braucht keine Hermes-Tools mehr (Server speichert selbst); spart ~1,4 s
max_tokens: 60
action: notiz # Server speichert die Notiz selbst (voice/notes.py), das Profil bestätigt nur
immediate: [ack_ja]
stall_after_s: [3.0]
```
**After**:
```yaml
notiz:
hermes_profile: voice-notiz
backend: hermes # Routing über Hermes-Agent: Profil-Gedächtnis und Skills; spart ~1,4 s Hermes-Overhead umgegangen
max_tokens: 60
action: notiz # Server speichert die Notiz selbst (voice/notes.py), das Profil bestätigt nur
immediate: [ack_ja]
stall_after_s: [3.0]
```
**Impact**: Notes/reminders now route through Hermes-Agent with profile SOUL.md, memory, and skills instead of bypassing Hermes entirely.
### 2. Cron Job — Friday reminder with Telegram push
**Job ID**: `a760cba172ea`
**Schedule**: Every 1d at 09:32 CEST
**Next run**: Friday 16.10.2026 at 09:32
**Deliver**: origin (this Telegram DM)
**Prompt**: Checks if today is Friday; if yes, sends Telegram push with reminder content using Waltraut-Lichter formatting.
**Reminder content**: "mich am Freitag daran erinnern, dass ich zu Waldrottlicht eine Nebelmaschine und zwei Buddys mitbring"
### 3. New Skill: `tts-routing`
**Location**: `/Users/robertrapp/.hermes/skills/tts-routing/SKILL.md`
Governs how TTS output, notes, and reminders are routed through Hermes-Agent. Includes:
- Trigger conditions and overview
- Note/reminder routing via forms.yaml (direct vs hermes)
- Cron job setup for time-based reminders with Telegram push
- User preferences (Telegram push vs notes, Waltraut-Lichter formatting, battery constraints)
- Note storage format (`~/.hermes/notes/*.md`)
- Pitfalls and gotchas
- Related skills and references
## Notes Directory
**Location**: `~/.hermes/notes/`
Files are Markdown with timestamp filenames (`YYYY-MM-DD_HHMMSS.md`):
- Header: `# Sprachnotiz DD.MM.YYYY HH:MM`
- Body: user's note text
Example newest note (`2026-10-15_091308.md`):
```
# Sprachnotiz 15.10.2026 09:13
Kannst du mir bitte eine Notiz machen oder mich am Freitag daran erinnern, dass ich zu Waldrottlicht eine Nebelmaschine und zwei Buddys mitbringen kann?
```
## User Preferences Embedded
- **Telegram push preferred** over simple notes for reminders
- **Waltraut-Lichter*** formatting for correct Telegram message style
- **Battery constraint**: Batties are small battery-based LED lights (WLED controlled via playbot)
- **Lamp control**: ONLY via `bash td/lampe.sh farbe R G B` when TouchDesigner is running sACN; otherwise use Lichtzentrale
- **Credential redaction**: All API keys, tokens, passwords must be [REDACTED] — never retain real values
## Pitfalls & Gotchas
- ⚠️ **Do not set `backend: direct`** for `notiz` form — bypasses Hermes-Agent, no profile context/memory/skills
- ⚠️ **TouchDesigner sACN overlay**: If TouchDesigner sends sACN (`/json/info` shows `"live": true`), HTTP commands to WLED are invisible; use `touchdesigner-lampe` skill
- ⚠️ **WLED via Lichtzentrale**: Always switch via `curl -s http://playbot.local:8090/llms.txt` first; never direct IP
- ⚠️ **Cron job delivery**: Jobs run in fresh session with no chat context; prompts must be self-contained
- ⚠️ **Note file format**: `~/.hermes/notes/*.md`; read newest first; filename = `YYYY-MM-DD_HHMMSS.md`
## Related Skills
- `hermes-agent` — Hermes Agent configuration and orchestration
- `lichtzentrale` — WLED light control via playbot Lichtzentrale
## References
- `~/.hermes/notes/` — stored notes (Markdown, timestamped); 18 files found as of 15.10.2026, newest: `2026-10-15_091308.md` with Friday reminder about Waldrottlicht (Nebelmaschine + 2 Buddys)
- `voice/forms.yaml` — form definitions including `notiz` backend; **updated 15.10.2026: backend changed from `direct` to `hermes`** to route through Hermes-Agent with profile context, memory, and skills
- `hermes-profiles/voice-notiz/` — profile with SOUL.md, config.yaml for Hermes routing; model: nemotron-3.5-lightning-off, provider: custom, base_url: http://127.0.0.1:8082/v1
- Cron job `a760cba172ea` — daily Friday reminder with Telegram push; created 15.10.2026, runs at 09:32 CEST, next run Friday 16.10.2026 at 09:32, delivers to origin chat
- `voice/notes.py` — handles note saving to `~/.hermes/notes/`
- `voice/profiles.py` — profile management for voice forms
- `voice/forms.yaml` `notiz` form: `backend: hermes` now routes LLM request to `{HERMES}/p/voice-notiz/v1/chat/completions` with `model: "hermes-agent"` and `Authorization: Bearer ***`