Master Home Assistant Templates: State Based Entities

แชร์
ฝัง
  • เผยแพร่เมื่อ 24 ก.ค. 2024
  • 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...
  • วิทยาศาสตร์และเทคโนโลยี

ความคิดเห็น • 45

  • @clairerovic
    @clairerovic 9 หลายเดือนก่อน +2

    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 😅😂

  • @NunoSoares22
    @NunoSoares22 9 หลายเดือนก่อน +5

    Excellent. It’s about time someone does it good and clear. Great work Jeff!

  • @jaap7374
    @jaap7374 2 หลายเดือนก่อน +2

    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 9 หลายเดือนก่อน

    Amazing! Best video about templating. Thank you very much !

  • @mysticsilent
    @mysticsilent 9 หลายเดือนก่อน

    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!

  • @niklasb2007
    @niklasb2007 9 หลายเดือนก่อน +1

    Great!!

    • @SlackerLabs
      @SlackerLabs  9 หลายเดือนก่อน

      Thank you!

  • @johnnynobels
    @johnnynobels 9 หลายเดือนก่อน +1

    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

  • @patrikfranzen4459
    @patrikfranzen4459 9 หลายเดือนก่อน

    Tack!

  • @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.

  • @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 TH-cam. 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.

  • @EsotericArctos
    @EsotericArctos 9 หลายเดือนก่อน +1

    Where do templates save if you don't create a manual entry in Config.YAML?

  • @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?

  • @MyHeap
    @MyHeap 7 หลายเดือนก่อน +1

    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  7 หลายเดือนก่อน +1

      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

  • @marcelofranco4284
    @marcelofranco4284 9 หลายเดือนก่อน +1

    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  9 หลายเดือนก่อน +1

      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.

  • @vetsus3518
    @vetsus3518 9 หลายเดือนก่อน

    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

  • @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?

  • @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  24 วันที่ผ่านมา +1

      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.

  • @MrMosvold
    @MrMosvold 9 หลายเดือนก่อน

    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  9 หลายเดือนก่อน

      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.

  • @martindebes7070
    @martindebes7070 3 หลายเดือนก่อน

    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 หลายเดือนก่อน +1

      @@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.

  • @daveforrester61
    @daveforrester61 9 หลายเดือนก่อน +1

    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  9 หลายเดือนก่อน +1

      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!

  • @chrise666
    @chrise666 9 หลายเดือนก่อน

    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  9 หลายเดือนก่อน +1

      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 9 หลายเดือนก่อน

      Thanks @@SlackerLabs I just have this in configuration.yaml -> template: !include template.yaml

  • @eugsmiley
    @eugsmiley 9 หลายเดือนก่อน

    1:40 OMG! My confusion has a reason!?! [Shakes fist at the incomplete HA documentation]

  • @rasbe6863
    @rasbe6863 9 หลายเดือนก่อน

    The real question I have for you Jeff is why did you not make a days until Rex Manning day?

    • @SlackerLabs
      @SlackerLabs  9 หลายเดือนก่อน +1

      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 9 หลายเดือนก่อน +2

      @@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 9 หลายเดือนก่อน +1

    In my opinion the term template is quite misleading. A better term would have been dynamic processing.