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.
103 lines
4.1 KiB
YAML
103 lines
4.1 KiB
YAML
---
|
|
# Hardware: Sonoff NSPanel (EU)
|
|
# Pinout:
|
|
# GPIO2 IO2
|
|
# GPIO4 Screen power -> Screen Power (switch gpio) (inverted)
|
|
# GPIO14 Left button -> Left Button (binary_sensor gpio) (inverted)
|
|
# GPIO16 Display UART TX -> display_uart (uart tx_pin)
|
|
# GPIO17 Display UART RX -> display_uart (uart rx_pin)
|
|
# GPIO19 Relay 2
|
|
# GPIO21 Buzzer -> buzzer_out (output ledc)
|
|
# GPIO22 Relay 1 -> relay_1 (output gpio)
|
|
# GPIO23 Relay 3 (no relay, connector)
|
|
# GPIO27 Right button -> Right Button (binary_sensor gpio) (inverted)
|
|
# GPIO37 ALS (light sensor)
|
|
# GPIO38 NTC temperature (ADC) -> ntc_source (sensor adc)
|
|
substitutions:
|
|
device: nspanel-bedroom
|
|
name: Bedroom NSPanel
|
|
name_short: Bedroom
|
|
area: Bedroom
|
|
comment: NSPanel (nspanel-terminal)
|
|
brightness: "80"
|
|
# backlight after 15 s idle
|
|
dim_brightness: "20"
|
|
|
|
esphome:
|
|
name: mcu-${device}
|
|
friendly_name: ${name}
|
|
area: ${area}
|
|
comment: ${comment}
|
|
|
|
packages:
|
|
common: !include common/common.yaml
|
|
ipv6_only: !include common/ipv6_only.yaml
|
|
panel: !include
|
|
file: common/nspanel_terminal/panel.yaml
|
|
vars:
|
|
temperature_entity: sensor.zigbee_bedroom_temperature
|
|
first_page: page_bedroom
|
|
last_page: page_thermostat
|
|
sleep_dim: !include
|
|
file: common/nspanel_terminal/sleep_dim.yaml
|
|
vars:
|
|
sleep_override_entity: light.bedroom_lights
|
|
# Grid page tiles: each package adds its tile to the page and fills it in this order
|
|
# Spálňa
|
|
s_tv: !include {file: common/nspanel_terminal/switch_tile.yaml, vars: {page: page_bedroom, id: s_tv, name: "TV", entity: switch.mcu_socket_01_relay, icon: "\U000F07F4", domain: switch}}
|
|
s_raid: !include {file: common/nspanel_terminal/switch_tile.yaml, vars: {page: page_bedroom, id: s_raid, name: "Raid", entity: switch.mcu_socket_02_relay, icon: "\U000F0C6E", domain: switch}}
|
|
s_socket_3: !include {file: common/nspanel_terminal/switch_tile.yaml, vars: {page: page_bedroom, id: s_socket_3, name: "", entity: switch.mcu_socket_03_relay, icon: "\U000F1108", domain: switch}}
|
|
l_bedroom: !include {file: common/nspanel_terminal/light_tile.yaml, vars: {page: page_bedroom, id: l_bedroom, name: "Svetlo", entity: light.mcu_nspanel_bedroom_light, icon: "\U000F091D", dim: false, kmin: 0, hs: false}}
|
|
l_lamp_right: !include {file: common/nspanel_terminal/light_tile.yaml, vars: {page: page_bedroom, id: l_lamp_right, name: "Nočná lampa J", entity: light.mcu_bedroom_lamp_right_light, icon: "\U000F06B5", dim: true, kmin: 1701, hs: true}}
|
|
l_lamp_left: !include {file: common/nspanel_terminal/light_tile.yaml, vars: {page: page_bedroom, id: l_lamp_left, name: "Nočná lampa R", entity: light.mcu_bedroom_lamp_left_light, icon: "\U000F06B5", dim: true, kmin: 1701, hs: true}}
|
|
# Kúrenie
|
|
thermo: !include {file: common/nspanel_terminal/thermostat.yaml, vars: {id: thermo, page: page_thermostat, title: "Kúrenie - Spálňa", prev: page_bedroom, next: page_status, entity: climate.bt_trv_bedroom}}
|
|
|
|
# the grid pages; home, status and light detail come from panel.yaml, thermostat pages from thermostat.yaml
|
|
lvgl:
|
|
pages:
|
|
- <<: !include {file: common/nspanel_terminal/grid_page.yaml, vars: {id: page_bedroom, title: "Spálňa", prev: page_home, next: page_thermostat, skip: false}}
|
|
|
|
binary_sensor:
|
|
# both buttons show the Spálňa page, where the change is visible
|
|
- platform: gpio
|
|
name: Left Button
|
|
pin:
|
|
number: 14
|
|
inverted: true
|
|
on_click:
|
|
- light.toggle: light_1
|
|
- lvgl.page.show: page_bedroom
|
|
- script.execute: wake_screen
|
|
|
|
- platform: gpio
|
|
name: Right Button
|
|
pin:
|
|
number: 27
|
|
inverted: true
|
|
# on_click:
|
|
# - switch.toggle: relay_2
|
|
on_click:
|
|
- homeassistant.action:
|
|
action: light.toggle
|
|
data:
|
|
entity_id: light.bedroom_lamps
|
|
- lvgl.page.show: page_bedroom
|
|
- script.execute: wake_screen
|
|
|
|
light:
|
|
- platform: binary
|
|
name: Light
|
|
id: light_1
|
|
output: relay_1
|
|
|
|
output:
|
|
- id: relay_1
|
|
platform: gpio
|
|
pin:
|
|
number: 22
|
|
# - id: relay_2
|
|
# platform: gpio
|
|
# pin:
|
|
# number: 19
|