Custom ESPHome dashboards on LilyGo T5 4.7" ePaper device

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
everyone who has home assistant or some kind of a smart home is always looking for an easy and nice way to display the information today we'll be looking at one device this e-ink or e-paper screen that can help you display statistical information about your home family upcoming tasks and of course weather information we'll start in couple of seconds the topic of this video or the device in this video that we'll be covering today is this e-ink or E paper screen from liligo the Chinese company that I've previously featured on this channel in couple of projects the biggest one of them of course was their plan sensor but today we are not going to be collecting data we could potentially instead will be displaying it this all in one device that features e-ink 4.7 inch display also has esp32 model on it and that makes it nicely hackable for our DIY iot projects there are two versions of this board one that has 18650 battery holder where you can tuck in the 18650 lithium ion battery and power the project that way or the second option is to go with this pH 2.0 battery holder or battery connector that I'm using myself but I will also mention one additional thing that I will not be covering in this video and that is a possible upgrade to this device and that is of course adding the touchscreen possibility or option to use touch screen as I mentioned I will not be showing you how you can program the board with that because I'm still playing with it but if you go with the previous display and this touch panel here you will be able to use them together and have a nice e-paper display with touch screen capabilities so where to start on the stream couple of weeks ago we played with this device and we were searching for a repository that we could copy files from make everything work and then adapt it to create whatever we want to see on the display itself there are tons of the projects if you go on Reddit or do a search on the internet you will find bunch of them for example this one here it showcased the device standing in the portrait orientation but I wanted to do landscape this project had more or less everything I want to have in my project it was couple of room temperatures location and weather forecast for next couple of days one thing that I didn't need is the major information or the information what is currently playing and is the media player playing stopped or imposed mode so that's why I tweaked it and for tweaking I was looking at this project here which unfortunately when I tried to use it didn't work I did figure out later on what was the issue but since I started working on the previous project I just copied and pasted the information from this project to the other project that I was already working on all the links to all the repositories will be in the video description and also there will be a link to my GitHub repository where there is an issue created just for this project and where you can see the different stages of me working on that project and what I changed and what is left from the original projects there are a couple of ways on how you can add a new project to the ESP hole one way is to click a new device and then commission the device via the standard method of commissioning the new devices there is also another different object that I prefer and that is to create tml file work on the ml file and then have it imported inside ESP home and inside ESP home subfolder I created file called T5 once again don't worry even if you do not see the text on the screen I would recommend that you go to the GitHub repository and pull that yaml file from there it will be much easier for you to copy everything inside your system but before we start digging at the code which I will be doing through the ESP home interface let's look at some other prerequisites and don't worry once again this T5 EML file plus the next which is common.h file and Google sounds bold Google sense medium and material design icons font will all be linked into the video description option when you are copying information for this project copy from my repository this D5 and command.h file these are the files that I am working on and that can change through the time the links for the Google sounds bold Google sounds medium and material design icons will be in the repository itself and you do not need to pull those from the with the description you can use the links from the inside of the 5. ml file common.h is a file where we declare some variables and information that will be later on used by the display itself such as for example this month's information which are the abbreviations or the months and you can translate them to your local language same goes for the weekdays from Sunday to Saturday Monday through Sunday okay and also the information about the icons the icons or codes unicodes that we will be using for the icons themselves are from this material design icons file but I will also be leaving a link to the web page where you can check each and every one of those icons for example if we copy this f0594 go to material designer page press F to search this is the icon that is referenced from the comma.h file itself you can of course change and customize this according to your needs okay let's presume that you now have ESP home installed board ready and that you did copy command.h and this t5.yaml file if we open that file inside the ESP home it should look something similar like this the first part of the file are substitutions here we defined some data that is specific to this device for example ESP name then hostname which ESP Dash dashboard then I also defined my fixed Network IP address Gateway and netmask then depending on if you want to run this device out of battery power or via the USB C cable we are using runtime and sleep time runtime is used to define how long will the device be in the Wake State Wake state is when the device wakes up connects to the Wi-Fi network boots up loads up everything pulls the information from home assistant pushes the information to home assistant and then goes to sleep in my case for every one minute of runtime I have 20 minutes of sleep and while we are talking about that let's talk about batteries I tested this project with these small lithium ion battery this is 800 milliamp hours battery so not that much others have used 18650 2000 or even 3 000 milliamp hours batteries in my case if I don't use sleep and I power the device via this battery it runs for roughly 10 11 maybe 12 hours deep sleep or sleep option inside ESP home allows the device to go to sleep and then it minimizes the power it needs to keep the device running that way you can prolong the lifetime of the battery or lifetime of device on One battery charge from 10 11 12 hours up to in my case 11 days of course if I would be using battery with a bigger capacity I could prolong that for example two one month month and a half maybe even two months next method you can use to prolong the battery life of course is to extend this from 20 minutes to 30 or maybe 40 minutes but be careful as I am pulling here information about the calendar I do not want to miss the calendar events so don't put device in sleep for 2 hours if you have meetings every half an hour or 45 minutes one thing that I have read but never tried myself is to create deep sleep during the night so for example the last update is at 11 PM and the first morning update is at around 6 or 7 AM that way we would not be updating device during the night which of course extends the life on one charge next we Define the name which is dashboard and we include this command.h file as I mentioned this common.h file is used to create translations or variables for our device next part of the code esp32 is a standard one and this defines the type of the board inside display we are enabling logger and we are using API with the encryption key which is a mandatory scenes one or two months ago I did mention that we are using external components external components allows home assistant to know what and how to work with this display there are various external components that work with this display I have tried and tested this one here and this one worked great for me with one note and I'll talk about that one important note a little bit later down the road but you also have option to use either this this or this component here this component defines two variables or two categories one is the display and the other one is battery and now it's good time to come back to the problem with this component this part here the battery part is not working for me if I uncomment sections in regard to the battery state such as percentage and voltage and Flash the firmware on the board the board itself goes into the boot loop if I disable and comment out those sections it works nicely so although I can use the display I unfortunately cannot get the battery state and better information either pulled as an entity inside home assistant or displayed on screen if you are going to power the device via the battery this code here is used for that if not you can remove it and you will not be needing it but also note if you do use deep sleep we also Define pin gpio 39 as a pin or button that you can wake your device from deep sleep and it's great because you can then Force the update on the screen or if you are doing over the air update you can use that button to wake the device up and push the update over the Wi-Fi network so you don't have to use the USB cable once again next couple of lines are standard we Define over-the-air updates Wi-Fi network with the fallback hotspot we also enable internal web server and now comes the fun part when we start pulling the variables from home assistant or we will be pulling variables from home assistant and preparing them for display on this device we start with the information about the sun then we are using time and we are pulling time information from home assistant to sync the clock inside this display with the clock of Home assistant and when this time sync is done we then update sunrise and sunset components next we are using this script which has ID all data receive and this script is invoked in couple of places where we read values from home assistant to update the display note that this part for the battery voltage and battery state is disabled and that's because of that boot loop next we are defining all of the sensors that we will be pulling from home assistant each of these sensors represents a value that will be displayed on screen for example current temperature outside then the minimum maximum temperatures for the next three days plus of course all the other temperature and humidity sensors that we will be displaying on screen next part of the code is disabled as I mentioned couple of times already if I enable this part of the code unfortunately the board goes into the boot loop after sensors we have binary sensors once again we have this gpio 32 which is a button and we can see the state and capture the state of the button inside our home Assistant Plus two binary sensors that I've created one is tracking if the outside temperature is falling and the other one is tracking if the outside temperature is rising and based on that I show either downwards or upwards pointing Arrow to know how the trend of the temperature is you can of course find links also to those two sensors inside my GitHub repository last but not least we are creating some tech sensors we are pulling information from Sun and the Moon platform and there are also some old sensors that are not used in my system but maybe if your Weather Service does provide the data you can populate it with these sensors here what I'm most proud of is this calendar section here I'm pulling States from two calendars one is a catalog holiday calendar that is showing me what is the saint patron of the day and the second counter I'm pulling is this calendar Zita with the name of the event and the time of the next event of course also updating the screen you can use whatever calendar you have integrated inside your home assistant it can be either internal or in this case it's a Google Calendar and last States or last sensors we are pulling are those device trackers each of the two device trackers has additional sensor and that is a distance sensor don't worry this distance sensor is also included into the Repository first one tells this device if the device is at home or not and if device is not at home we are then pulling the state of that second and that second sensor is showing us the distance of that device or a person from home next part is used to define fonts for specific texts on the display we are using as I mentioned previously two phones one is Google Sans medium and the other one is Google sounds bold and you define here the size of each of those fonts we have small medium medium bold big large extra large bolt besides those phones we are also using material design icons Dash web font ttf and this font is used for all of the icons or graphics on this display each of the icons that you use or you will be using in display you have to declare it here last part of the code is even more complex and I really would recommend that you start with the code AS is fill in the sensor data from your setup and see how it goes later on you can try and work on the display but unfortunately so far as far as I know and if you do know a easier way there is no easy way in ESP home to declare or create or design the screen where the icons and text will be so each of the locations for each of the phones and each of the letters or words needs to be defined in pixels first part you can leave as is rest of it is declarations screen size Center how everything is drawn where everything is located for example this section covers the date section of the screen calendar section of the screen or weather section of the screen room information for those four rooms then we have location information forecast on the right side Thunder probability which is part of the forecast and a footer that is actually disabled or commented out and not used yes unfortunately this is also part where it should display the battery percentage and battery state but plus unfortunately it doesn't work for the purpose of this video I myself will be hooking up this display with a USBC cable and I have secure connection or I have https certificate installed so I can do everything from the UI if not you can compile and download the firmware and install it via the ESP home flasher a command line tool or using the ESP home web installer let's press on install I will be using plug into this computer the device itself was plugged in I will select the port 10 in my case press connect and you will probably see screen like this it means that it is trying to communicate but it cannot communicate with the board what you have to do is you have to press this button here and then click and release the button next to it preparation and installation of the firmware depends on the speed of your system it can take from around couple of seconds to couple of minutes just sit tight and we are nearly done the firmware is now uploaded to the board but unfortunately at this point still we are not done there is one simple step that we need to do and that is to add this device to our home assistant until we do that we will not be able to pull any information and present anything on the screen so this last step is also mandatory but if everything went well you will see the notification that the new device has been discovered and that will help you add this device to your instance click on notifications show new devices and just click on configure if your device is not visible here the thing you have to do is press on plus sign add integration type ESP home select and add another instance of ESP home it will ask you for the IP address if you are running your device on the battery and you click on configure and nothing happens when you click submit it means that the device itself is in the deep sleep if device is in the Deep Sleep what you can do is either wake it up or unplug it and plug it once again if you are running it on the battery unplugging your plugin will not help you will have to press the button to wake it up on the display itself inside ESP home you should see two new sensors or One sensor and one diagnostic information we have little gold T5 button information and this is the information if the button on the board has been pressed or not for example to wake the device up and the second is information if the firmware that is on the board is current meaning that you have the latest ESP home installed and that the latest version of the firmware was compiled and uploaded to the device itself and now we are done you can print or assemble the case insert the battery charge the battery because device itself does charge the batteries and you are good to go I really would like to see what you have done with this T5 display from the oligo if you have created something don't forget to either drop me a link down below or tag me on the Twitter and show me what you have done with this wonderful little display also remember any contributions you can do for the community is great so if you have a good code for this display share share it with us on the GitHub and post the link somewhere either on the Twitter in the comment section below or post it on my Discord server if you did like this video don't forget to click like button it really means a lot and it helps with those funny YouTube algorithms and while you're already there check that you are already subscribed if not subscribe and click on that Bell button so you receive notifications where I push my next video also if you can join me on my streams because I will try in the future to work on more projects last weekend on the stream we played with the son of I host and also upcoming sonoff TX ultimate switch who knows what we will do on the next stream and I also want to thank all those wonderful people that are supporting me and that have become YouTube channel members thank you all for all of your support but also let's not forget each and every one of you who has watched liked or subscribed to my channel if you do want to support the channel you can do so by clicking the join button down below and becoming a YouTube channel member for only 2 Euros or two dollars per month but you can also go to my merchandise store and buy something there and no we don't call it merge because we are adults I will be seeing you next time until then bye bye and have fun
Info
Channel: BeardedTinker
Views: 26,711
Rating: undefined out of 5
Keywords: epaper display esp32, home assistant epaper display, esp32 projects home assistant, esp32 projects iot, lilygo t5, lilygo t5-4.7
Id: yftae61X4i8
Channel Id: undefined
Length: 21min 56sec (1316 seconds)
Published: Wed Mar 15 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.