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.
Check the code inside the code folder.
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.
- 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
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 |
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.
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.
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.
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.
Original code did not funtion as expected so I reverted back to setting 15 minutes refresh time. I need to sort this out.
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.