Files
esphome-configs/mcu-nspanel-office-j.yaml
T
randy 203fc5e26d nspanel_terminal: heating icons on the home page
A row of state icons above today's weather, filled by packages (the first
one on the right):
- fireplace_icon.yaml: the fireplace burning or out.
- radiator_icon.yaml: per thermostat; disabled while it does not call for
  heat, off while it does but the off-peak tariff has the boiler hard off and
  the fireplace is out, on while it heats.
Both hide outside the heating season (boiler switch off, fireplace out).
2026-10-31 23:33:27 +01:00

111 lines
5.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-office-j
name: Office J NSPanel
area: Office J
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_office_j_temperature
ntc_reference_temperature: 22°C
first_page: page_office
last_page: page_thermostat
sleep_dim: !include
file: common/nspanel_terminal/sleep_dim.yaml
vars:
sleep_override_entity: light.office_j_lights
# Grid page tiles: each package adds its tile to the page and fills it in this order
# Janko
l_office: !include {file: common/nspanel_terminal/light_tile.yaml, vars: {page: page_office, id: l_office, name: "Svetlo", entity: light.mcu_nspanel_office_j_light, icon: "\U000F091D", dim: false, kmin: 0, hs: false}}
l_bedside: !include {file: common/nspanel_terminal/light_tile.yaml, vars: {page: page_office, id: l_bedside, name: "Nočná lampa", entity: light.bedside_left, icon: "\U000F06B5", dim: true, kmin: 1700, hs: true}}
# Brána, robot -> page_gate_auto
gate_open: !include {file: common/nspanel_terminal/action_tile.yaml, vars: {page: page_gate, id: gate_open, name: "Otvoriť", icon: "\U000F116A", action: button.press, entity: button.mcu_gate_open}}
gate_close: !include {file: common/nspanel_terminal/action_tile.yaml, vars: {page: page_gate, id: gate_close, name: "Zatvoriť", icon: "\U000F0299", action: button.press, entity: button.mcu_gate_close}}
gate_spacer: !include {file: common/nspanel_terminal/spacer_tile.yaml, vars: {page: page_gate}}
gate: !include {file: common/nspanel_terminal/gate.yaml, vars: {page: page_gate, state: select.mcu_gate_state}}
gate_auto: !include {file: common/nspanel_terminal/nav_tile.yaml, vars: {page: page_gate, to: page_gate_auto, icon: "\U000F06A9"}}
gate_auto_open: !include {file: common/nspanel_terminal/switch_tile.yaml, vars: {page: page_gate_auto, id: gate_auto_open, name: "Auto-otváranie", entity: switch.mcu_gate_auto_open, icon: "\U000F1169", domain: switch}}
gate_auto_close: !include {file: common/nspanel_terminal/switch_tile.yaml, vars: {page: page_gate_auto, id: gate_auto_close, name: "Auto-zatváranie", entity: switch.mcu_gate_auto_close, icon: "\U000F17F7", domain: switch}}
# Kúrenie
thermo: !include {file: common/nspanel_terminal/thermostat.yaml, vars: {id: thermo, page: page_thermostat, title: "Kúrenie - Janko", prev: page_gate, next: page_status, entity: climate.bt_trv_office_j}}
# home page icons, right to left
i_fire: !include common/nspanel_terminal/fireplace_icon.yaml
i_radiator: !include {file: common/nspanel_terminal/radiator_icon.yaml, vars: {id: i_radiator, entity: climate.bt_trv_office_j}}
# 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_office, title: "Janko", prev: page_home, next: page_gate, skip: false}}
- <<: !include {file: common/nspanel_terminal/grid_page.yaml, vars: {id: page_gate, title: "Brána", prev: page_office, next: page_thermostat, skip: false}}
- <<: !include {file: common/nspanel_terminal/grid_page.yaml, vars: {id: page_gate_auto, title: "Automatizácia brány", prev: page_gate, next: page_gate, skip: true}}
binary_sensor:
# both buttons show the Janko 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_office
- script.execute: wake_screen
- platform: gpio
name: Right Button
pin:
number: 27
inverted: true
on_click:
- homeassistant.action:
action: light.toggle
data:
entity_id: light.bedside_left
- lvgl.page.show: page_office
- script.execute: wake_screen
output:
- id: relay_1
platform: gpio
pin:
number: 22
# - id: relay_2
# platform: gpio
# pin:
# number: 19
light:
- platform: binary
name: Light
id: light_1
output: relay_1
restore_mode: RESTORE_DEFAULT_OFF