Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
66 changes: 66 additions & 0 deletions docs/products/m1/examples/share-data-from-home-assistant.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
---
title: >-
M-1 LED Matrix Setting up scrolling text with the states of Home Assistant
entities!
description: >-
Step by step guide for custom scrolling text using the states of Home
Assistant entities!
---
# Share Data from Home Assistant on your M-1 LED Matrix

!!! tip "This tutorial expects you to already have 4 segments created!"

Please follow <a href="https://wiki.apolloautomation.com/products/m1/setup/m1-segments/" target="_blank" rel="noreferrer nofollow noopener">this wiki article</a> to setup your M-1 LED Matrix with segments. If you are using multiple panels, <a href="https://wiki.apolloautomation.com/products/m1/setup/m1-multiple-panels/#segment-setup" target="_blank" rel="noreferrer nofollow noopener">follow this article</a> instead then come back!

The <a href="https://www.home-assistant.io/integrations/wled/" target="_blank" rel="noreferrer nofollow noopener">WLED integration for Home Assistant</a> does not support sending data from our devices directly to the M-1 LED Matrix, however, we are still able to do so using the <a href="https://mm.kno.wled.ge/interfaces/json-api/" target="_blank" rel="noreferrer nofollow noopener">WLED JSON API</a>. This is an advanced tutorial but if you follow each step closely you should be able to follow along!

1\. Install "Studio Code Server" <a href="https://github.com/hassio-addons/addon-vscode" target="_blank" rel="noreferrer nofollow noopener">from the addon store</a> in Home Assistant OS. Click Open Webui and navigate to your configuration.yaml file.

![](../../../assets/m1-navigate-to-configuration-yaml.gif)

!!! danger "This file is used by Home Assistant and must be careful edited"

Home Assistant requires this file to work properly so only make changes exactly as shown below. Do NOT add any extra spaces or change anything other than what is shown in the steps below!

## 🧩 WLED Matrix YAML Generator

<iframe src="/static/matrix-jinja-generator.html" width="100%" height="700" style="border: 1px solid #ccc; border-radius: 6px;"></iframe>

&nbsp;

2\. Copy the code below and paste it at the very bottom of your configuration.yaml file.

```yaml
rest_command:
matrix_all_segments:
url: http://10.10.10.176/json/state
content_type: 'application/json'
verify_ssl: false
method: 'post'
timeout: 20
payload: >
{
"seg":[
{
"id":0,
"fx":122,
"n": "{{state_attr('weather.nowcast','temperature')}}F {{states('weather.nowcast')|title}} FL: {{ states('sensor.feels_like') | round(0) | int }}F"
},
{
"id":1,
"fx":122,
"n": "{{ states('lock.front_door_lock') == 'locked' and 'Front Door Locked' or 'Front Door Unlocked' }}"
},
{
"id":2,
"fx":122,
"n": "CO2 {{states('sensor.brandon_air_1_co2') | int}}ppm VOC {{states('sensor.brandon_air_1_sen55_voc') | int}}ppm"
},
{
"id":3,
"fx":122,
"n": "Ping {{ states('sensor.1_1_1_1_round_trip_time_average') | float | round(0) | int }}ms {{ states('alarm_control_panel.alarmo') }}"
}
]
}
```
15 changes: 7 additions & 8 deletions docs/products/m1/setup/m1-general-tips.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@ description: Multiple helpful tips to use your M-1 LED Matrix to the fullest!
---
# General Tips

###### Known issues
The M-1 LED Matrix is using <a href="https://github.com/MoonModules/WLED-MM" target="_blank" rel="noreferrer nofollow noopener">WLED MoonModules</a> which is a fork of WLED that supports the Hub75 Matrix.

As of 6/25/25 these are the known issues with the firmware shipped with the device:
WLED uses <a href="https://wiki.apolloautomation.com/products/m1/setup/m1-segments/" target="_blank" rel="noreferrer nofollow noopener">segments</a> which allow you to create virtual led strips (or panels) of leds to control individually. This is useful in cases where you want to <a href="https://wiki.apolloautomation.com/products/m1/setup/m1-multiple-panels/#software-setup" target="_blank" rel="noreferrer nofollow noopener">connect multiple panels and have text scrolling across the screens</a>.

* <a href="https://github.com/MoonModules/WLED-MM/issues/243" target="_blank" rel="noreferrer nofollow noopener">unable to set default preset at boot</a> (only will boot to orange screen)
* randomly crashes after 1-2 days
* <a href="https://github.com/MoonModules/WLED-MM/issues/242" target="_blank" rel="noreferrer nofollow noopener">changing custom preset to effect does not work</a> unless you turn the leds off then back on (not power cycle).
* <a href="https://github.com/MoonModules/WLED-MM/issues/241" target="_blank" rel="noreferrer nofollow noopener">Error 11 not enough space after saving some presets</a>
* Once you edit a setting and save in the LED Preferences and go try to save again it will crash the device. <a href="https://chatgpt.com/share/685dba2e-3818-8010-8b44-592d802f0782" target="_blank" rel="noreferrer nofollow noopener">Workaround for now is to edit the json manually using ChatGPT.</a>
* <a href="https://github.com/MoonModules/WLED-MM/issues/247" target="_blank" rel="noreferrer nofollow noopener">Image and effects are shifted to the left by 1 column</a>
Segments are also able to be used to control two panels from one controller such as making the first segment a 64x64 panel and the second segment control second 64x64 panel.

The M-1 matrix is able to be controlled via the <a href="https://mm.kno.wled.ge/interfaces/json-api/" target="_blank" rel="noreferrer nofollow noopener">JSON API</a> and this allows to do some really neat things such as send data from Home Assistant to show up as "scrolling text" on your matrix. (Works best with 2 or 3 panels not 4 due to 32 characters available as scrolling text.

The M-1 Matrix can be controlled using the <a href="https://mm.kno.wled.ge/interfaces/json-api/" target="_blank" rel="noreferrer nofollow noopener">JSON API</a>, allowing you to do some really cool things like sending data from Home Assistant to display as scrolling text on the matrix. (For best results, use 1 to 3 panels instead of 4, as the scrolling text supports up to 32 characters.)
92 changes: 92 additions & 0 deletions docs/static/matrix-jinja-generator.htm
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
<h2>🧩 WLED Matrix YAML Generator (4 Segments)</h2>
<p>Select the entity type and enter the full Home Assistant entity ID. Example: <code>sensor.temp_living_room</code></p>

<form id="entity-form">
<div id="entity-entries"></div>
</form>

<h3>📝 Generated YAML:</h3>
<pre id="output" style="background:#1e1e1e;color:#dcdcdc;padding:1em;overflow:auto;border-radius:5px;"></pre>
<button onclick="copyYAML()">📋 Copy to Clipboard</button>

<script>
const defaultFX = 122;
const output = document.getElementById("output");
const entries = document.getElementById("entity-entries");

const exampleEntities = [
{ type: "weather", entity: "weather.nowcast" },
{ type: "lock", entity: "lock.front_door_lock" },
{ type: "sensor", entity: "sensor.brandon_air_1_co2" },
{ type: "alarm_control_panel", entity: "alarm_control_panel.alarmo" }
];

// Build 4 input blocks
for (let i = 0; i < 4; i++) {
const div = document.createElement("div");
const example = exampleEntities[i];
div.innerHTML = `
<fieldset style="margin-bottom:1em;border:1px solid #ccc;padding:1em;border-radius:6px;">
<legend>Segment ${i}</legend>
<label>Entity Type:
<select name="type" data-id="${i}">
<option value="sensor">sensor</option>
<option value="lock">lock</option>
<option value="alarm_control_panel">alarm_control_panel</option>
<option value="weather">weather</option>
<option value="other">other</option>
</select>
</label><br>
<label>Entity ID:
<input type="text" name="entity" value="${example.entity}" placeholder="e.g., sensor.temp_living_room" data-id="${i}" style="width: 300px;">
</label>
</fieldset>
`;
entries.appendChild(div);
}

// Update YAML output when inputs change
entries.querySelectorAll("input, select").forEach(el => {
el.addEventListener("input", updateYAML);
el.addEventListener("change", updateYAML);
});

function formatTemplate(entity, type) {
if (!entity) return "";
const name = entity.split(".")[1]?.replace(/_/g, " ");
switch (type) {
case "sensor":
return `{{ states('${entity}') | round(0) }} (${name})`;
case "lock":
return `${name}: {{ 'Locked' if is_state('${entity}', 'locked') else 'Unlocked' }}`;
case "alarm_control_panel":
return `Alarm: {{ states('${entity}') | title }}`;
case "weather":
return `Weather: {{ states('${entity}') | title }}`;
default:
return `{{ states('${entity}') }} (${name})`;
}
}

function updateYAML() {
const segments = Array.from(entries.querySelectorAll("fieldset")).map((fs, i) => {
const type = fs.querySelector('select[name="type"]').value;
const entity = fs.querySelector('input[name="entity"]').value.trim();
if (!entity) return null;
const template = formatTemplate(entity, type).replace(/"/g, '\\"');
return ` {\n "id": ${i},\n "fx": ${defaultFX},\n "n": "${template}"\n }`;
}).filter(Boolean);

const yaml = `rest_command:\n matrix_all_segments:\n url: http://10.10.10.176/json/state\n content_type: 'application/json'\n verify_ssl: false\n method: 'post'\n timeout: 20\n payload: >\n {\n "seg":[\n${segments.join(",\n")}\n ]\n }`;

output.textContent = yaml;
}

function copyYAML() {
navigator.clipboard.writeText(output.textContent).then(() => {
alert("YAML copied to clipboard!");
});
}

updateYAML();
</script>