Hi all I am actually sitting in the bus while writing this. I just wanted to shae a project. I am running a esp8266 with a LCD Display.Those is connected to the mqtt broker which listens to topics from hass.
I have an automation which publishes all sensor data to mqtt topic which can be used for the display to show.
How to setup this stuff?
- you need a LCD Display connected to an ESP8266
- ESPEasy https://www.letscontrolit.com/wiki/index.php/ESPEasy (NOTE: The IP should be 192.168.4.1 of your esp after flashing. This is not always the case. Don’t knw why. Maybe because of the Network setting at home here. To figure out the IP of the EsP. Connect to the AP and watch the DNS address n your connection information on windows or your phone)
- MQTT BRoker (Normally on Home-Assistant install available)
- Shelscripts to call the api of the LCD
But how to get started?
First connect your LCD Display to the ESYEasy. Descibed well on their page (if Help neededlet me know.)
My config on the espeasy looks like this:
FIrst you go to Controllers and add the OPenHab MQTT CLient.
Fill in your mqtt broker credentials
In Tools you can search for your LCD I2C Display:
You should get something similar like this:
Now it is time to get everything together:
Just go to Devices and add the Display:
The I2C address is what we figured out earlier in I2C scan. Chose the same here
Dont forget “submit” after all setting parameters
Now the Display is ready to receive the commands to show information in the LCD DIsplay.
By default you can also put some Text in Line 1-4 (1-2 depending on your Display.)
For the start we let it empty.
Hw to send information from Home-Assistant to the Display now?
For this we need little scripts / shell commands.
First of oaa you needa shell command which calls a shell script:
### LCD DISPLAY /ON/Off ###
lcd_on: sh /home/hass/.homeassistant/shell_scripts/lcd_on.sh
lcd_off: sh /home/hass/.homeassistant/shell_scripts/lcd_off.sh
The Shell scrit looks like:
curl http://192.168.1.91/control?cmd=lcdcmd,off
curl http://192.168.1.91/control?cmd=lcdcmd,off
This could be an ALARM PENDING message to the display:
curl http://192.168.1.91/control?cmd=lcdcmd,clear
curl http://192.168.1.91/control?cmd=lcd,1,5,ALARM-SYSTEM
curl http://192.168.1.91/control?cmd=lcd,2,1,--------------------
curl http://192.168.1.91/control?cmd=lcd,3,9,ALARM
curl http://192.168.1.91/control?cmd=lcd,4,6,DEACTIVATED!
The MOST important part here is the “curl http://192.168.1.91/control?cmd=lcdcmd,clear” command. This will clear the display screen of the LCD. If not send to the display. Lines in the Display will be overwritten and will end up in a mess
You just need to adapt the IP of your ESPEasy
Then you can go and try this shell command and see the result. Don’t you worry this will take a lot of time to adjust the text perfectly on the Display
Advanced use:
lisenting to mqtt topics From Home Assistant and Show them on the display:
For this we need a listener which reads out the values of the topics.
We archive this by subscribing to a topic:
For this we just go to DEVICES and chose MQTT Import:
Never forget to ENABLE the Devices as they are disabled by default.
Just Give It a name. Formula is not needed but feel free to play around.
Don’t forget to SUBMIT each time to save the config.
If you now click again on DEVICES the MQTT the Import MQTT device should show up with the subscribed topic and the Value.
Note: Sometimes for what reason ever the ESP seems frozen. RESET on the ESP should help out here.
After you subscribed to the topic you just need to go to TOOLS --> LOGS and watch the IMPORT valie. THis is something with [yourtopicname#blabla] copy all of this in a Line of your LCD Display and you should be fine.
Sorry I just got a frozen ESP Let me continue as soon as I fixed. But for the moment With the shell commands without MQTT it should work for you.
UPDATE: Make 100% sure you have the right credentials and IP for the broker. If not the ESP will end up in a loop and wont boot up!
Here is one example. Fell free to try and modify
Here some pics.If someone is interested I will write up the whole thing
Let’s see it in action: