schwabe/reterminal
Esphome reTerminal e1002
Reterminal E1002 Colour ePaper Display Esphome Example
This the code that runs with Esphome on my
seeedstudio ePaper display.
Screen layout
The current screen layout is still subject to change but currently it
displays:
-
current weather conditions on the left side with an
outdoor sensor displayed directly under the title -
status of various things on the right side, currently
the status of the electric car is always displayed
and other things are planned to be shown when needed.The picture above shows the status for example the next
waste disposal date. -
a bottom area that shows warnigns like the current weather
warning. -
a status line that shows current battery level and the internal
temperature/humidity sensor, a debug output why the screen
was last refreshed and the time of the last refresh.
Program loop
The esphome script uses the following logic to display the
data and refresh the screen while trying to save battery power:
- wakeup from deep sleep/boot
- wait until the sensor data is available
- run the script get_data_then_refresh_screen
- wait up to 15s for data_updated to be true
- if something new is available, wait another few seconds
and refresh the screen and wait 40s for the screen
refresh to complete
- run the deep deep_sleep_evaluation script
- check the deep_sleep_disable_ha toggle to see if we should
disable deep sleep to allow easier updates - enter deep sleep for 15 minutes
- check the deep_sleep_disable_ha toggle to see if we should
Avoiding screen refreshes
Since ePaper screen refreshes are batterry expensive and annoying,
the esphome tries to avoid refreshing the screen unless something
new is available.
The esp32 looses its main memory when it goes into deepsleep, so we
store the last data displayed on the screen with globals that have
the restore_value: True flag set.
Whenever one of the sensors changes, the old saved value is
compared to the new and only if it is different from the saved
value the variable data_updated is set to true.
Helper functions
The epaper.h file contains a two helper functions:
- get_weather_icon - returns the weater icon for the current weather condition title
- parse_tonne - checks if the waste disposal of a certain category is due in less
than three days.
