mirror of
https://github.com/randybb/esphome-configs.git
synced 2026-12-06 09:06:52 +01:00
The display runs the ptaru/nspanel-terminal TFT and ESPHome draws the UI with LVGL (component from a local checkout for now, see PR ptaru/nspanel-terminal#1). Pages: home (clock, weather, forecast, temperatures), lights, outside, irrigation, thermostat, gate, status/boot screen; light detail with brightness, colour temperature or hue on long press. Grid tiles come from packages in common/nspanel_terminal/ that add themselves to a page. Unavailable entities are greyed out, OTA progress shows on the status page, sleep dim and the notify/show_info actions match the other panels.
51 lines
1.4 KiB
YAML
51 lines
1.4 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. Uses the dimmed global, the panel display and ${dim_brightness}.
|
|
# packages:
|
|
# sleep_dim: !include
|
|
# file: common/nspanel_terminal/sleep_dim.yaml
|
|
# vars:
|
|
# sleep_override_entity: light.bedroom_lights
|
|
globals:
|
|
# brightness the on_idle dim goes to
|
|
- id: idle_brightness
|
|
type: int
|
|
initial_value: ${dim_brightness}
|
|
|
|
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
|