Files
esphome-configs/mcu-nspanel-bedroom.yaml
T

115 lines
3.0 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
esphome:
name: mcu-${device}
friendly_name: ${name}
area: ${area}
comment: ${comment}
packages:
common: !include common/common.yaml
ipv6_only: !include common/ipv6_only.yaml
nspanel: !include
file: common/nspanel.yaml
vars:
temperature_entity: sensor.zigbee_bedroom_temperature
sleep_dim: !include
file: common/nspanel_sleep_dim.yaml
vars:
sleep_override_entity: light.bedroom_lights
nspanel_lovelace:
cards:
- type: cardGrid
title: Spálňa
entities:
- name: TV
entity_id: switch.mcu_socket_01_relay
icon: television-classic
- name: Raid
entity_id: switch.mcu_socket_02_relay
icon: emoticon-dead
- name: ""
entity_id: switch.mcu_socket_03_relay
icon: power-socket-fr
- name: Svetlo
entity_id: light.mcu_nspanel_bedroom_light
icon: wall-sconce-flat
- name: Nočná lampa J
entity_id: light.mcu_bedroom_lamp_right_light
icon: lamp
- name: Nočná lampa R
entity_id: light.mcu_bedroom_lamp_left_light
icon: lamp
- type: cardThermo
title: Kúrenie
thermo_entity_id: climate.bt_trv_bedroom
- type: cardEntities
title: Info
entities:
- name: Zariadenie
entity_id: button.bedroom_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:
# - switch.toggle: relay_2
on_click:
- homeassistant.action:
action: light.toggle
data:
entity_id: light.bedroom_lamps
- lambda: 'id(nspanel_id).render_default_page();'
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