night mode instead of time boundries #1

Open
oskar wants to merge 1 commit from feature/codex-night-refactor into main
2 changed files with 68 additions and 24 deletions

36
AGENTS.md Normal file
View file

@ -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 Assistants 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.

View file

@ -333,9 +333,10 @@
minutes: 10 minutes: 10
seconds: 0 seconds: 0
conditions: conditions:
- condition: time - condition: state
after: 06:35:00 entity_id: input_boolean.night_mode
before: '23:25:00' state:
- 'on'
actions: actions:
- data: - data:
topic: dom/pimirror topic: dom/pimirror
@ -352,9 +353,10 @@
domain: binary_sensor domain: binary_sensor
trigger: device trigger: device
conditions: conditions:
- condition: time - condition: state
after: 06:30:00 entity_id: input_boolean.night_mode
before: '23:30:00' state:
- 'on'
actions: actions:
- data: - data:
topic: dom/pimirror topic: dom/pimirror
@ -807,9 +809,10 @@
type: is_playing type: is_playing
- condition: or - condition: or
conditions: conditions:
- condition: time - condition: state
after: '23:30:00' entity_id: input_boolean.night_mode
before: 06:30:00 state:
- 'on'
- condition: state - condition: state
entity_id: input_boolean.sleep_mode entity_id: input_boolean.sleep_mode
state: state:
@ -1301,9 +1304,10 @@
device_id: 5243fe178006af9adee15bacfc9bcadc device_id: 5243fe178006af9adee15bacfc9bcadc
entity_id: de7a9e40d544ab51409925618ef14deb entity_id: de7a9e40d544ab51409925618ef14deb
domain: binary_sensor domain: binary_sensor
- condition: time - condition: state
after: 06:30:00 entity_id: input_boolean.night_mode
before: '23:30:00' state:
- 'on'
actions: actions:
- type: turn_on - type: turn_on
device_id: f5ccc59a8b469ac7dbdf23f714d93c05 device_id: f5ccc59a8b469ac7dbdf23f714d93c05
@ -2006,9 +2010,10 @@
hours: 0 hours: 0
minutes: 0 minutes: 0
seconds: 1 seconds: 1
- condition: time - condition: state
after: 06:30:00 entity_id: input_boolean.night_mode
before: '23:30:00' state:
- 'on'
actions: actions:
- target: - target:
entity_id: light.led3xdrv_led_pwm_2 entity_id: light.led3xdrv_led_pwm_2
@ -2047,9 +2052,10 @@
entity_id: input_boolean.sleep_mode entity_id: input_boolean.sleep_mode
state: state:
- 'off' - 'off'
- condition: time - condition: state
after: 06:30:00 entity_id: input_boolean.night_mode
before: '23:30:00' state:
- 'on'
- type: is_occupied - type: is_occupied
condition: device condition: device
device_id: 5243fe178006af9adee15bacfc9bcadc device_id: 5243fe178006af9adee15bacfc9bcadc
@ -2358,9 +2364,10 @@
- minutes: / 3 - minutes: / 3
trigger: time_pattern trigger: time_pattern
conditions: conditions:
- condition: time - condition: state
after: '23:30:00' entity_id: input_boolean.night_mode
before: 06:30:00 state:
- 'on'
- condition: state - condition: state
entity_id: input_boolean.on_leave entity_id: input_boolean.on_leave
state: 'off' state: 'off'
@ -3359,9 +3366,10 @@
hours: 0 hours: 0
minutes: 10 minutes: 10
seconds: 0 seconds: 0
- condition: time - condition: state
after: 08:00:00 entity_id: input_boolean.night_mode
before: '13:00:00' state:
- 'on'
- condition: device - condition: device
device_id: 2e779a3bc4caf93c7ef04bebf820db5e device_id: 2e779a3bc4caf93c7ef04bebf820db5e
domain: media_player domain: media_player