wonderslug / MMM-HomeAssistantDisplay

A Magic Mirror Module to display information from Home Assistant.
MIT License
83 stars 6 forks source link

Wrong examples Can you please update #2

Closed thundergreen closed 2 years ago

thundergreen commented 2 years ago

Hello I added exactly your examples but it is like some commas or sign are missing and i cannot firgure it out. Can you please recheck you example for the windows sensors as it does not work. Behind the port there must also be a comma for example. But a ai am not familiar with the json I freak out here :P

holdestmade commented 2 years ago

Got this working. Add a comma after port and this is working:

let perimeterWindowSections = [];
perimeterWindows.forEach((item, i) => {
    perimeterWindowSections.push({
        triggerEntities: [
            item.entity
        ],
        displayTemplate: `
        {% if states.${item.entity}.state == "on" %}<i class='mdi mdi-window-open'></i> ${item.name}{% endif %}
        `,
        class: "window"
    })
})