marcfager / nspanel-mf

Custom HMI controlled by ESPHome for the Sonoff NSPanel. Includes media player card and home screen with weather data and clock. More to come.
215 stars 60 forks source link

NSPanel-MF

Current version: 2022-01-19. Changelog further down

Custom HMI controlled by ESPHome for the Sonoff NSPanel. Includes home screen with weather data and clock, media player card, control of 8 lights per card with 4 available cards (can be enabled/disabled from ESPHome/HA), bootup screen and disable screen for alarm. Audible notifications can be sent from Home Assistant that remain visible on the screen for a set period of time. The screen dims down and turns off similarly to a iPhone (dim down + screensaver) and is woken up by tapping the display. More to come.

Navigation is done by swipe gestures.

All content on the screen can be controlled from ESPHome and is very easily integrated to Home Assistant.

Youtube video

Youtube video of notification function

Credits

I created this based on information shared in the following forum threads: Home assistant thread, ESPHome thread

Significant parts of the ESPHome config and ideas in the HMI are from Masto.

The HMI theme is based on the Lovelace iOS dark mode theme

Weather icons are from simple weather card

Light icons on the Lights-page are from Hass BHA Icons

Other icons are from Material Design Icons

The font is the Ubuntu font.

Touch swipe navigation inspired by blakadder

The ESPHome config yaml is based on Masto's example config

HMI Screenshots

Home screen

Music screen

Lights screen

Bootup screen

Alarm screen

Notification screen

HA Sensors

Not all exposed entities are visible on the screenshot. The items look slightly poorly centered. This is to cope with the issue that the physical screen is larger than the visible area.

Usage

The weather entities, media entities, lights etc. are selected in the ESPHome config. You can navigate between screens by using a swipe gesture on the screen (left or right). The code is prepared for swipe up and down as well. The media player is on the left side, and the lights on the right side. The config that is not done in ESPHome is done in Home Assistant.

In the example config a big part of the config is done in the ESPHome YAML file. If you prefer to set-and-forget it, you can replace the media entities, weather entities, light entities etc. with HA templates or input_text fields. That way you can re-configure everything directly from Home Assistant.

Any information and/or code found here is used on your own risk.

Installation

  1. Install and configure ESPHome.
  2. Prepare the NSPanel for flashing (see instructions in the forum pages linked above).
  3. Download the ESPHome sketch and adjust to your needs. Flash it to the NSPanel. Pay special attention to the _tfturl parameter and ensure it is accessible by the NSPanel.
  4. Download the HMI file and save it to the _tfturl location.
  5. Add the unit to Home Assistant through the ESPHome integration.
  6. Run the _esphome.nspanel_uploadtft service from Home Assistant. This will download the HMI to the NSPanel. Please note that this will block the ESPHome connection during the update. Follow the progress on the HMI screen. When the HMI is installed, reboot the unit.
  7. Configure the unit in Home Assistant to add actions to the buttons etc. it exposes.
  8. Enjoy!

Changelog (latest revision 2022-01-19)

Breaking changes (latest revision 2022-01-19)

Component numbering changed as the old navigation hotspots have been removed. Affects Music and Light page.

TODO

Somewhat in a priority order: