--- # 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 -> Light MAIN (switch gpio) # GPIO21 Buzzer -> buzzer_out (output ledc) # GPIO22 Relay 1 -> Outside Light Back (switch 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-patio name: Patio NSPanel area: Living Room & Kitchen comment: ${area}, Patio | 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_living_room_kitchen_temperature temperature_name: Living Room Temperature first_page: page_kitchen_living last_page: page_thermostat # Grid page tiles: each package adds its tile to the page and fills it in this order # Kuchyňa / Obývačka l_kitchen: !include {file: common/nspanel_terminal/light_tile.yaml, vars: {page: page_kitchen_living, id: l_kitchen, name: "Kuchyňa", entity: light.kitchen, icon: "\U000F0769", dim: true, kmin: 2700, hs: false}} l_dining: !include {file: common/nspanel_terminal/light_tile.yaml, vars: {page: page_kitchen_living, id: l_dining, name: "Stôl", entity: light.dining_table, icon: "\U000F0769", dim: true, kmin: 2700, hs: false}} l_living: !include {file: common/nspanel_terminal/light_tile.yaml, vars: {page: page_kitchen_living, id: l_living, name: "Gauč", entity: light.living_room, icon: "\U000F0769", dim: true, kmin: 2700, hs: false}} l_tv: !include {file: common/nspanel_terminal/light_tile.yaml, vars: {page: page_kitchen_living, id: l_tv, name: "TV", entity: light.mcu_tv_light_strip, icon: "\U000F1051", dim: true, kmin: 0, hs: false}} l_dining_amb: !include {file: common/nspanel_terminal/light_tile.yaml, vars: {page: page_kitchen_living, id: l_dining_amb, name: "(Stôl)", entity: light.dining_table_ambilight, icon: "\U000F18DE", dim: true, kmin: 1700, hs: true}} l_living_amb: !include {file: common/nspanel_terminal/light_tile.yaml, vars: {page: page_kitchen_living, id: l_living_amb, name: "(Gauč)", entity: light.living_room_ambilight, icon: "\U000F18DE", dim: true, kmin: 1700, hs: true}} # Kuchyňa l_worktop: !include {file: common/nspanel_terminal/light_tile.yaml, vars: {page: page_kitchen, id: l_worktop, name: "Linka", entity: light.worktop_lights, icon: "\U000F181C", dim: true, kmin: 2000, hs: false}} l_stove: !include {file: common/nspanel_terminal/light_tile.yaml, vars: {page: page_kitchen, id: l_stove, name: "Sporák", entity: light.mcu_kitchen_stove, icon: "\U000F04DE", dim: true, kmin: 2000, hs: false}} # Von l_patio: !include {file: common/nspanel_terminal/light_tile.yaml, vars: {page: page_outside, id: l_patio, name: "Terasa", entity: light.patio_lights, icon: "\U000F1253", dim: true, kmin: 2000, hs: false}} s_patio_socket: !include {file: common/nspanel_terminal/switch_tile.yaml, vars: {page: page_outside, id: s_patio_socket, name: "Terasa", entity: switch.mcu_patio_relay, icon: "\U000F1108", domain: switch}} s_patio_back: !include {file: common/nspanel_terminal/switch_tile.yaml, vars: {page: page_outside, id: s_patio_back, name: "Vzadu", entity: switch.mcu_nspanel_patio_outside_light_back, icon: "\U000F1987", domain: switch}} s_shed_light: !include {file: common/nspanel_terminal/switch_tile.yaml, vars: {page: page_outside, id: s_shed_light, name: "Z. domček", entity: switch.mcu_shed_light, icon: "\U000F091D", domain: switch}} s_shed_socket: !include {file: common/nspanel_terminal/switch_tile.yaml, vars: {page: page_outside, id: s_shed_socket, name: "Z. domček", entity: switch.mcu_shed_socket, icon: "\U000F1108", domain: switch}} s_garden: !include {file: common/nspanel_terminal/switch_tile.yaml, vars: {page: page_outside, id: s_garden, name: "Záhrada", entity: switch.mcu_shed_garden_light, icon: "\U000F1987", domain: switch}} # Závlaha, robot -> page_irrigation_auto v_a1: !include {file: common/nspanel_terminal/switch_tile.yaml, vars: {page: page_irrigation, id: v_a1, name: "A1", entity: switch.mcu_well_irrigation_valve_a1, icon: "\U000F1066", domain: switch}} v_a2: !include {file: common/nspanel_terminal/switch_tile.yaml, vars: {page: page_irrigation, id: v_a2, name: "A2", entity: switch.mcu_well_irrigation_valve_a2, icon: "\U000F1066", domain: switch}} v_a3: !include {file: common/nspanel_terminal/switch_tile.yaml, vars: {page: page_irrigation, id: v_a3, name: "A3", entity: switch.mcu_well_irrigation_valve_a3, icon: "\U000F1066", domain: switch}} v_a4: !include {file: common/nspanel_terminal/switch_tile.yaml, vars: {page: page_irrigation, id: v_a4, name: "A4", entity: switch.mcu_well_irrigation_valve_a4, icon: "\U000F1066", domain: switch}} v_a5: !include {file: common/nspanel_terminal/switch_tile.yaml, vars: {page: page_irrigation, id: v_a5, name: "A5", entity: switch.mcu_well_irrigation_valve_a5, icon: "\U000F1066", domain: switch}} irrigation_auto: !include {file: common/nspanel_terminal/nav_tile.yaml, vars: {page: page_irrigation, to: page_irrigation_auto, icon: "\U000F06A9"}} ir_morning: !include {file: common/nspanel_terminal/switch_tile.yaml, vars: {page: page_irrigation_auto, id: ir_morning, name: "Ráno", entity: automation.irrigation_morning, icon: "\U000F059C", domain: automation}} ir_patio: !include {file: common/nspanel_terminal/switch_tile.yaml, vars: {page: page_irrigation_auto, id: ir_patio, name: "Terasa", entity: automation.irrigation_patio, icon: "\U000F024A", domain: automation}} ir_grass: !include {file: common/nspanel_terminal/switch_tile.yaml, vars: {page: page_irrigation_auto, id: ir_grass, name: "Rast trávy", entity: automation.irrigation_grow_grass, icon: "\U000F1510", domain: automation}} # 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 - Obývačka", prev: page_gate, next: page_status, entity: climate.bt_trv_living_room_kitchen}} # 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_living_room_kitchen}} # 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_kitchen_living, title: "Kuchyňa / Obývačka", prev: page_home, next: page_kitchen, skip: false}} - <<: !include {file: common/nspanel_terminal/grid_page.yaml, vars: {id: page_kitchen, title: "Kuchyňa", prev: page_kitchen_living, next: page_outside, skip: false}} - <<: !include {file: common/nspanel_terminal/grid_page.yaml, vars: {id: page_outside, title: "Von", prev: page_kitchen, next: page_irrigation, skip: false}} - <<: !include {file: common/nspanel_terminal/grid_page.yaml, vars: {id: page_irrigation, title: "Závlaha", prev: page_outside, next: page_gate, skip: false}} - <<: !include {file: common/nspanel_terminal/grid_page.yaml, vars: {id: page_irrigation_auto, title: "Automatizácia závlahy", prev: page_irrigation, next: page_irrigation, skip: true}} - <<: !include {file: common/nspanel_terminal/grid_page.yaml, vars: {id: page_gate, title: "Brána", prev: page_irrigation, 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 Von page, where the change is visible - platform: gpio name: Left Button pin: number: 14 inverted: true on_click: - switch.toggle: relay_1 - lvgl.page.show: page_outside - script.execute: wake_screen - platform: gpio name: Right Button pin: number: 27 inverted: true on_click: if: # mcu-patio online -> toggle its lights; otherwise (no API or relay_2 cut its power) the relay condition: and: - api.connected: - binary_sensor.is_on: patio_status then: - homeassistant.action: action: light.toggle data: entity_id: light.patio_lights - lvgl.page.show: page_outside - script.execute: wake_screen else: - switch.toggle: relay_2 - platform: homeassistant id: patio_status entity_id: binary_sensor.mcu_patio_status switch: - platform: gpio name: Outside Light Back id: relay_1 pin: number: 22 - platform: gpio name: Light MAIN id: relay_2 restore_mode: always_on entity_category: config pin: number: 19