ha-pyscript-converter

Convert Home Assistant YAML automations into pyscript Python files.

Updated Feb 18, 2026
One-click install
npx skills add https://github.com/gauravmm/HomeAssistant-pyscript-Conversion-Skill --skill ha-pyscript-converter
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ha-pyscript-converter
Source: https://github.com/gauravmm/HomeAssistant-pyscript-Conversion-Skill/tree/main/.agent/skills/ha-pyscript-converter
Command: npx skills add https://github.com/gauravmm/HomeAssistant-pyscript-Conversion-Skill --skill ha-pyscript-converter

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires pyyaml, and includes scripts (resource) and references (resource) components.

What problem does it solve?

Converts Home Assistant YAML automations into pyscript Python files, enabling a decorator-based approach to automation scripting and modernization.

Core Features & Use Cases

  • Analyze automations to cluster related ones by shared triggers and targets.
  • Generate pyscript skeletons (one file per group) and merge related automations into single functions.
  • Resolve device/entity UUIDs using stubs and optional UUID lookups, improving readability.
  • Provide reference mappings and patterns to guide conversion.

Quick Start

Run the analyzer on originals/automations.yaml to generate pyscript skeletons in tmp/ and review the results.

Frequently Asked Questions about ha-pyscript-converter

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I convert Home Assistant YAML automations to pyscript?

Converting Home Assistant YAML automations to pyscript involves running an analyzer script that reads YAML inputs, resolves entity UUIDs, replaces delays with task.sleep(), and outputs decorator-based Python skeletons for modern automation scripting.

What is the best way to group related Home Assistant automations during conversion?

The best way to group related Home Assistant automations is using the analyzer script, which clusters automations by shared triggers and targets, merging related YAML configurations into single pyscript Python functions.

Can I resolve Home Assistant device and entity UUIDs when migrating to pyscript?

Yes, you can resolve Home Assistant device and entity UUIDs when migrating to pyscript by using the built-in UUID lookup and optional stubs, which replace opaque identifiers with readable entity IDs in the generated Python code.

How does pyscript handle delays when converting from Home Assistant YAML?

When converting from Home Assistant YAML, pyscript handles delays by automatically replacing standard YAML delay statements with the asynchronous task.sleep() function in the generated Python code.

Do I need PyYAML to convert Home Assistant automations to pyscript?

Yes, you need PyYAML installed to convert Home Assistant automations to pyscript, as the tool depends on this library to parse and read your original YAML automation files from the originals/ directory.

Are there limitations when modernizing Home Assistant automations with pyscript?

Limitations when modernizing Home Assistant automations with pyscript include relying on provided reference mappings and optional stubs for accurate UUID resolution, meaning incomplete stub data may produce less readable entity IDs in the final Python skeletons.