Home Assistant Jinja Templates | Build Your Own Sensors @SmartHomeJunkie
Home Assistant Jinja Templates | Build Your Own Sensors  @SmartHomeJunkie
Uploaded July 2024 | Updated December 2026, 1 day ago
Stop guessing which lights are still on.
In Episode 7, we build Home Assistant template sensors that show counts and exact light names.

Welcome to Episode 7 of my YAML & Jinja templating course for Home Assistant. In this tutorial, you’ll learn how to create template sensors in two ways:

✅ Template Helper sensors (quick + easy)
✅ Advanced template sensors in templates.yaml (with attributes)

What you’ll build in this episode
* A template sensor that shows the number of lights on
* An attribute list that shows which lights are on
* A per-room template sensor (bonus): how many lights are on in a specific area (like Office)
* A clean Markdown card to display everything on your dashboard

Topics covered
* Template helper vs advanced template sensors
* Creating templates.yaml and linking it in configuration.yaml
* Using unique_id, icon, and attributes
* Reloading Template Entities
* Jinja filters: selectattr, rejectattr, map, list, count, sort
* Dashboard output using a Jinja for-loop

If you want to level up your Home Assistant automations, dashboards, and scripts, template sensors are a must-have—and this episode makes them click.

📌 Recommended Viewing: Make sure you’ve watched Episodes 1-6 for a complete understanding of loops, math, date/time, and filtering in Jinja. Playlist link: youtube.com/playlist?list=PLKuGrHcHLKMiUTClEE8vb60m9v3ijFEhQ

💖 Support this channel via Patreon, Ko-Fi, or channel membership to help continue these Home Assistant tutorials. Don’t forget to like, subscribe, and comment with your custom sensor creations!

⭐ You can download all the code that I created for the course at: ko-fi.com/s/84ab3c5875⭐

Links referred to in this video:
* The YAML and Jinja Course Playlist: youtube.com/playlist?list=PLKuGrHcHLKMiUTClEE8vb60m9v3ijFEhQ

Blog version: smarthomejunkie.net/yaml-jinja-templating-course-episode-7-create-your-own-sensors

👉 Get the desktop clock/message ticker that I use in the video: youtu.be/N0NKPJzGHuA

⭐⭐⭐
* Join this channel to get access to perks: 📺 youtube.com/c/smarthomejunkie/join
* Please consider becoming my patron 🏅 at patreon.com/join/smarthomejunkie
* Or please support me by buying me a ☕ at ko-fi.com/smarthomejunkie
* Or sponsor me through PayPal at paypal.me/smarthomejunkie
⭐⭐⭐

⭐ If you want me to create a review of your product, please visit this page for information and rates: smarthomejunkie.net/review-and-advertisement-information ⭐

My Devices: github.com/smarthomejunkie/MyDevices

Instagram: instagram.com/smarthomejunkie
X: x.com/smarth0mejunkie
Mastodon: https://mastodon.world/@smarthomejunkie
Facebook: facebook.com/smarthomejunkie
TikTok: tiktok.com/@smarthomejunkie
Discord: discord.gg/at8v5hW

00:00:00 Introduction
00:01:18 How do you create your own sensor in Home Assistant?
00:01:23 Deploying a Template Helper
00:03:27 Creating advanced templates
00:03:44 Install Studio Code Server or File Editor
00:06:04 Adding your first sensor
00:07:56 What lights are exactly on?
00:09:07 What lights are on in a specific room?
00:10:02 Show the values of a custom template sensor on a dashboard
00:11:53 Outtakes

#HomeAssistant #YAML #Jinja #TemplateSensor #HomeAssistantTutorial
#SmartHome #HomeAutomation #HomeAssistantDashboard #TemplateEntities #ESPHome
Home Assistant Jinja Templates | Build Your Own SensorsHome Assistant 2026.9 Beta: The Feature That Finally Explains What HappenedUnlock the Hidden Weather Forecast in Home Assistant
Smart Home Junkie |

Home Assistant Jinja Templates | Build Your Own Sensors

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER