widapro / pixel_led_mqtt_panel

Pixel dot screen with mqtt
MIT License
40 stars 14 forks source link

This project is being continued in a new repository with even more features! https://github.com/widapro/wledPixel

#

Pixel led MQTT panel (wLed)

wLed panel it's dot matrix display to show information from MQTT topics. It's well integrated with home automation systems like Home-assistant, domoticz and others through MQTT broker.

wLed demo photo

Demo video on youtube.

Ingredients:
  1. Dot matrix display MAX7219: https://aliexpress.ru/item/32618155357.html
  2. WeMos D1 Mini (esp8266): https://aliexpress.ru/item/32651747570.html

Algoritm of work

The display has booting and connecting to wifi, then the display subscribe to MQTT topics and publishing message "up" in MQTT topic wled/status

MQTT topics:
Scroll effect list

Default effects:

Custom effects:

Custom effects demo video

Icons

For icons, I created a font with several icons to override the regular alphabet. This font applied just only for zone1. You can find a mapping card in wLedFont.h. You can paint icons whatever you want using this online tool: https://pjrp.github.io/MDParolaFontEditor

Feel free to add new icons and update the existing wLedFont.h in the repository.

wLed icons map

Flash esp8266 (WeMos D1):

Install libraries in Arduino IDE
First need to change config section in file pixel_led_mqtt_panel.ino:
  // Wifi settings //
const char* WIFI_ssid       = "your_wifi_network_name";
const char* WIFI_password   = "change_me";
  // OTA updates settings //
const char* OTA_hostname    = "wLed-panel-01";
const char* OTA_password    = "change_me";
  // MQTT settings //
const char* mqtt_server = "192.168.1.250";
const char* mqtt_user = "mqtt_user";
const char* mqtt_password = "change_me";
  // MQTT TOPIC PREFIX //
String TOPIC_PREFIX = "wled";

  // Parola display settings //
#define HARDWARE_TYPE MD_MAX72XX::FC16_HW // type of device hardware https://majicdesigns.github.io/MD_MAX72XX/page_hardware.html
#define MAX_DEVICES  8                    // number of device segments
  // Display pinout //
#define DATA_PIN  D7                      // WeMos D1 mini GPIO13
#define CS_PIN    D6                      // WeMos D1 mini GPIO12
#define CLK_PIN   D5                      // WeMos D1 mini GPIO14
Optional

If you have display with different count of segments you need to change zones in config before flashing

wLed demo photo with zones

In file pixel_led_mqtt_panel.ino:

#define MAX_DEVICES  8                    // number of device segments
void setup() {
  setup_serial();

  P.begin(2);
  P.setZone(0, 0, 6);                     // P.setZone(zone_number,start_segmet,end_segment)
  P.setZone(1, 7, 7);                     // P.setZone(zone_number,start_segmet,end_segment)

Then configure automation in Home Asisstant:

Send sensor value each time when a value has been changed

---
- alias: Outside temp change - send new temp to wled panel mqtt
  initial_state: 'on'
  trigger:
    platform: state
    entity_id: sensor.outside_thp_sensor_3
  action:
    - service: mqtt.publish
      data:
        topic: wled/zone0_text
        payload_template: "{{ states('sensor.outside_thp_sensor_3') }} C"

First matrix panel start. When matrix panel publish message "up" in wled/status MQTT topic HA sends a message and change scroll effect

- alias: wled panel ON mqtt - send outside temp mqtt
  initial_state: 'on'
  trigger:
    platform: mqtt
    topic: wled/status
  action:
    - delay: "00:00:03"
    - service: mqtt.publish
      data:
        topic: wled/scrolleffect
        payload_template: "PACMAN"
    - service: mqtt.publish
      data:
        topic: wled/zone0_text
        payload_template: "MQTT ok"
    - delay: "00:00:03"
    - service: mqtt.publish
      data:
        topic: wled/zone0_text
        payload_template: "HA ok"
    - delay: "00:00:03"
    - service: mqtt.publish
      data:
        topic: wled/scrolleffect_without_exit
        payload_template: "PACMAN"
    - service: mqtt.publish
      data:
        topic: wled/zone0_text
        payload_template: "{{ states('sensor.outside_thp_sensor_3') }} C"
    - service: mqtt.publish
      data:
        topic: wled/zone1_text
        payload: "s"