Top 200 ReposEXPLORER
Browse agents, categories and pages
Back to results
Planned, not doneThe source describes an intention, not a finished result.

Create Scripts to Operate Smart Home Lighting

Overview

Ask ChatGPT to draft a Home Assistant script in YAML that switches or dims your lights, then check it, paste it into Home Assistant and run it yourself while you watch.

Problem or Objective

More in Home and Devices

AI Agents and Models

Tools and Integrations

Tools
ChatGPT · Home Assistant
Prerequisites
A running Home Assistant installation with the lights already added.

How It Works

Home Assistant is one way to build this: it runs scripts that turn lights on and off. Collect the light entity IDs from your Home Assistant setup (for example light.ceiling) and decide what the script should do: which lights, what brightness, and in what order. Ask ChatGPT for a Home Assistant script in YAML with a sequence of steps such as light.turn_on and light.turn_off, using only the entity IDs you gave it. Read the YAML before using it and check every entity ID and action. Paste it into a new script in Home Assistant, save it, and start it yourself from a dashboard while you watch the lights. By default, if a step fails, Home Assistant stops the script and logs the error; paste the error into ChatGPT and ask for a corrected version. Only after it works when you start it by hand should you call it from an automation.

Implementation Workflow

Steps assembled from the agents, tools and prompt of this entry. Adapt them to your own setup.

  1. Choose the agentSet up ChatGPT.
  2. Connect the toolsConnect the tools this workflow relies on: ChatGPT, Home Assistant.
  3. Check the prerequisitesA running Home Assistant installation with the lights already added.
  4. Gather your detailsCollect what the prompt asks for: Script name, What the lights should do, Light entity IDs.
  5. Run the starter promptPaste the starter prompt below into ChatGPT and adapt it to your case.
  6. Check against the documentationCompare what you get with the documentation at home-assistant.io before you rely on it.

Practical Starter Prompt: Write a Home Assistant lighting script

Fill the fields to adapt the prompt. Empty fields stay as visible [placeholders].

Preview
Write a Home Assistant script in YAML named [Script name]. It should [What the lights should do]. Use only these light entity IDs: [Light entity IDs]. Use the light.turn_on and light.turn_off actions, with brightness values where needed, and give each step a short alias. Do not invent entity IDs or actions; if my request needs information you do not have, ask me. After the YAML, describe each step in plain words so I can check it before I paste it into Home Assistant and run it myself.

Check every entity ID and action before saving. Run the script yourself from a dashboard while you watch the lights before calling it from an automation.

Expected Results and Benefits

This is a suggested workflow, not a reported result. The points below are what the cited documentation says the tools can do.

This is a suggested workflow, not a reported outcome. Home Assistant's documentation explains that a script goes through its sequence of actions, such as turning on a light, when you start it, and shows the YAML format for those steps; the ChatGPT homepage presents it as a tool for coding with AI. No cited page shows ChatGPT connecting to Home Assistant directly, so here ChatGPT only writes the text and you install and run the script.

Limitations and Considerations

ChatGPT can invent entity IDs or actions that do not exist in your setup, so check the YAML before saving it. Keep wall switches or the Home Assistant app as a manual fallback. Do not paste access tokens, passwords or your address into the chat. By default Home Assistant stops a script when a step fails and logs the error. Results depend on your setup and were not independently reproduced by Top 200 Repos.

GitHub Repositories

Suggested Implementation Component

A repository that could serve as a building block. It is not part of the cited account and is not evidence that the workflow was run.

Sources

  1. Building blocks in automations and scripts - Home Assistant (opens in a new tab)

    Project documentation · home-assistant.io · Undated · Source checked 27 Nov 2026, 04:53 UTC

    What this source supports
    • An action makes something happen, for example, turning on a light or sending a notification.
    • A script has no conditions section, so it goes through its steps under Sequence right away; a script runs when you start it, for example from a dashboard, from an automation, or with Assist.
    • By default, an automation or script stops when a step fails; the run is marked as failed and the error is logged.
  2. home-assistant/core README (opens in a new tab)

    Project documentation · github.com · Undated · Source checked 26 Nov 2026, 23:34 UTC

    What this source supports
    • Open source home automation that puts local control and privacy first.
  3. ChatGPT: Chat, Work, Create & Code with AI (opens in a new tab)

    Project documentation · chatgpt.com · Undated · Source checked 25 Nov 2026, 11:59 UTC

    What this source supports
    • ChatGPT presents itself as a place to chat, work, create and code with AI.
Report a problem

More with ChatGPT

Planned, not done

Find SEO Defects and Suggest Technical Remediation

Crawl your own website with Firecrawl, attach the exported pages to ChatGPT, and ask it to list technical SEO problems and draft the code changes you would make.

help.openai.com
Planned, not done

Draft a Congressional USCIS Casework Request

Use ChatGPT to organise the facts of your own pending immigration case and draft a short letter asking your elected representative's office for casework help, which you check, sign and send yourself.

help.openai.com
Planned, not done

Review Connected Workout and Blood Pressure Trends

Connect Apple Health to ChatGPT Health and ask for a plain summary of your own running and blood pressure trends, with questions to take to your doctor rather than a diagnosis.

openai.com · 7 Jan 2026

View all: ChatGPT