Writing Home Assistant automation YAML from scratch is slow and easy to get wrong. Even if you know the structure, the syntax for triggers, conditions, and actions varies enough that a small mistake means nothing fires and you spend 20 minutes working out why.
This generator gives you a working YAML scaffold for 27 common automation types. Pick a template, fill in your entity IDs, and paste it into HA. The structure is already correct. You are just replacing the placeholders.
Generate Your Automation YAML
Select a template from the dropdown, click Generate, then replace every ALL_CAPS placeholder with your real entity ID. Run the output through the YAML Validator before pasting into HA if you want to confirm syntax first.
Home Assistant YAML Generator
Choose an automation template, fill in your entity IDs, and get copy-paste ready YAML
Where to Find Your Entity IDs
Go to Developer Tools → States in your Home Assistant sidebar. Every entity in your system is listed there with its full entity ID, for example light.living_room_ceiling or binary_sensor.front_door. Search by room name or device type to find what you need. Copy the entity ID exactly as shown, including the domain prefix before the dot.
Template Categories
The 27 templates cover the most common Home Assistant automation patterns across six categories.
- Lighting: Sunrise and sunset triggers, motion-activated lights with a timeout, presence-based lighting scenes, and time-based brightness adjustments.
- Security and alerts: Door and window open notifications, lock state monitoring, motion alerts while away, and camera detection triggers.
- Presence and arrival: Welcome home automations, away mode triggers, and household presence tracking.
- Notifications: Mobile push notifications, TTS announcements on speakers, and condition-based alert routing.
- Climate and energy: Thermostat adjustments based on presence or time, HVAC mode switching, and energy monitoring thresholds.
- Morning and evening routines: Time-of-day scene activations, morning briefing triggers, and end-of-day shutdown sequences.
Tip: After generating, run your YAML through the YAML Validator before pasting into HA. It takes 10 seconds and catches any issues introduced during placeholder replacement.
Found this useful? This generator is free and always will be. If it saved you time building automations, consider supporting the network.
Support the Network →