WLED matrix panel with text and sensor data. custom rest commands

Build a one or two row (two segment) matrix follow instructions on the WLED PAGE

There are different ways to set up 1D and 2D segments for matrix depending on what version.
Gets kind of confusing, you just have to keep playing to get things correct.
I still don’t understand completely how i got to work LOL

https://kno.wled.ge/advanced/2d-1d-Mixed-Setup/
@DrZzs and @3ATIVE did a videos last year and there is some new ones out there.

WLED v 0.14.0-b3

For matrix to work it has to be in “scrolling text” effect.

My 2 segment matrix preset to get correct effect, color and brightness.
Tip when you change value you need to click the check box for each segment. to go into effect.

{"on":true,"bri":5,"transition":3,"mainseg":1,"seg":[{"id":0,"start":0,"stop":32,"startY":0,"stopY":8,"grp":1,"spc":0,"of":0,"on":true,"frz":false,"bri":219,"cct":127,"set":0,"col":[[228,176,91],[0,0,0],[163,68,78]],"fx":122,"sx":255,"ix":136,"pal":0,"c1":0,"c2":128,"c3":16,"sel":false,"rev":false,"mi":false,"rY":false,"mY":false,"tp":false,"o1":true,"o2":false,"o3":true,"si":0,"m12":0},{"id":1,"start":32,"stop":64,"startY":0,"stopY":8,"grp":1,"spc":0,"of":0,"on":true,"frz":false,"bri":195,"cct":127,"set":0,"col":[[3,36,255],[0,0,0],[138,218,255]],"fx":122,"sx":199,"ix":128,"pal":0,"c1":0,"c2":128,"c3":16,"sel":true,"rev":false,"mi":false,"rY":false,"mY":false,"tp":false,"o1":true,"o2":false,"o3":false,"si":0,"m12":0},{"stop":0},{"stop":0},{"stop":0},{"stop":0},{"stop":0},{"stop":0},{"stop":0},{"stop":0},{"stop":0},{"stop":0},{"stop":0},{"stop":0},{"stop":0},{"stop":0},{"stop":0},{"stop":0},{"stop":0},{"stop":0},{"stop":0},{"stop":0},{"stop":0},{"stop":0},{"stop":0},{"stop":0},{"stop":0},{"stop":0},{"stop":0},{"stop":0},{"stop":0},{"stop":0}]}

In Settings
LED Preferences

2D configuration

Set your time zone in Time and macros

Segments.
Leaving each segment name blank will display the time on matrix by defalt in the scrolling text effect. Anything you type in the name field will display on matrix. 32 character max or it will fault out.
So with automation you can display your own custom text or even give text and values of sensors. Using automation and a custom rest command.

Home assistant information

Rest command for each WLED matrix you wish to use in automation

Put this in your HA configuration yaml
Make IP of your wled device static in your wifi network.
Replace with the IP address of your wled device.

rest_command:
  wled_text:
    url: http://192.168.2.9/json/state
    method: POST
    payload: '{"seg": [{"n": "{{text}}"}]}'
    
  wled2_text:
    url: http://192.168.2.10/json/state
    method: POST
    payload: '{"seg": [{"n": "{{text}}"}]}'

Automation for 2 WS2812B ECO RGB Alloy Wires 5050SMD Individual Addressable 8X32 256 panels connected together and stacked.
Video of matrix.
smoker temps

video time, date, temp.
solar info
Solar matrix

I have a ” Matrix living room solar 1” automation running by default so I made a automation “smoker on or off toggle smoker matrix” to shut that off when my BBQ temp is over 120 deg and turn on the “smoker matrix” automation and then turn off and turn back on the ” Matrix living room solar 1” when below 120 deg.

Smoker BBQ Temperature and Meat temp
using data from Inkbird IBT-4XS Bluetooth Wireless Grill BBQ Thermometer

alias: smoker matrix
description: >-
  Displays Grill temp and meat temp, updated every one minute or when meat temp
  changes. 
trigger:
  - platform: state
    entity_id:
      - sensor.ibbq_805a_temperature_probe_2
  - platform: state
    entity_id:
      - sensor.time
    for:
      hours: 0
      minutes: 0
      seconds: 0
    from: null
condition: []
action:
  - service: rest_command.wledseg1_text
    data:
      text1: M {{ states("sensor.ibbq_805a_temperature_probe_2") | round(0) }}F
      text2: G {{ states("sensor.ibbq_805a_temperature_probe_1") | round(0) }}F
    alias: meat temp
    enabled: true
mode: single

The Data text1 is the top segment 0
The Data text2 is the bottom segment 1

Shut off solar matrix automation

alias: "smoker on or off toggle  smoker matrix "
description: >-
  if smoker is running and over 120 turn on smoker matrix automation 
  automation. 

  if smoker is below 120 turn off smoker matrix automation
trigger:
  - platform: numeric_state
    entity_id: sensor.ibbq_805a_temperature_probe_1
    for:
      hours: 0
      minutes: 0
      seconds: 0
    above: 120
    id: "on"
  - platform: numeric_state
    entity_id: sensor.ibbq_805a_temperature_probe_1
    for:
      hours: 0
      minutes: 0
      seconds: 0
    below: 120
    id: "off"
condition: []
action:
  - choose:
      - conditions:
          - condition: trigger
            id:
              - "on"
        sequence:
          - service: automation.turn_on
            data: {}
            target:
              entity_id: automation.smoker
      - conditions:
          - condition: trigger
            id:
              - "off"
        sequence:
          - service: automation.turn_off
            data:
              stop_actions: true
            target:
              entity_id: automation.smoker
mode: single

Sometimes I have a cocktail sitting on the couch waiting for meat to be done. I forget to even look at the matrix so have a alexa and google notification when meat is almost done.

In my solar, time and weather matrix I have a “ Test if 1 condition does not match
“ to not run the automation if the Smoker matrix automation is running.
You can add multiple if you have other automations like notification like washer is done or it’s raining cats and dogs.
Solar, time, date and weather matrix

alias: Matrix living room solar 1
description: >-
  Displays Living room and outdoor temp along with time on main Seg 0 

  Seg1 used for messages and notifications or what ever is the flavor of the
  day. Like power and solar 
trigger:
  - platform: state
    entity_id:
      - sensor.time
condition:
  - condition: not
    conditions:
      - condition: state
        entity_id: automation.smoker
        state: "on"
action:
  - service: rest_command.wledseg1_text
    data:
      text1: "{{states['sensor.normalhour_time'].state}}"
      text2: >-
        Pwr use {{ states("sensor.power_use_now") | round(1) }}/{{
        state_attr('sensor.power_used_today_solar_and_pge','last_valid_state') |
        round(1) }}T, Slr {{ states("sensor.power_meter_pvs6m22492971p_power") |
        round(1) }}/{{ states("sensor.daily_solar_no_delta") | round(1) }}T
    alias: Time, weather and power1
    enabled: true
  - delay:
      hours: 0
      minutes: 0
      seconds: 31
      milliseconds: 0
  - service: rest_command.wledseg1_text
    data:
      text1: >-
        {{ states("sensor.station_temperature") | round(0) }}F/{{
        states("sensor.livingroom_temperature_am2301_temperature") | round(0)
        }}F, {{ states("sensor.date_and_time") }}
      text2: >-
        Pwr use {{ states("sensor.power_use_now") | round(1) }}/{{
        state_attr('sensor.power_used_today_solar_and_pge','last_valid_state') |
        round(1) }}T, Slr {{ states("sensor.power_meter_pvs6m22492971p_power") |
        round(1) }}/{{ states("sensor.daily_solar_no_delta") | round(1) }}T
    alias: Time, weather and power1
    enabled: true
mode: single



Time and weather one panel.
Here is a one matrix panel segment automation for my bedroom to show time and weather

alias: Matrix time bedroom
description: just the time updates when time changes every one minute
trigger:
  - platform: state
    entity_id:
      - sensor.time
condition: []
action:
  - service: rest_command.wled_text
    data:
      text: "{{states['sensor.normalhour_time'].state}}"
  - delay:
      hours: 0
      minutes: 0
      seconds: 41
      milliseconds: 0
  - service: rest_command.wled_text
    data:
      text: >-
        {{ states("sensor.station_temperature") | round(0) }}F/{{
        states("sensor.temperature1") | round(0) }}F, {{
        states("sensor.date_and_time") }}
mode: single

I know I might be forgetting some set up for WLED but there are plenty of youtube videos now showing how. There was none when I first did this.

Example video of time, date, temperature and solar info

BBQ grill and meat temps

3 Likes

Thank you for sharing my tutorial - I’m always great-full for the support. :pray:

I do have a 2nd tutorial, coming soon, for a Two 32x8 Matrix panels project- In a nice case too!!

Get subbed for that LOL

4 Likes

With @frenck spook random input text makes it easy without scripting to auto generate random messages on one segment the matrix. Using a input select list of love notes.

alias: matrix random
description: ""
trigger:
  - platform: time_pattern
    minutes: /16
    seconds: "1"
condition: []
action:
  - service: input_select.random
    metadata: {}
    data: {}
    target:
      entity_id: input_select.love_notes
  - service: rest_command.wledseg1_text
    data:
      text1: "{{states['input_select.love_notes'].state}}"
      text2: >-
        {{ states("sensor.station_temperature") | round(0) }}F/{{
        states("sensor.livingroom_temperature_am2301_temperature") | round(0)
        }}F, {{ states("sensor.date_and_time") }}
    alias: love notes matrix, with time
    enabled: true
  - delay:
      hours: 0
      minutes: 2
      seconds: 0
      milliseconds: 0
  - stop: ""
mode: single
1 Like

updated using the automation turn off to shut off another Matrix message automation already running. The way I have above glitches.

alias: matrix random
description: ""
trigger:
  - platform: time_pattern
    minutes: /25
    seconds: "1"
condition:
  - condition: time
    after: "07:00:00"
    before: "00:00:00"
    weekday:
      - wed
      - thu
      - fri
      - tue
      - mon
      - sun
      - sat
action:
  - service: input_select.random
    metadata: {}
    data: {}
    target:
      entity_id: input_select.love_notes
  - service: rest_command.wledseg1_text
    data:
      text1: "{{states['input_select.love_notes'].state}}"
      text2: >-
        {{ states("sensor.station_temperature") | round(0) }}F/{{
        states("sensor.livingroom_temperature_am2301_temperature") | round(0)
        }}F, {{ states("sensor.date_and_time") }}
    alias: love notes matrix, with time
    enabled: true
  - service: automation.turn_off
    metadata: {}
    data: {}
    target:
      entity_id: automation.time_and_weather_test
  - delay:
      hours: 0
      minutes: 2
      seconds: 0
      milliseconds: 0
  - service: automation.turn_on
    metadata: {}
    data: {}
    target:
      entity_id: automation.time_and_weather_test
  - stop: ""
    enabled: false
mode: single


1 Like