Displaying custom HTML dashboards on Google Home with Home Assistant and AI | Alpha | PandaiTech

Displaying custom HTML dashboards on Google Home with Home Assistant and AI

Teaching an AI to generate HTML code, hosting the file locally, and 'casting' that dashboard view to smart screens like Google Home.

Learning Timeline
Key Insights

API Token Security Tips

When providing an API Token to an AI, ensure you are using a private session. If you are concerned about privacy, you can ask the AI to create a 'placeholder' in the code, then manually insert the token yourself into the HTML file.

Google Home Display Workaround

Google Home often struggles to display standard Lovelace dashboards. Using a locally hosted 'Custom HTML' method is the most stable way to display AI data without login issues or timeouts.
Prompts

Smart HTML Dashboard Generation

Target: Claude
I want you to act as an expert web developer for Home Assistant. Write a single-file HTML dashboard with embedded CSS and JavaScript. This dashboard should connect to my Home Assistant instance using an API Long-Lived Access Token. Create a clean UI that displays my current energy usage, living room temperature, and a daily greeting. Use modern dark-mode styling.
Step by Step

Workflow to Generate & Display an AI Dashboard on Google Home

  1. Open the Claude.ai or ChatGPT interface to start your code generation session.
  2. Provide a specific prompt to generate the HTML code for your desired dashboard (e.g., 'Create a minimalist HTML dashboard for Home Assistant').
  3. Navigate to your user profile in Home Assistant and scroll down to generate a 'Long-Lived Access Token'.
  4. Provide that API Token to Claude so the AI can integrate 'fetch data' functionality to pull real-time sensor data from Home Assistant into the HTML code.
  5. Copy the completed HTML code generated by the AI.
  6. Use the File Editor in Home Assistant to create a new file under the `/config/www/` directory (e.g., `dashboard_ai.html`).
  7. Paste the code into the file and click 'Save'.
  8. Access your Google Home device via the Home Assistant 'Media' tab or use the 'Google Cast' service.
  9. Enter the local URL of the file (e.g., `http://homeassistant.local:8123/local/dashboard_ai.html`) to cast it directly to your Google Home smart display.

More from Build & Deploy Autonomous AI Agents

View All