mirror of
https://github.com/randybb/esphome-configs.git
synced 2026-12-06 09:06:52 +01:00
The shared UI (home, light detail, status/boot page, notifications, OTA progress, display hardware) moves from mcu-nspanel-dev.yaml into common/nspanel_terminal/panel.yaml. office-r, patio, fireplace, office-j and bedroom move from nspanel_lovelace to it with the pages, tiles and buttons of their former cards. thermostat.yaml carries its page and takes an id prefix, so a panel can have more than one (fireplace). The thermostat returns to the HA target 5 s after sending, in case HA rejects the change. Idle timeout 15 s.
45 lines
1.3 KiB
YAML
45 lines
1.3 KiB
YAML
---
|
|
# nspanel-terminal version of common/nspanel_sleep_dim.yaml: the idle (dimmed) brightness drops to 0 at night
|
|
# (sun below -6°), unless the room light is on. Sets the idle_brightness global of panel.yaml (${dim_brightness} or 0).
|
|
# packages:
|
|
# sleep_dim: !include
|
|
# file: common/nspanel_terminal/sleep_dim.yaml
|
|
# vars:
|
|
# sleep_override_entity: light.bedroom_lights
|
|
script:
|
|
- id: apply_sleep_dim
|
|
then:
|
|
- lambda: |-
|
|
bool day = id(sun_id).is_above_horizon(-6);
|
|
id(idle_brightness) = id(sleep_override).state == "on" || day ? ${dim_brightness} : 0;
|
|
if (id(dimmed))
|
|
id(panel).request_brightness(id(idle_brightness));
|
|
|
|
time:
|
|
- id: !extend ha_time
|
|
on_time_sync:
|
|
- script.execute: apply_sleep_dim
|
|
|
|
text_sensor:
|
|
# sleepOverride; text, not binary: a binary sensor drops "unavailable"
|
|
- platform: homeassistant
|
|
id: sleep_override
|
|
entity_id: ${sleep_override_entity}
|
|
internal: true
|
|
on_value:
|
|
- script.execute: apply_sleep_dim
|
|
|
|
sun:
|
|
id: sun_id
|
|
time_id: ha_time
|
|
latitude: 48.15°
|
|
longitude: 17.11°
|
|
on_sunrise:
|
|
- elevation: -6°
|
|
then:
|
|
- script.execute: apply_sleep_dim
|
|
on_sunset:
|
|
- elevation: -6°
|
|
then:
|
|
- script.execute: apply_sleep_dim
|