From 686f2e59894c9590ac63568928b8057ca1a18886 Mon Sep 17 00:00:00 2001 From: oskar Date: Wed, 21 Jan 2026 17:51:02 +0100 Subject: [PATCH] night mode instead of time boundries --- AGENTS.md | 36 +++++++++++++++++++++++++++++++ automations.yaml | 56 +++++++++++++++++++++++++++--------------------- 2 files changed, 68 insertions(+), 24 deletions(-) create mode 100644 AGENTS.md diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 0000000..f61ff7b --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,36 @@ +# Repository Guidelines + +## Project Structure & Module Organization +- Root-level YAML files define the Home Assistant configuration. +- Core configuration: `configuration.yaml`. +- Automations: `automations.yaml`. +- Scripts: `scripts.yaml`. +- Scenes: `scenes.yaml`. +- Groups: `groups.yaml`. +- Devices: `known_devices.yaml`. +- Secrets: `secrets.yaml` (do not commit real secrets; use placeholders). + +## Build, Test, and Development Commands +- No build step is defined in this repository. +- Use Home Assistant’s built-in config validation before deployment (UI: Settings → System → Check configuration). +- If you use the HA CLI, run `ha core check` to validate configs. + +## Coding Style & Naming Conventions +- YAML: 2-space indentation, no tabs. +- Keep keys ordered logically by feature area within each file. +- Use clear, descriptive IDs and aliases for automations/scripts (e.g., `alias: "Lights - Evening On"`). +- Prefer lowercase with underscores for IDs and file references. + +## Testing Guidelines +- No automated test suite is present. +- Validate changes with Home Assistant configuration check before applying. +- Spot-check automations and scripts after reload. + +## Commit & Pull Request Guidelines +- Commit messages in history are short and imperative (e.g., `update automations`). +- Keep commits focused to a single area (automations, scripts, scenes, etc.). +- For PRs, include a concise summary and mention any UI-level checks you performed. + +## Security & Configuration Tips +- Store credentials in `secrets.yaml`; reference them with `!secret`. +- Avoid committing device-specific tokens or external service keys. diff --git a/automations.yaml b/automations.yaml index 094fd6f..bfdf62c 100644 --- a/automations.yaml +++ b/automations.yaml @@ -333,9 +333,10 @@ minutes: 10 seconds: 0 conditions: - - condition: time - after: 06:35:00 - before: '23:25:00' + - condition: state + entity_id: input_boolean.night_mode + state: + - 'on' actions: - data: topic: dom/pimirror @@ -352,9 +353,10 @@ domain: binary_sensor trigger: device conditions: - - condition: time - after: 06:30:00 - before: '23:30:00' + - condition: state + entity_id: input_boolean.night_mode + state: + - 'on' actions: - data: topic: dom/pimirror @@ -807,9 +809,10 @@ type: is_playing - condition: or conditions: - - condition: time - after: '23:30:00' - before: 06:30:00 + - condition: state + entity_id: input_boolean.night_mode + state: + - 'on' - condition: state entity_id: input_boolean.sleep_mode state: @@ -1301,9 +1304,10 @@ device_id: 5243fe178006af9adee15bacfc9bcadc entity_id: de7a9e40d544ab51409925618ef14deb domain: binary_sensor - - condition: time - after: 06:30:00 - before: '23:30:00' + - condition: state + entity_id: input_boolean.night_mode + state: + - 'on' actions: - type: turn_on device_id: f5ccc59a8b469ac7dbdf23f714d93c05 @@ -2006,9 +2010,10 @@ hours: 0 minutes: 0 seconds: 1 - - condition: time - after: 06:30:00 - before: '23:30:00' + - condition: state + entity_id: input_boolean.night_mode + state: + - 'on' actions: - target: entity_id: light.led3xdrv_led_pwm_2 @@ -2047,9 +2052,10 @@ entity_id: input_boolean.sleep_mode state: - 'off' - - condition: time - after: 06:30:00 - before: '23:30:00' + - condition: state + entity_id: input_boolean.night_mode + state: + - 'on' - type: is_occupied condition: device device_id: 5243fe178006af9adee15bacfc9bcadc @@ -2358,9 +2364,10 @@ - minutes: / 3 trigger: time_pattern conditions: - - condition: time - after: '23:30:00' - before: 06:30:00 + - condition: state + entity_id: input_boolean.night_mode + state: + - 'on' - condition: state entity_id: input_boolean.on_leave state: 'off' @@ -3359,9 +3366,10 @@ hours: 0 minutes: 10 seconds: 0 - - condition: time - after: 08:00:00 - before: '13:00:00' + - condition: state + entity_id: input_boolean.night_mode + state: + - 'on' - condition: device device_id: 2e779a3bc4caf93c7ef04bebf820db5e domain: media_player