Hi,
I have a Wemos D1 driving three MAX7219 7-segment displays on separate CS lines from the Wemos. The displays show three values from Home Assistant (2023.1.5) related to electricity price and consumption
All works well except for the first boot after power-cycle when the displays stay blank. Checking Home Assistant I see the D1 connects and values are sent. The display_brightness
is restored to the previous setting as well. Rebooting the device either through the RESET button or through a restart_button
brings the display back to life.
I now have an automation in HA waiting for the device to power on and connect, then call button.press
service on the device’s reset button.
Can I to do anything else to get the displays to work at boot without the work-around?
/Mattias
button:
- platform: restart
name: "Restart"
spi:
clk_pin: D0
mosi_pin: D5
number:
- platform: template
id: max7219_bright
name: "Display brightness"
optimistic: true
restore_value: True
initial_value: 5
step: 1
min_value: 1
max_value: 15
display:
- platform: max7219
cs_pin: D6
num_chips: 1
lambda: |-
it.printf("Pr%7.2f", id(cost).state);
it.set_intensity(id(max7219_bright).state);
- platform: max7219
cs_pin: D7
num_chips: 1
lambda: |-
it.printf("En%7.2f", id(energy).state);
it.set_intensity(id(max7219_bright).state);
- platform: max7219
cs_pin: D2
num_chips: 1
lambda: |-
it.printf("Sun%6.2f", id(prod).state);
it.set_intensity(id(max7219_bright).state);
sensor:
- platform: homeassistant
name: "cost"
id: cost
entity_id: sensor.energy_huset_cost
- platform: homeassistant
name: "energy"
id: energy
entity_id: sensor.energy_huset
- platform: homeassistant
name: "Prod"
id: prod
entity_id: sensor.solaredge_energy_today_kwh