{"id":31584408,"url":"https://github.com/notcoffee418/power_control_center","last_synced_at":"2026-05-31T22:32:01.883Z","repository":{"id":316864082,"uuid":"1065146011","full_name":"NotCoffee418/power_control_center","owner":"NotCoffee418","description":"Automated system for managing airconditioning system using IR remote ESP32 devices, smart meter and solar inverter reader and a PIR detector.","archived":false,"fork":false,"pushed_at":"2026-01-06T18:21:42.000Z","size":3132,"stargazers_count":0,"open_issues_count":1,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-01-08T19:09:54.684Z","etag":null,"topics":["airconditioning","automation","esp32"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/NotCoffee418.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-27T06:23:38.000Z","updated_at":"2026-01-02T14:09:30.000Z","dependencies_parsed_at":"2025-09-28T14:45:32.693Z","dependency_job_id":"2452a68b-dbba-4cf7-bc6d-2573cb6cf9b7","html_url":"https://github.com/NotCoffee418/power_control_center","commit_stats":null,"previous_names":["notcoffee418/power_control_center"],"tags_count":16,"template":false,"template_full_name":null,"purl":"pkg:github/NotCoffee418/power_control_center","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NotCoffee418%2Fpower_control_center","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NotCoffee418%2Fpower_control_center/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NotCoffee418%2Fpower_control_center/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NotCoffee418%2Fpower_control_center/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NotCoffee418","download_url":"https://codeload.github.com/NotCoffee418/power_control_center/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NotCoffee418%2Fpower_control_center/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33752286,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-31T02:00:06.040Z","response_time":95,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["airconditioning","automation","esp32"],"created_at":"2025-10-06T01:00:51.787Z","updated_at":"2026-05-31T22:32:01.877Z","avatar_url":"https://github.com/NotCoffee418.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# power-control-center\n\n\u003ca href=\"https://raw.githubusercontent.com/NotCoffee418/power_control_center/main/preview.png\"\u003e\n  \u003cimg src=\"preview.png\" alt=\"Power Control Center Dashboard\" width=\"400\"\u003e\n\u003c/a\u003e\n\u003ca href=\"https://raw.githubusercontent.com/NotCoffee418/power_control_center/main/preview2.png\"\u003e\n  \u003cimg src=\"preview2.png\" alt=\"Second Preview\" width=\"400\"\u003e\n\u003c/a\u003e\n\n## About\n\nPower Control Center is a central hub for temperature and power management in your home. It integrates with various ESP32-based devices to monitor and control air conditioning units based on temperature, power consumption, and presence detection. The system provides a unified web dashboard to monitor and manage all connected devices.\n\n## Web Dashboard\n\nThe web dashboard is accessible on port 9040 by default. For example: http://raspberrypi.local:9040\n\n## Related Repositories\n\nThis system integrates with several ESP32-based devices:\n\n1. **[esp32-ir-airco-controller](https://github.com/NotCoffee418/esp32-ir-airco-controller)** - ESP32 device with temperature sensor and IR emitter to control the airco unit. The repository includes a printable case for the device.\n\n2. **[european_smart_meter](https://github.com/NotCoffee418/european_smart_meter)** - Reads European smart meter to determine current power consumption, and reads the Huawei solar inverter.\n\n3. **[ac-pir-detector](https://github.com/NotCoffee418/ac-pir-detector)** *(optional component)* - ESP32 with PIR sensor to disable AC for a few minutes until presence is no longer detected. Intended to maintain a stable temperature near the outside AC unit while in the area. [Printable case available here](https://github.com/NotCoffee418/arbitrary-3d-models/tree/main/ac_pir_detector_case).\n\n## Installation\n\n### Quick Install (One-liner)\n\nInstall the latest release with a single command:\n\n```bash\ncurl -fsSL https://raw.githubusercontent.com/NotCoffee418/power_control_center/main/installation/install.sh | sudo bash\n```\n\n### Manual Installation\n\n1. Download the installation script:\n```bash\nwget https://raw.githubusercontent.com/NotCoffee418/power_control_center/main/installation/install.sh\nchmod +x install.sh\n```\n\n2. Run the installer:\n```bash\nsudo ./install.sh\n```\n\nThe installer will:\n- Detect your system architecture (x86_64, arm64, armv7)\n- Download the latest release binary\n- Create necessary system user and directories\n- Install the systemd service\n- Set appropriate permissions\n\n### Post-Installation Configuration\n\n1. Create a configuration file at `/etc/power_control_center/config.json`:\n```bash\nsudo nano /etc/power_control_center/config.json\n```\n\nSee the [Configuration](#configuration) section below for detailed information about all available options. You can also reference [config-example.json](config-example.json) for a complete example.\n\n2. Enable and start the service:\n```bash\nsudo systemctl enable power_control_center\nsudo systemctl start power_control_center\n```\n\n3. Check the service status:\n```bash\nsudo systemctl status power_control_center\n```\n\n4. View logs:\n```bash\nsudo journalctl -u power_control_center -f\n```\n\n### Supported Architectures\n- Linux x86_64\n- Linux ARM64 (aarch64)\n- Linux ARMv7\n\n## Files\n### Config\nConfig file must be manually created on the device, use config.example.toml as a template.  \nPath: `/etc/power_control_center/config.json`\n\n### Database\nDatabase file will be automatically created on the device, if it does not exist.  \nPath is defined in config but is quite expected to be at this path.  \nPath: `/var/lib/power_control_center/pcc.db`\n\n## API Endpoints\n\n### PIR Detection Endpoints\n\n#### POST /api/pir/detect\nRecords a PIR (motion) detection event and immediately turns off the corresponding AC device.\n\n**Query Parameters:**\n- `device` (required) - The device name (e.g., \"Veranda\")\n\n**Headers:**\n- `Authorization: ApiKey \u003cyour_pir_api_key\u003e` or `Authorization: Bearer \u003cyour_pir_api_key\u003e`\n\n**Example:**\n```bash\ncurl -X POST \"http://localhost:9040/api/pir/detect?device=Veranda\" \\\n  -H \"Authorization: ApiKey your_pir_api_key_here\"\n```\n\n**Behavior:**\n- Immediately turns off the AC for the specified device\n- Records the detection time\n- Prevents the AC from being turned back on for the configured timeout period (default: 5 minutes)\n\n#### POST /api/pir/alive\nReceives a keep-alive signal from PIR devices for monitoring purposes.\n\n**Query Parameters:**\n- `device` (optional) - The device name\n\n**Headers:**\n- `Authorization: ApiKey \u003cyour_pir_api_key\u003e` or `Authorization: Bearer \u003cyour_pir_api_key\u003e`\n\n**Example:**\n```bash\ncurl -X POST \"http://localhost:9040/api/pir/alive?device=Veranda\" \\\n  -H \"Authorization: ApiKey your_pir_api_key_here\"\n```\n\n## Configuration\n\nThe configuration file should be created at `/etc/power_control_center/config.json`. See [config-example.json](config-example.json) for a complete example.\n\n### Configuration Fields\n\n```json\n{\n    \"database_path\": \"/var/lib/power_control_center/pcc.db\",\n    \"listen_address\": \"0.0.0.0\",\n    \"listen_port\": 9040,\n    \"smart_meter_api_endpoint\": \"http://raspberrypi.local:9039\",\n    \"ac_controller_endpoints\": {\n        \"LivingRoom\": {\n            \"endpoint\": \"http://192.168.50.201\",\n            \"api_key\": \"secret123\"\n        },\n        \"Veranda\": {\n            \"endpoint\": \"http://192.168.50.202\",\n            \"api_key\": \"secret456\"\n        }\n    },\n    \"latitude\": 51.5074,\n    \"longitude\": -0.1278,\n    \"pir_api_key\": \"your_pir_api_key_here\",\n    \"pir_timeout_minutes\": 5\n}\n```\n\n#### Field Descriptions\n\n- **`database_path`**: Path to the SQLite database file. Default: `/var/lib/power_control_center/pcc.db` (recommended to keep default)\n\n- **`listen_address`**: IP address the web server will bind to. Default: `0.0.0.0` (all interfaces, recommended to keep default)\n\n- **`listen_port`**: Port number for the web dashboard. Default: `9040` (recommended to keep default)\n\n- **`smart_meter_api_endpoint`**: URL to your [european_smart_meter](https://github.com/NotCoffee418/european_smart_meter) API endpoint (e.g., `http://your-device-ip:9039`). Configure this based on how you set up the smart meter API.\n\n- **`ac_controller_endpoints`**: Object mapping room names to AC controller configurations. Each entry requires:\n  - `endpoint`: URL to the [esp32-ir-airco-controller](https://github.com/NotCoffee418/esp32-ir-airco-controller) device\n  - `api_key`: API key for the device (generated through the device's dashboard)\n\n- **`latitude`** and **`longitude`**: Geographic coordinates for your location. Used for solar calculations and automation. You can find your coordinates using Google Maps or similar services.\n\n- **`pir_api_key`**: API key for authenticating [ac-pir-detector](https://github.com/NotCoffee418/ac-pir-detector) requests. This is an arbitrary key that must match what you configured on the PIR device. (optional, defaults to empty/no auth)\n\n- **`pir_timeout_minutes`**: Number of minutes to keep AC off after PIR motion detection. Default: `5` (optional)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnotcoffee418%2Fpower_control_center","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnotcoffee418%2Fpower_control_center","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnotcoffee418%2Fpower_control_center/lists"}