Skip to content

Latest commit

 

History

History
80 lines (50 loc) · 4.26 KB

README.md

File metadata and controls

80 lines (50 loc) · 4.26 KB

Simple status display using eink Lilygo EPD47 unit

I have couple of sensors placed in my appartment measuring room temperature, humidity, CO2 and particles. I added all those data to Home Assistant dashboard but wanted to present the data for anybody at home also who does not use the mobile app.

Front side Back side

Check the code inside the code folder.

Basic idea and objectives

Some years ago freind of mine prepared similar device for his purpose - simple meteo dashboard showing actual weather and precipation from home sensors. I came to idea to use the concept and present measurements for anybody.

Key functionalities, highlights of the setup

  • Periodical data fetch from Home Assistant API and display outcome on eink display
  • Wireless operation - no power cable, utilizing 18650 battery and custom case
  • Measuring estimated remaining battery capacity

Components

All listed components are easy to obtain and available on many eshops. Of course, you need to have working Home Assistant box/instance in order to utilize and extent the functionalities as you want.

Component Link
LilyGO TTGO T5-4.7" E-Paper ESP32-S3 Laskakit.cz
LiPol battery unit Laskakit.cz

Software components:

Here are main software components which I used for inspiration about the concept and some of them are necessary for the operation (see includes in code).

Software Link
Weather station Github.com
PubSubClient by Nick O'Leary for MQTT knolleary.net
Github.com
Arduino_JSON Github.com
NTP library for Arduino framework Github.com

Fetching values from Homeassistant

This was quite straight forward. I use Rest API of the HomeAsisstant to get latest state values from sensors which I want to show results from. The API endpoints are defined in variables with req_ prefix. See example:

//OFFICE
const char *req_temp_office = "http://__IP__:8123/api/states/sensor.hb_office_space_temperature";
const char *req_hum_office = "http://__IP__:8123/api/states/sensor.hb_office_space_humidity";

//BEDROOM
const char *req_temp_bedroom = "http://__IP__:8123/api/states/sensor.sonoff_a4800539db_temperature";
const char *req_hum_bedroom = "http://__IP__:8123/api/states/sensor.sonoff_a4800539db_humidity";

Don't forget to use your own endpoints.

httpGETRequest - adjust the bearer token

Don't forget to add your own API token for authentication against Homeassistant. Just replace __BEARER_TOKEN__ with your own token:

http.addHeader("Authorization", "Bearer __BEARER_TOKEN__");

The method returns JSON payload as string.

3D printed case

Since the ESP32-S3 board is not very often used, it was tricky to find proper 3D model for this board. However, I found one here. Be aware that battery will not fit inside as well as soldered GPIO head.

Image convertion (Material Design Icons)

For converting images (Material Design Icons) I use imgconvert.py script available here. Just be aware that you have to use jpg file format for conversion. The png format with trasnparency is not properly converted.

Dynamic refresh time based on time of the day

Original code did not funtion as expected so I reverted back to setting 15 minutes refresh time. I need to sort this out.

3D case model and adjustments

The original case which I used is created by @ramatomo and published here on 3dprintables. However since the GPIO hat is already soldered on the board I need to cutout a small window and adjust the stand.