From 672ebe32fb011d3d268e5688554551d6574c7e0f Mon Sep 17 00:00:00 2001 From: kyle Date: Wed, 31 Dec 2025 04:26:43 -0800 Subject: [PATCH] Add get-dashboard-urls.py --- get-dashboard-urls.py | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 get-dashboard-urls.py diff --git a/get-dashboard-urls.py b/get-dashboard-urls.py new file mode 100644 index 0000000..320a448 --- /dev/null +++ b/get-dashboard-urls.py @@ -0,0 +1,32 @@ +#!/usr/bin/env python3 +import urllib.request +import json + +TOKEN = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiI4NmM2ZGNlMTY2MWU0M2U5YjQ2MDI3MjMxYjE0NDFlMyIsImlhdCI6MTc2NzE3ODUyNiwiZXhwIjoyMDgyNTM4NTI2fQ.E8eShOsejwDYglixpgM_d_JYBlB1OVNhN7cHPnPiLOs" +HA_URL = "http://homeassistant.local:8123" + +url = f"{HA_URL}/api/lovelace/dashboards" +req = urllib.request.Request(url) +req.add_header("Authorization", f"Bearer {TOKEN}") + +try: + with urllib.request.urlopen(req) as response: + dashboards = json.loads(response.read().decode()) + print("="*60) + print("AVAILABLE DASHBOARDS:") + print("="*60) + for dash in dashboards: + title = dash.get("title", "Unknown") + url_path = dash.get("url_path", "") + dash_id = dash.get("id", "") + print(f"\nTitle: {title}") + print(f"Path: {url_path}") + print(f"Direct Link: {HA_URL}/{url_path}/0") + if url_path == "dashboard-kiosk": + print(" ⭐ This is your Kiosk Dashboard!") + print("\n" + "="*60) +except Exception as e: + print(f"Error getting dashboards: {e}") + print("\nTry these URLs directly:") + print(f" {HA_URL}/dashboard-kiosk/0") + print(f" {HA_URL}/lovelace/default_view")