Master Home Assistant Templates: State Based Entities

  Рет қаралды 28,009

SlackerLabs

SlackerLabs

Күн бұрын

Master Home Assistant Temaplte and build your very own Home Assistant entities using state based templates. This video is long, but full of working examples from my own Home Assistant based smart home.
Links to things mentioned in the video:
YAML Shown in this video: github.com/thejeffreystone/Sl...
HA Template Docs: www.home-assistant.io/integra...
Sensor Device classes: www.home-assistant.io/integra...
Binary Sensor Device Classes: www.home-assistant.io/integra...
Third Reality Smart Button: amzn.to/3PYfHbe
Chapters:
00:00 - Intro
01:13 - The New, Old Way of Building Template Entities
06:30 - What is a State Based Template Entity?
07:19 - Real Examples of State Based Templates in Home Assistant
08:10 - Example - We Have a Problem Sensor
11:18 - Example - Button Monitor Entity
15:28 - Example - Is tomorrow a school day?
18:39 - Example - Using a Media Player as a Occupancy Sensor
21:26 - Example - Dynamic Occupancy Sensors
27:59 - Example - Countdown Sensor to a Date
32:28 - Example - Find Batteries that need Changing
Who am I?
My Name is Jeff. I am an DIY-er and Automator of boring things. And, of course, a huge Home Assistant fan. Oh, I also live in a house that tweets.
Follow Me:
Github - github.com/thejeffreystone
Twitter - / thejeffreystone / / slackerlabs
On the Web - slacker-labs.com/
Discord - / discord
And if you like this video you could always fuel my automation habit -
Grab SlackerLabs Merch: slackerlabsmerch.square.site
Use my Amazon Affiliate Links:
My Favorite Smart Home Tech: amzn.to/3QKFp3W
Gear I use my Smart Home: amzn.to/3R0kQ3F
Getting Started with Home Assistant: amzn.to/3PXayjw
Home Assistant Yellow Essential Gear: amzn.to/3LK4fgN
One Time Donation:
Paypal: www.paypal.com/paypalme/Slack...
Cash App: $slackerlabs
Buy me a coffee: www.buymeacoffee.com/icE6DeBut
Or use my Amazon affiliate link which provides a small commission on things you buy without additional cost to you - www.amazon.com/s/ref=as_li_ss...
Other Affiliate Links:
Music - Epidemic Sound: www.epidemicsound.com/referra...
Video Assets - LenoFx: i.refs.cc/CJXU6Da9?smile_ref=e...

Пікірлер: 46
@NunoSoares22
@NunoSoares22 10 ай бұрын
Excellent. It’s about time someone does it good and clear. Great work Jeff!
@clairerovic
@clairerovic 9 ай бұрын
I am so loving this range of videos. Casual HA user for five odd years. Have heaps of products & ideas though still stumble my way through many Automations 😅😂
@jaap7374
@jaap7374 3 ай бұрын
I noticed there is a link to a video in the home assistant documentation, but honestly, this video is (in my humble opinion) better for more people. You should add links to specific sections of the video to the corresponding section of the documentation.
@jickmagger7323
@jickmagger7323 6 ай бұрын
Great job! Thank you for sharing your knowledge!
@dariusvaitkus965
@dariusvaitkus965 10 ай бұрын
Amazing! Best video about templating. Thank you very much !
@mysticsilent
@mysticsilent 10 ай бұрын
Very nice explaination of all the template sensor uses. I was getting myself into this more and more but now I have many usecases to improve my smarthome. Thanks!
@TDHobbies
@TDHobbies 5 ай бұрын
I have been trying to get my Apple TV to show what is being watched and I found you while on my quest for a solution.
@johnnynobels
@johnnynobels 10 ай бұрын
Great video. As a beginner the new and legacy yaml format is confusing. Your video is a great help. Would like more explanation on state classes, domains, etc. with reference to official ha documentation
@niklasb2007
@niklasb2007 10 ай бұрын
Great!!
@SlackerLabs
@SlackerLabs 10 ай бұрын
Thank you!
@patrikfranzen4459
@patrikfranzen4459 10 ай бұрын
Tack!
@SlackerLabs
@SlackerLabs 10 ай бұрын
Thanks!
@uSlackr
@uSlackr 8 ай бұрын
This in great. Love the deep dive. I recently created my own template filter to handle a complicated calculation. I wonder if you could to that to make a date math function
@jaap7374
@jaap7374 6 ай бұрын
Can you update your templating playlist? You probably have the best templating instructions on KZfaq. A lot of information is covered and the playlist helps in finding the specific thing I'm looking for.
@SlackerLabs
@SlackerLabs 6 ай бұрын
Done. I need to get the next one done. But I have some other videos I will probably get out before that one.
@vetsus3518
@vetsus3518 10 ай бұрын
i think i love your videos more that you're explaining random (not random per the video) data for jinja... i searched forums forever trying to find 'next day' or even more for quite some time.. and the best i could come up with was essentially adding 86400 times the number of days to find that and in this video.... a string much shorter finds the same value.... do you have a discord? cuz i'm sure much of what i need could be solved with simply asking you and you'd know it. lol
@daveforrester61
@daveforrester61 10 ай бұрын
Great video walkthrough and explanations, but could you not write a script that changes the area of all the battery entities with a numeric value to "Critical Battery". I have 200 battery entities 😂
@SlackerLabs
@SlackerLabs 10 ай бұрын
Actually I bet we could. That's probably not a bad idea. I was just thinking it would easy to set the area when a new device was added. But now you got me thinking that's totally boring. We need to automate that!
@francoisgrandcollot1027
@francoisgrandcollot1027 8 күн бұрын
Hello, many thx for your youtube video. May I have some help ? I don't know how to establish a calculation made from 2 entities ie: entitie apparent power that divides entitie inverter voltage so as to know the current and declare it as a new entitie. Do you have a simple example? Sincerely
@hugh_martin
@hugh_martin Ай бұрын
New subscriber (and new HA user) here. Thanks to your template series, I’m steadily progressing in my template creation (and lots of re-writing). I’m wondering if you’ve installed any jinja extensions into vscode to make writing your templates easier/faster. If so, do you then just paste the code into the Template tab in the Developer tools? Or are there better ways to integrate jinja development via vscode? Thanks for all the great tips!
@SlackerLabs
@SlackerLabs Ай бұрын
I only use the HA extension in VS Code which just helps with syntax or auto complete. I'm actually not sure there are any good extensions. I should check. HA is getting some more template tools so that will make it easier to do these from the UI. And I totally need to get that vidoe on trigger based templates done.
@Tfmt100
@Tfmt100 3 ай бұрын
Hi! Nice content, thx! I'm struggling to find content about tasmota mqtt entitys without standard device class on HA (like MPU 6886 accelerometers/Gyros) and so, those entitys cant be shown on statistics with graphics. Could you give me some hint about how to solve it?
@marcelofranco4284
@marcelofranco4284 10 ай бұрын
Thanks a lot for your template videos!!! Question: Which mmWave sensors are you using? Do you like them or, in other words, would you buy the same sensors again? Best regards!
@SlackerLabs
@SlackerLabs 10 ай бұрын
Right now I have a mix. I'm using the everything presence sensors ( I have 3 now), the FP2 and the Roomsense IQ. I would buy the EP1 or the roomsense iq. Not sure I would buy the FP2. I like mmWave. All three have been reliable presence sensors. But the FP2 doesn't is lacking in the HA integration side.
@eugsmiley
@eugsmiley 10 ай бұрын
1:40 OMG! My confusion has a reason!?! [Shakes fist at the incomplete HA documentation]
@EsotericArctos
@EsotericArctos 10 ай бұрын
Where do templates save if you don't create a manual entry in Config.YAML?
@Saturn2888
@Saturn2888 Ай бұрын
Do you have a good video or spot in a video where you show how to automate light scenes? You talked about having lights turn on a certain way and then making 50 scenes then replacing those with a template. I have over 100 smart lights in every room of my house, and the way I've done it is to set a scene for the light color and brightness (normal, bright, late night). I'd like to automate the creation of those scenes. I thought I could setup a Number based on the weather (good for 3500K vs 5000K) and when turning on lights in a room, it references that number and sets brightness to 100%. Then for Late Night, I need to rethink it because it's custom per room with only some lights turned on and different colors. It's not for when I'm in the room either, just for when I need light but don't wanna wake myself up. Does that sound like the right way of going about it?
@MyHeap
@MyHeap 8 ай бұрын
I have an unrelated, related question. When you said you have sensors in your freezers to notify you. What sensors are you using? How are they connecting (wifi, BT, Zigbee, zwave, etc). I would like to monitor my own freezers this way. Joe
@SlackerLabs
@SlackerLabs 8 ай бұрын
Mine are Rf. Using 433mhz based sensors. I have a little sdr usb stick and talks to an HA addon to bring that data in. I have not tested if a zigbee sensor would work. I suspect the lining in the freezer might cause some Interference with some of the frequencies out there
@MyHeap
@MyHeap 7 ай бұрын
@@SlackerLabs thank you for the information. I appreciate it. For giggles I put an aqara temp sensor in my refrigerator to see if it would work. The short answer is no, it drops off the zigbee network. I suppose the radio is interfered with by the metal housing of the refrigerator. I am guessing it is likely shunting the signal to ground perhaps since the chasis and skin of the refrigerator is tied to ground. Thank you again. I am still kinda new with HA and you videos help. Joe
@martindebes7070
@martindebes7070 4 ай бұрын
The button monitor entity lacks a 'platform' statement. Or do i miss something?
@donireland6218
@donireland6218 9 ай бұрын
Nice! I found the examples of counting down the number of days until a specific date to be useful. How would you apply this to something where the date varies from year to year? Like Thanksgiving (the last Thursday in November), General election day (1st Tuesday after the 1st Monday in November) or Easter (I'm not even sure what kind of rule THAT would follow).
@traskth
@traskth 5 ай бұрын
Easter is the first sunday following the first full moon after the spring equinox
@donireland6218
@donireland6218 5 ай бұрын
@@traskth that knowledge doesn't help with the question asked -- unless you have a way to figure out when the first full moon is.
@traskth
@traskth 5 ай бұрын
@@donireland6218 it was asked what the rule was for easter, i was just stating what the rule was. I dont know how to apply countdown to a moving holiday, but im not great when it comes to jinja or HA templating
@donireland6218
@donireland6218 5 ай бұрын
@@traskth I was asking about the moving holiday. I only offered Easter as an example.
@MrMosvold
@MrMosvold 10 ай бұрын
Thanks for the video. Question. you have two call service to scripts; "script.cleanup_text" and "script.text_notify" in your example file scripts.yaml. But how does those script look like (or did I miss something)?
@SlackerLabs
@SlackerLabs 10 ай бұрын
The clean up one I talked about in the recent response variable video. The text notify one was talked about much longer ago than that. I need to do a better job of documenting my config.
@chrise666
@chrise666 10 ай бұрын
Thought I was following. I have this in template.yaml and what else do I need to do to create the binary sensor 'hose_on'? - binary_sensor: - name: hose_on delay_off: minutes: 20 state: > {{is_state('sensor.orbit_b_hyve_state','manual')}}
@SlackerLabs
@SlackerLabs 10 ай бұрын
That's looks right to me. Just make sure your indention is all lined up. And that you have three template: line in the configuration.yaml and your restarted HA after adding that configuration.yaml part
@chrise666
@chrise666 10 ай бұрын
Thanks @@SlackerLabs I just have this in configuration.yaml -> template: !include template.yaml
@rasbe6863
@rasbe6863 10 ай бұрын
The real question I have for you Jeff is why did you not make a days until Rex Manning day?
@SlackerLabs
@SlackerLabs 10 ай бұрын
And that is a really good question. To which I will now go question all my life’s choices up until now. And make that sensor
@rasbe6863
@rasbe6863 10 ай бұрын
@@SlackerLabs see only someone who has been following you and watching you for many years can understand the importance of Rex Manning day
@torfinnsrnes6232
@torfinnsrnes6232 10 ай бұрын
In my opinion the term template is quite misleading. A better term would have been dynamic processing.
Mastering Home Assistant Templates: A Beginner's Guide
23:56
SlackerLabs
Рет қаралды 48 М.
TOP 10 HACS Integrations and Frontend Components in Home Assistant
18:23
Summer shower by Secret Vlog
00:17
Secret Vlog
Рет қаралды 13 МЛН
Я обещал подарить ему самокат!
01:00
Vlad Samokatchik
Рет қаралды 9 МЛН
Why you SHOULD use Entity Controller over Automation (sometimes)
9:53
My top 5 contact sensor automations in Home Assistant
9:11
Smart Home Ideas
Рет қаралды 11 М.
The Smart Home Sensors I NEVER knew I needed!
11:47
Smart Home Solver
Рет қаралды 31 М.
Home Assistant Has Never Been This EASY!
11:58
Everything Smart Home
Рет қаралды 131 М.
Mastering Home Assistant Templates: Intro to Date and Time
36:16
SlackerLabs
Рет қаралды 19 М.
NEVER install these programs on your PC... EVER!!!
19:26
JayzTwoCents
Рет қаралды 3 МЛН
Scenes on Steroids in Home Assistant - How To - Tutorial
13:42
Smart Home Junkie
Рет қаралды 35 М.
Mastering Home Assistant Templates: We got Errors
19:45
SlackerLabs
Рет қаралды 7 М.
When to Use Home Assistant Automations, Scripts, and Scenes
7:08
Какой ноутбук взять для учёбы? #msi #rtx4090 #laptop #юмор #игровой #apple #shorts
0:18
Vision Pro наконец-то доработали! Но не Apple!
0:40
ÉЖИ АКСЁНОВ
Рет қаралды 88 М.
Как удвоить напряжение? #электроника #умножитель
1:00
Hi Dev! – Электроника
Рет қаралды 1,1 МЛН
Looks very comfortable. #leddisplay #ledscreen #ledwall #eagerled
0:19
LED Screen Factory-EagerLED
Рет қаралды 10 МЛН