Files
esphome-configs/mcu-nspanel-office-j.yaml
T
randy 271a5a5a54 nspanel: popups for OTA progress and device info, Info card on every panel
common/nspanel_popup.yaml shows a popupNotify page during OTA (written straight
to the display uart, since OTA blocks the loop that sends the component's
queued commands) and a device info popup (version, build time, IPs) from the
Info button on the new last card or the show_info API action. The OTA gets
id ota_esphome to extend it. Also documents the NSPanel pinout.
2026-09-29 23:23:14 +02:00

126 lines
3.2 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
esphome:
name: mcu-${device}
friendly_name: ${name}
area: ${area}
comment: ${comment}
packages:
common: !include common/common.yaml
nspanel: !include
file: common/nspanel.yaml
vars:
temperature_entity: sensor.zigbee_office_j_temperature
ntc_reference_temperature: 22°C
sleep_dim: !include
file: common/nspanel_sleep_dim.yaml
vars:
sleep_override_entity: light.office_j_lights
nspanel_lovelace:
cards:
- type: cardGrid
title: Janko
entities:
- name: Svetlo
entity_id: light.mcu_nspanel_office_j_light
icon: wall-sconce-flat
- name: Nočná lampa
entity_id: light.bedside_left
icon: lamp
- type: cardGrid
title: Brána
entities:
- name: Otvoriť
entity_id: button.mcu_gate_open
icon: gate-open
- name: Zatvoriť
entity_id: button.mcu_gate_close
icon: gate
- name: Automatizácia
entity_id: navigate.card_gate_automation
- type: cardThermo
title: Kúrenie
thermo_entity_id: climate.bt_trv_office_j
- type: cardEntities
title: Automatizácia
id: card_gate_automation
hidden: true
entities:
- name: Auto-otváranie
entity_id: switch.gate_auto_open
- name: Auto-zatváranie
entity_id: switch.gate_auto_close
- type: cardEntities
title: Info
entities:
- name: Zariadenie
entity_id: button.office_j_nspanel_info
icon: information-outline
binary_sensor:
- platform: gpio
name: Left Button
pin:
number: 14
inverted: true
on_click:
- light.toggle: light_1
- lambda: 'id(nspanel_id).render_default_page();'
- platform: gpio
name: Right Button
pin:
number: 27
inverted: true
on_click:
- homeassistant.action:
action: light.toggle
data:
entity_id: light.bedside_left
- lambda: 'id(nspanel_id).render_default_page();'
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
# # - platform: binary
# # name: Relay 2
# # output: relay_2