# Advanced configuration example # This includes some commented out configuration items showing what other functionality is available # Available icons can be found in 'components\nspanel_lovelace\icons.json'. Icon colors range from 0 to 65535. # NOTE: This project is in the beta stage so the configuration is subject to change without notice. # Please check your own configuration againist the latest example when updating. esphome: name: nspanel name_add_mac_suffix: true comment: "ESPHome Advanced NSPanel Example" build_path: ./.build/nspanel-advanced esp32: board: esp32dev framework: # ESP-IDF is requried so we can access the NSPanel PSRAM # which is on non-standard pins. ESP-IDF also uses less flash than Arduino! # note: Arduino support is deprecated and will be dropped in the future type: esp-idf external_components: - source: type: git url: https://github.com/olicooper/esphome-nspanel-lovelace-native ref: dev refresh: 3h components: [nspanel_lovelace] nspanel_lovelace: id: nspanel sleep_timeout: 10 # locale: ## This can be the ISO 639‑1 language code or a custom json file (i.e. custom.json). ## Currently supported languages: ## - Catalan/Català: ca.json ## - Czech/Čeština: cs.json ## - English/English (GB): en.json, en-GB.json ## - German/Deutsch: de.json ## - Greek/Νέα Ελληνικά: el.json ## - Polish/Polski: pl.json ## - Spanish/Español: es.json ## NOTE: This feature is in beta so the translation keys and values could change at any time! ## Any custom translation files you create will need to be kept in sync with the the files on the repo ## https://github.com/olicooper/esphome-nspanel-lovelace-native/tree/dev/components/nspanel_lovelace/translations # language: en # temperature_unit: celcius screensaver: # Use this to enable double tapping to exit the screensaver # double_tap_to_unlock: false time_id: homeassistant_time ## For formatting options see: https://cplusplus.com/reference/ctime/strftime/ # time_format: '%H:%M' # date_format: '%A, %d. %B %Y' weather: entity_id: !secret weather_entity_id ## NOTE: Please see README for more info on weather 'forecast_method' options. Default is 'template_sensor' (deprecated). ## This option uses a Home Assistant action to send forecast data to the nspanel (see README for the HA automation template). forecast_method: service ## This option uses a Home Assistant template sensor to replicate the old HA entity behaviour. The entity_id (seen above) should be ## configured to use the template sensor unique_id (see README for the HA template sensor). ## NOTE: this option is less flexible and will be deprecated in esphome 2026.6. #forecast_method: template_sensor # status_icon_left: # entity_id: light.front_room_inner # icon: hiking # status_icon_right: # entity_id: light.front_room_outer # icon: # value: robot-outline # color: 200 cards: - type: cardGrid id: front_room title: Front Room sleep_timeout: 10 # hidden: true entities: - entity_id: light.front_room_all name: All - entity_id: light.front_room_inner name: Inner - entity_id: light.front_room_outer name: Outer - entity_id: scene.front_room_all_default name: Default - type: cardGrid sleep_timeout: 10 title: House Lights entities: - entity_id: light.hallway name: Hallway - entity_id: light.stairs name: Stairs - entity_id: delete - entity_id: delete - entity_id: switch.garden_lights name: Garden - type: cardEntities sleep_timeout: 30 title: House Info entities: - entity_id: sensor.outside_temperature name: Outside Temp - entity_id: sensor.nspanel_temperature name: Room Temp - entity_id: navigate.front_room name: Front Room Nav - type: cardQR sleep_timeout: 30 title: Guest WiFi qr_text: !secret qrcard_text entities: - entity_id: !secret qrcard_ssid_itext name: SSID icon: wifi - entity_id: !secret qrcard_password_itext name: Password icon: key - type: cardAlarm sleep_timeout: 60 title: Home Alarm alarm_entity_id: alarm_control_panel.home_alarm - type: cardThermo sleep_timeout: 60 title: Thermo Ecobee thermo_entity_id: climate.ecobee # temperature_unit: fahrenheit logger: baud_rate: 115200 wifi: ssid: !secret wifi_ssid password: !secret wifi_password api: ## NOTE: This is automatically set when using `forecast_method: service` for weather updates # custom_services: true services: ## Service to update the TFT firmware using a URL that is accessible to the nspanel - service: upload_tft variables: url: string then: - lambda: 'id(nspanel).upload_tft(url);' ## Service to display a notification on the screensaver - service: notify_on_screensaver variables: heading: string message: string ## Set to 0 (or remove) to keep message until screensaver refreshes timeout_ms: int then: - lambda: 'id(nspanel).notify_on_screensaver(heading, message, timeout_ms);' - rtttl.play: 'scale_up:d=32,o=5,b=100:c,c#,d#,e,f#,g#,a#,b' ## Service to send a command directly to the display (useful for testing) # - service: send_command # variables: # cmd: string # then: # - lambda: 'id(nspanel).send_display_command(cmd);' ota: platform: esphome password: !secret ota_password ## UART for the Nextion display uart: id: uart_nextion tx_pin: 16 rx_pin: 17 baud_rate: 115200 time: - platform: homeassistant id: homeassistant_time timezone: Europe/London on_time: ## At midnight - seconds: 0 minutes: 0 hours: 0 then: - lambda: 'id(nspanel).set_display_dim(1, 50);' ## At 8:00 PM - seconds: 0 minutes: 0 hours: 20 then: - lambda: 'id(nspanel).set_display_dim(20, 80);' ## At 7:00 AM - seconds: 0 minutes: 0 hours: 7 then: - lambda: 'id(nspanel).set_display_dim(50, 100);' switch: ## Physical relay 1 - platform: gpio name: Relay 1 id: relay_1 pin: number: 19 restore_mode: ALWAYS_ON ## Physical relay 2 - platform: gpio name: Relay 2 id: relay_2 pin: number: 22 restore_mode: ALWAYS_ON ## Turn screen power on/off ## NOTE: When using weather forecast_method 'service', this entity is used by the HA automation template ## to send a forecast update when the nspanel comes online. It is not required but is recommended. - platform: gpio name: Screen Power id: screen_power entity_category: config pin: number: 4 inverted: true restore_mode: ALWAYS_ON sensor: ## WiFi signal strength sensor - platform: wifi_signal name: WiFi Signal update_interval: 300s ## Internal temperature sensor, adc value - platform: adc id: ntc_source pin: 38 update_interval: 60s attenuation: 12db ## Internal temperature sensor, adc reading converted to resistance (calculation) - platform: resistance id: resistance_sensor sensor: ntc_source configuration: DOWNSTREAM resistor: 11.2kOhm ## Internal temperature sensor, resistance to temperature (calculation) - platform: ntc id: temperature sensor: resistance_sensor calibration: b_constant: 3950 reference_temperature: 25°C reference_resistance: 10kOhm name: Temperature binary_sensor: ## Left button below the display - platform: gpio name: Left Button pin: number: GPIO14 inverted: true id: left_button internal: true on_multi_click: ####### Single click - toggle front_room_inner - timing: - ON for at most 1s - OFF for at least 0.4s then: - if: condition: api.connected: then: - if: condition: switch.is_off: relay_1 then: - switch.turn_on: relay_1 else: - homeassistant.service: service: light.toggle data: entity_id: light.front_room_inner else: - switch.toggle: relay_1 ####### Triple click - restart the ESP32 - timing: - ON for at most 1s - OFF for at most 0.3s - ON for at most 1s - OFF for at most 0.3s - ON for at most 1s - OFF for at least 0.3s then: - button.press: restart_switch ####### Single long click - toggle light relay 1 - timing: - ON for 1.2s to 4s - OFF for at least 0.3s then: - switch.toggle: relay_1 ## Right button below the display - platform: gpio name: Right Button pin: number: GPIO27 inverted: true id: right_button internal: true on_multi_click: ####### Single click - toggle light front_room_outer - timing: - ON for at most 1s - OFF for at least 0.4s then: - if: condition: api.connected: then: - if: condition: switch.is_off: relay_2 then: - switch.turn_on: relay_2 else: - homeassistant.service: service: light.toggle data: entity_id: light.front_room_outer else: - switch.toggle: relay_2 ####### Triple click - restart TFT - timing: - ON for at most 1s - OFF for at most 0.3s - ON for at most 1s - OFF for at most 0.3s - ON for at most 1s - OFF for at least 0.3s then: - switch.turn_off: screen_power - delay: 0.5s - switch.turn_on: screen_power ####### Single long click - toggle light relay 2 - timing: - ON for 1.2s to 4s - OFF for at least 0.4s then: - switch.toggle: relay_2 button: - platform: restart id: restart_switch name: Restart output: ## Buzzer for playing tones - platform: ledc id: buzzer_out pin: 21 ## Rtttl function for buzzer rtttl: id: buzzer output: buzzer_out