{
  "$schema": "https://legatobar.com/schemas/page.schema.json",
  "title": "Home Assistant",
  "icon": "house",
  "sources": {
    "home": {
      "url": "http://homeassistant.local:8123/api/template",
      "secret": "home-assistant",
      "every": "1m",
      "method": "POST",
      "body": {
        "template": "{{ {\"lights\": states.light | selectattr(\"state\", \"eq\", \"on\") | map(attribute=\"name\") | list} | tojson }}"
      }
    }
  },
  "cards": [
    {
      "id": "lights",
      "type": "list",
      "label": "Lights on",
      "source": {
        "ref": "home",
        "map": {
          "items": {
            "each": "lights",
            "template": "{$}"
          }
        }
      }
    }
  ]
}
