Mastering Home Assistant Templates: Intro to Date and Time

แชร์
ฝัง
  • เผยแพร่เมื่อ 16 ต.ค. 2024

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

  • @tsangdanny
    @tsangdanny ปีที่แล้ว +4

    Great video. These types of videos bridge the gap from beginners and experts. Keep them coming.

  • @horatiuslavescu
    @horatiuslavescu ปีที่แล้ว +4

    Thank you, Jeff for these useful tips. About using 24h format, and ISO format: that's not a caveat at all, it is the normal and logic way to use. This format avoids any confusion.

  • @BeardedTinker
    @BeardedTinker ปีที่แล้ว +1

    Awesome Video Jeff!!!! I now just need a bit of time to check what I can improve ;)

  • @phea0001
    @phea0001 ปีที่แล้ว

    Thanks for the video. Just beginning my templating and scripting journey.
    Super helpful!! Looking forward to the next one.

  • @sekt1953
    @sekt1953 10 หลายเดือนก่อน +1

    Keep it up, you make some really good videos, but I need all your 'Master Home Assistant Template' videos to be grouped together so they're easier to follow when you get in the middle of a series, but really Thank you very much for the good videos.

  • @daveforrester61
    @daveforrester61 ปีที่แล้ว

    Brilliant, thanks Jeff. You're right, that is enough to be getting on with 😆. It has certainly increased my awareness of date and time entities. Looking forward to the next video in the series.

  • @davidmankin4500
    @davidmankin4500 ปีที่แล้ว

    Super helpful. Thanks. Even as an experienced python programmer I still get quite stuck doing this in home assistant, probably because there are at least three things going on and each has its own way of doing things: python, jinja2 filters, home assistant’s way of thinking about dates (sometimes strings, sometimes ints, sometimes dates, sometimes datetimes).
    Besides HA becoming more uniform, what would help me is some easier debugging tools. E.g. a jinja type-tagging filter that would print “datetime(2020-01-01 01:01:01)” or “str(2020-01-01 01:01:01)”. Then I would use this in the template tool to figure out what I have.

  • @rickz6006
    @rickz6006 ปีที่แล้ว +1

    Nice, saved as a reference for future tinkering. Date time math is always interesting due to formatting differences based upon the systen language. I once added a leap year test for a label applicator program so I could accurately set expiration dates on a bundle label due to Feb 29th and the year 2000 not being a leap year, the math interesting, had fun with it. This was in an Opto 22 Mystic processor.

    • @SlackerLabs
      @SlackerLabs  ปีที่แล้ว

      Yea. And I think the way home assistant does sensors makes harder since it’s not always clear when you are working with an actual date value that you can use date functions in versus a string of text that needs to be converted

  • @ChrisValcke
    @ChrisValcke 11 หลายเดือนก่อน

    Jeff, thanks for the great info (don't worry about video metrics, templates require a bit of effort :). look forward to next one in the template series..

  • @PatrickBulteel
    @PatrickBulteel ปีที่แล้ว +1

    Great video. One thing you should start looking at is the custom_templates directory which allows you to move your macros into a file in that directory. I've been moving a lot of the jinja (especially the ones that are "duplicated" around) into individual files and just calling them when I need them. Works really well.

    • @SlackerLabs
      @SlackerLabs  ปีที่แล้ว

      Yeah, I definitely need to take some time taking advantage of all the new stuff. So many recent improvements that will make life easier.

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

    Very informative, thank you! Love these type of videos, super helpful!

  • @mastweiler22
    @mastweiler22 ปีที่แล้ว

    Thank you for doing this series, it's being a great help!

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

    This was a great video, but I have a question for you, is it possible to change a helper date time from within a template? Is it possible to call the set date time service from a template?

  • @jagadeeshv2763
    @jagadeeshv2763 ปีที่แล้ว +1

    wow, nice video ... very helpful
    one help...... Using a template, how to get the max valve reached in a day from one sensor. ex: today's max temperature.
    I want to record it in Google sheet, but I don't know how to get it from the template

  • @Joseph-ko2kl
    @Joseph-ko2kl ปีที่แล้ว +1

    THIS IS VERY HELPFUL! THANKS

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

    Hey Jeff, I discovered recently your videos and I must say they are really great and super helpfull. Thank you very much for your GREAT work..
    Question: You mentioned at 08:30 that You have already done some previous videos with day time helpers, on how to use them to provide an easy way to update trigger time for automations, like your daily announcements. I want to build somthing similar to start my washing machine at a specific (triggered) time on a dashbord card. But I didn't found your viedeo with the day time helpers, could you please give me the link for this videos. Thank you very much.

  • @bgable7707
    @bgable7707 ปีที่แล้ว

    Can't wait to see the entities video !!!

  • @michaelhallmann1259
    @michaelhallmann1259 ปีที่แล้ว

    Awesome! Thanks for this video!

  • @TheCelticbeast
    @TheCelticbeast ปีที่แล้ว

    I think this may be just what I need.
    Is there a difference between a Boolean with a capitalized first letter and a lowercase? You have 'True' and 'true' as your outputs.

    • @SlackerLabs
      @SlackerLabs  ปีที่แล้ว +1

      In terms of what home assistant sees as true no. It does matter when testing the values in a if statement. Because case matters. But {{ 1==1}} would output as True but if I did it the long way and used an if statement and if 1==1 then true it wouldn’t technically be a Boolean type. Just a string that said “true” but in terms of a binary sensor either could be the output of a template and turn the binary sensor on.
      I prolly just made that more confusion. In python terms boolean types can only be True or False. Home assistant is a little more forgiving.

  • @adammourad1873
    @adammourad1873 ปีที่แล้ว

    Thank you Lewis! for the information, Great video! well done i have some media issues and CCTV that i don't know they don't work for me is it possible to get you to have look at for me please much appreciated

  • @MihaiKrieger
    @MihaiKrieger ปีที่แล้ว +1

    The main thing I noticed about these templates is that, first and foremost, you have to absolutely know EXACTLY what you intend to display, create or find out. Otherwise it gets very confusing very quickly if the end result is not clearly defined in your head.

  • @NunoSoares22
    @NunoSoares22 ปีที่แล้ว

    Superb Jeff!

  • @MaxGoddur
    @MaxGoddur ปีที่แล้ว

    I have become so frustrated with getting the ESP32-CAM and ESP32-CAM-mb functioning it has ruined two days of what is supposed to be fun.
    I run Home Assistant and ESPhome on my Windows 11 machine. I started by buying a few ESP32-CAM boards along with the motherboard (which contains the serial chip) called the ESP32-cam-MB.
    Plugged one into the USB port with my heavy-duty power hub and cable. Now I don't pretend to understand all the htpps security setup part of using serial port but followed the suggestions with in ESPhome.
    OK hardware connected was step 1.
    Step 2: open Home Assistant in my web browser.
    Step 3: Open ESPhome and click on the green button labeled "+ NEW DEVICE".
    A screen comes up informing I am not running https so alternatively I can use "ESPHome Web" to prepare a device for being used with ESPHome using this computer."
    Step 4: OPEN ESPHOME WEB
    This step opens a new window in your browser and says:
    ESP Device
    Connect the ESP32 or ESP8266 to your computer and click on connect to start managing your device
    I select CONNECT (only option is to select is connect)
    I am then presented with another screen stating
    Web.esphome.io Wanst to connect to a serial port.
    Just below the above information is my serial port.
    USB2.0-Ser!(com3)-paired
    The only option now is to select the port and press CONNECT.
    I am presented with another small dialog box stating:
    web.esphome.io says:
    Failed to execute 'open' on 'SerialPort': Failed to open serial port.
    I have tried new drivers, new beefed up USB hub with 5 amps capability, different tested cables and finally multiple ESP-32-cam and ESP32-cam-md's.
    If anyone one knows of a solution I would love to hear about it also I have searched via google for videos and write up to no avail.
    Thank you.
    PS some suggestions were to hold down the boot button while powering on that did not yield any positive results.
    While others suggested holding down the boot and IO buttons release one aft the other did nothing to resolve the issue.

  • @davidmankin4500
    @davidmankin4500 ปีที่แล้ว

    Thanks!

  • @niklasb2007
    @niklasb2007 ปีที่แล้ว

    Thanks

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

    Home Assistant time triggering is the most annoying and complex thing ever. Why can't i just simply select weekdays and times as a trigger?? That is almost impossible to do, but so basic automation like i want to do something on weekdays at 7 am and at weekends at 8 am, and also want my automation to work if i press a physical button... That shouldnt be that complex...

  • @jmr
    @jmr ปีที่แล้ว +2

    I should have saw that "now" clip coming. 🤦‍♂️
    Now is complicated subject. He could have spent 8 hours on this and not covered everything. Excellent starter though.

    • @SlackerLabs
      @SlackerLabs  ปีที่แล้ว +1

      So the original script had way more references to that... haha

    • @jmr
      @jmr ปีที่แล้ว +2

      @@SlackerLabs I told Franck Nijhof his " Swartz is as big as mine" the other day on the live. He was clueless what that meant. 😆

    • @SlackerLabs
      @SlackerLabs  ปีที่แล้ว

      Haha. I thought everyone knew Mel Brooks’ Movies word for word?
      Maybe it’s just me. I prolly shouldn’t mention my shop vac is named MegaMaid. Cause I can switch her from suck to blow…