diff --git a/haos/CLAUDE.md b/haos/CLAUDE.md deleted file mode 100644 index f7513eb..0000000 --- a/haos/CLAUDE.md +++ /dev/null @@ -1,191 +0,0 @@ -# Home Assistant REST API - -## Connection - -- **Base URL**: `http://:8123/api/` -- **Auth header**: `Authorization: Bearer ` -- **Token**: Generate at `http://:8123/profile` → Long-Lived Access Tokens -- **Response format**: JSON (except `/api/error_log` which is plaintext) - -Store token in env var, never hardcode: -```bash -export HA_TOKEN="your_token_here" -export HA_URL="http://:8123" -``` - -## Status Codes - -| Code | Meaning | -|------|---------| -| 200 | Success (existing resource) | -| 201 | Created (new resource) | -| 400 | Bad request | -| 401 | Unauthorized | -| 404 | Not found | -| 405 | Method not allowed | - -## GET Endpoints - -```bash -# Health check -GET /api/ - -# Current HA configuration -GET /api/config - -# Loaded components -GET /api/components - -# All entity states -GET /api/states - -# Specific entity state -GET /api/states/ - -# Available services -GET /api/services - -# Available events -GET /api/events - -# Error log (plaintext) -GET /api/error_log - -# Camera image -GET /api/camera_proxy/ - -# All calendar entities -GET /api/calendars - -# Calendar events (start and end are required ISO timestamps) -GET /api/calendars/?start=&end= - -# Historical state changes -GET /api/history/period/?filter_entity_id= -# Optional params: end_time, minimal_response, no_attributes, significant_changes_only - -# Logbook entries -GET /api/logbook/ -# Optional params: entity=, end_time= -``` - -## POST Endpoints - -```bash -# Create or update entity state (virtual, not device) -POST /api/states/ -{"state": "on", "attributes": {"brightness": 255}} - -# Fire an event -POST /api/events/ -{"optional": "event_data"} - -# Call a service -POST /api/services// -{"entity_id": "light.living_room"} - -# Call service and get its response -POST /api/services//?return_response -{"entity_id": "..."} - -# Render a Jinja2 template -POST /api/template -{"template": "{{ states('sensor.temperature') }}"} - -# Validate configuration -POST /api/config/core/check_config - -# Handle an intent -POST /api/intent/handle -{"name": "HassTurnOn", "data": {"name": "lights"}} -``` - -## DELETE Endpoints - -```bash -# Remove an entity -DELETE /api/states/ -``` - -## Example curl Usage - -```bash -# Health check -curl -s -H "Authorization: Bearer $HA_TOKEN" $HA_URL/api/ - -# Get all states -curl -s -H "Authorization: Bearer $HA_TOKEN" $HA_URL/api/states | jq . - -# Get specific entity -curl -s -H "Authorization: Bearer $HA_TOKEN" $HA_URL/api/states/light.living_room - -# Turn on a light -curl -s -X POST \ - -H "Authorization: Bearer $HA_TOKEN" \ - -H "Content-Type: application/json" \ - -d '{"entity_id": "light.living_room"}' \ - $HA_URL/api/services/light/turn_on - -# Render template -curl -s -X POST \ - -H "Authorization: Bearer $HA_TOKEN" \ - -H "Content-Type: application/json" \ - -d '{"template": "{{ states(\"sensor.temperature\") }}"}' \ - $HA_URL/api/template -``` - -## Devices - -### Lights -4x Zigbee Tuya lights (TZ3210 TS0505B): -- `light.tz3210_r5afgmkl_ts0505b` (G2) -- `light.tz3210_r5afgmkl_ts0505b_g2` (G22) -- `light.tz3210_r5afgmkl_ts0505b_2` -- `light.tz3210_r5afgmkl_ts0505b_3` - -Support: color_temp (2000-6535K), xy color mode, brightness (0-254) - -### Vacuum Cleaner -**Entity**: `vacuum.xiaomi_ru_1173505785_ov71gl` (Петя Петя) -**Status**: Docked -**Type**: Xiaomi robot vacuum with mop - -**Rooms** (from `sensor.xiaomi_ru_1173505785_ov71gl_room_information_p_2_16`): -- ID 4: Спальня (Bedroom) -- ID 3: Гостиная (Living Room) -- ID 5: Кухня (Kitchen) -- ID 6: Прихожая (Hallway) -- ID 7: Ванная комната (Bathroom) - -**Services**: -- `vacuum.start` — Start cleaning -- `vacuum.pause` — Pause -- `vacuum.stop` — Stop -- `vacuum.return_to_base` — Dock -- `vacuum.clean_spot` — Clean spot -- `vacuum.set_fan_speed` — Set fan (param: `fan_speed`) -- `vacuum.send_command` — Raw command (params: `command`, `params`) -- Room-aware: `start_vacuum_room_sweep`, `start_zone_sweep`, `get_room_configs`, `set_room_clean_configs` - -**Key attributes**: -- `sensor.xiaomi_ru_1173505785_ov71gl_room_information_p_2_16` — Room data (JSON) -- `sensor.xiaomi_ru_1173505785_ov71gl_zone_ids_p_2_12` — Zone IDs -- `button.xiaomi_ru_1173505785_ov71gl_auto_room_partition_a_10_5` — Auto-detect room boundaries - -### Water Leak Sensors -3x HOBEIAN ZG-222Z Zigbee moisture sensors: -- `binary_sensor.hobeian_zg_222z` — Kitchen -- `binary_sensor.hobeian_zg_222z_2` — Bathroom -- `binary_sensor.hobeian_zg_222z_3` — Laundry - -Battery sensors: `sensor.hobeian_zg_222z_battery`, `_2`, `_3` - -**Automations** (push to Zabbix via `rest_command`): -- "Water Leak Alert" (`water_leak_alert`) — any sensor ON → `rest_command.zabbix_water_leak` with room name -- "Water Leak Clear" (`water_leak_clear`) — all sensors OFF → `rest_command.zabbix_water_leak_clear` - -## Notes - -- `POST /api/states/` creates a virtual state representation only — it does NOT control physical devices. Use `POST /api/services/...` for actual device control. -- Timestamp format: `YYYY-MM-DDThh:mm:ssTZD` (ISO 8601) -- Using `?return_response` on a service that doesn't support it returns a 400 error diff --git a/windows/docker-compose.yml b/windows/docker-compose.yml deleted file mode 100644 index 39b4ceb..0000000 --- a/windows/docker-compose.yml +++ /dev/null @@ -1,28 +0,0 @@ -services: - windows: - image: dockurr/windows - container_name: windows - environment: - VERSION: "tiny11" - RAM_SIZE: "2G" - CPU_CORES: "2" - DISK_SIZE: "64G" - USERNAME: "alvis" - PASSWORD: "alvis" - LANGUAGE: "English" - REGION: "en-US" - KEYBOARD: "en-US" - devices: - - /dev/kvm - - /dev/net/tun - cap_add: - - NET_ADMIN - ports: - - "8006:8006" - - "3389:3389/tcp" - - "3389:3389/udp" - volumes: - - /mnt/ssd/dbs/windows/storage:/storage - - /mnt/misc/qbittorrent/downloads:/data - restart: unless-stopped - stop_grace_period: 2m diff --git a/zabbix/.env b/zabbix/.env deleted file mode 100644 index 3737340..0000000 --- a/zabbix/.env +++ /dev/null @@ -1,12 +0,0 @@ -# Zabbix web frontend -WEB_PORT=81 -PHP_TZ=Europe/Amsterdam - -# Agent -AGENT_HOSTNAME=Zabbix server - -# PostgreSQL -POSTGRES_DATA_DIR=/mnt/ssd/dbs/zabbix -POSTGRES_USER=zabbix -POSTGRES_PASSWORD=fefwG11UAFfs110 -POSTGRES_DB=zabbix diff --git a/zabbix/docker-compose.yml b/zabbix/docker-compose.yml deleted file mode 100644 index 122f21f..0000000 --- a/zabbix/docker-compose.yml +++ /dev/null @@ -1,100 +0,0 @@ -services: - postgres-server: - image: postgres:16-alpine - restart: unless-stopped - volumes: - - ${POSTGRES_DATA_DIR}:/var/lib/postgresql/data - environment: - POSTGRES_USER: ${POSTGRES_USER} - POSTGRES_PASSWORD: ${POSTGRES_PASSWORD} - POSTGRES_DB: ${POSTGRES_DB} - networks: - - database - stop_grace_period: 1m - - zabbix-server: - image: zabbix/zabbix-server-pgsql:ubuntu-7.4-latest - restart: unless-stopped - ports: - - "10051:10051" - extra_hosts: - - "haos.alogins.net:192.168.1.3" - environment: - DB_SERVER_HOST: postgres-server - DB_SERVER_PORT: 5432 - POSTGRES_USER: ${POSTGRES_USER} - POSTGRES_PASSWORD: ${POSTGRES_PASSWORD} - POSTGRES_DB: ${POSTGRES_DB} - volumes: - - /etc/localtime:/etc/localtime:ro - ulimits: - nproc: 65535 - nofile: - soft: 20000 - hard: 40000 - depends_on: - - postgres-server - networks: - - database - - backend - - frontend - stop_grace_period: 30s - - zabbix-web: - image: zabbix/zabbix-web-apache-pgsql:ubuntu-7.4-latest - restart: unless-stopped - ports: - - "${WEB_PORT}:8080" - environment: - ZBX_SERVER_HOST: zabbix-server - ZBX_SERVER_PORT: 10051 - DB_SERVER_HOST: postgres-server - DB_SERVER_PORT: 5432 - POSTGRES_USER: ${POSTGRES_USER} - POSTGRES_PASSWORD: ${POSTGRES_PASSWORD} - POSTGRES_DB: ${POSTGRES_DB} - PHP_TZ: ${PHP_TZ} - volumes: - - /etc/localtime:/etc/localtime:ro - healthcheck: - test: ["CMD", "curl", "-f", "http://localhost:8080/ping"] - interval: 1m30s - timeout: 3s - retries: 3 - start_period: 40s - start_interval: 5s - depends_on: - - postgres-server - - zabbix-server - networks: - - database - - backend - - frontend - stop_grace_period: 10s - - zabbix-agent: - image: zabbix/zabbix-agent:ubuntu-7.4-latest - restart: unless-stopped - environment: - ZBX_HOSTNAME: ${AGENT_HOSTNAME} - ZBX_SERVER_HOST: zabbix-server - ZBX_SERVER_ACTIVE: zabbix-server - volumes: - - /etc/localtime:/etc/localtime:ro - privileged: true - pid: host - depends_on: - - zabbix-server - networks: - - backend - stop_grace_period: 5s - -networks: - frontend: - driver: bridge - backend: - driver: bridge - internal: true - database: - driver: bridge - internal: true