Skip to content

Instantly share code, notes, and snippets.

@debsahu
Last active November 9, 2023 17:04
Show Gist options
  • Star 12 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save debsahu/0ad5e1de664763e84994cc3a4a5d5dc0 to your computer and use it in GitHub Desktop.
Save debsahu/0ad5e1de664763e84994cc3a4a5d5dc0 to your computer and use it in GitHub Desktop.
ESPHome config for connected ESP8266 to MAX7219 Dot-Matrix Display to show useful information from HomeAssistant
esphome:
name: veneer_display
platform: ESP8266
board: d1_mini
wifi:
networks:
- ssid: !secret esphome_wifi_ssid1
password: !secret esphome_wifi_pass1
# - ssid: !secret esphome_wifi_ssid2
# password: !secret esphome_wifi_pass2
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Veneer Display Fallback Hotspot"
password: !secret esphome_fb_wifi_pass
web_server:
port: 80
captive_portal:
# Enable logging
logger:
# Enable Home Assistant API
api:
password: !secret esphome_haapi_pass
ota:
password: !secret esphome_ota_pass
mqtt:
broker: !secret mqtt_broker
username: !secret mqttuser
password: !secret mqttpass
time:
- platform: homeassistant
id: homeassistant_time
spi:
clk_pin: D5
mosi_pin: D7
display:
- platform: max7219digit
id: display_max
cs_pin: D8
num_chips: 8
intensity: 3
scroll_speed: 100ms
update_interval: 100ms
lambda: |-
if(id(power_on_off).state) {
it.printf(0, 0, id(digit_font), TextAlign::TOP_LEFT, "%s", id(hatxt).state.c_str());
it.intensity(atoi(id(habri).state.c_str()));
it.scroll_left();
}
binary_sensor:
- platform: template
name: "Power State"
id: power_on_off
internal: true
switch:
- platform: template
name: "Veneer Display Power Switch"
icon: mdi:dots-grid
optimistic: true
restore_state: yes
turn_on_action:
- binary_sensor.template.publish:
id: power_on_off
state: ON
turn_off_action:
- binary_sensor.template.publish:
id: power_on_off
state: OFF
font:
- file: "pixelmix.ttf"
id: digit_font
size: 8
glyphs:
- ' '
- '@'
- '*'
- '!'
- '"'
- '%'
- (
- )
- +
- ','
- '-'
- .
- '0'
- '1'
- '2'
- '3'
- '4'
- '5'
- '6'
- '7'
- '8'
- '9'
- ':'
- A
- B
- C
- D
- E
- F
- G
- H
- I
- J
- K
- L
- M
- N
- O
- P
- Q
- R
- S
- T
- U
- V
- W
- X
- Y
- Z
- _
- a
- b
- c
- d
- e
- f
- g
- h
- i
- j
- k
- l
- m
- n
- o
- p
- q
- r
- s
- t
- u
- v
- w
- x
- y
- z
- °
text_sensor:
- platform: wifi_info
ip_address:
name: "Veneer Display IP Address"
ssid:
name: "Veneer Display Connected SSID"
bssid:
name: "Veneer Display Connected BSSID"
- platform: homeassistant
name: "HA Txt"
id: hatxt
entity_id: input_text.venner_text
- platform: homeassistant
name: "HA Brightness"
id: habri
entity_id: input_number.venner_bri
sensor:
- platform: wifi_signal
name: "Veneer Display WiFi Signal Sensor"
update_interval: 60s
- platform: uptime
name: "Veneer Display Uptime Sensor"
- platform: adc
id: adc_val
pin: A0
name: "Veneer Display Brightness"
update_interval: 60s
unit_of_measurement: "adc"
filters:
- multiply: 3.3
- calibrate_linear:
- 0.0 -> 0.0
- 3.3 -> 15
@viktor6
Copy link

viktor6 commented Mar 30, 2021

And write in Cyrillic?

@hdjweb
Copy link

hdjweb commented Apr 7, 2021

How can i create a switch ti Power on/off???

@debsahu
Copy link
Author

debsahu commented Apr 7, 2021

@hdjweb
Copy link

hdjweb commented Apr 12, 2021 via email

@debsahu
Copy link
Author

debsahu commented Apr 13, 2021

But It Will create a swivh in home assistant or Will Active a service? Il mer 7 apr 2021, 21:25 Debashish Sahu @.> ha scritto:

@.
* commented on this gist. ------------------------------ How can i create a switch ti Power on/off??? https://esphome.io/components/display/max7219digit.html?highlight=max7219digit#screen-on-off — You are receiving this because you commented. Reply to this email directly, view it on GitHub https://gist.github.com/0ad5e1de664763e84994cc3a4a5d5dc0#gistcomment-3697196, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALVET7IRYADREIGZU3B55TTTHSWSBANCNFSM42C3UHNQ .

Easiest way is to create a Home Assistant Template Switch that sets brightness of the display to 0 on off and 7 for ON.

@osfersa
Copy link

osfersa commented Dec 1, 2021

Got everything working but I can not get how to get on and off switch

@debsahu
Copy link
Author

debsahu commented Dec 2, 2021

@osfersa @hdjweb Added new version of the code that has power switch on it.

@osfersa
Copy link

osfersa commented Dec 3, 2021

Yes, I just compiled everything again, and works great, Thank you so much.

@maverik80
Copy link

hello and thanks for the wonderful job, I can't send any command from the home assistant for example I would like to adjust the brightness via mqtt but I can't, does anyone have any examples?

@johination
Copy link

is it possible to display symbols?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment