Try this hidden smart-automation trick

Поділитися
Вставка
  • Опубліковано 29 чер 2024
  • You can save the state of your entity and revert back to it when you need to undo what you did. There are four ways you can do this. The first is by using a helper input which can a single value. You can dynamically create a Scene which can save multiple attributes and revert back. If you are using node red you can use the Global Context which operates the same as scenes but is more programatic. And lastly you can leverage the Get History command which returns the history of an entity. You can used the historical value to revert.
    Chaperone
    Global Context - montaque22.github.io/#/global...
    Enjoying the content? Buy me a ☕️: bmc.link/mmontaque
    Or join this channel to get access to perks:
    / @technithusiast
    Gear I used for this video
    - Sony A7S iii: www.amazon.com/Sony-Mirrorles...
    - Aputure Light Dome: www.amazon.com/gp/product/B08...
    - Aputure Amaran 200X S: www.amazon.com/gp/product/B0B...
    - Neewer Heavy Duty Light Stand: www.amazon.com/gp/product/B08...
    DISCLAIMER: Links included in this description might be affiliate links. If you purchase a product or service with the links that I provide I may receive a small commission. There is no additional charge to you! Thank you for supporting me so I can continue to provide you with dope free content!
  • Наука та технологія

КОМЕНТАРІ • 17

  • @sdfhjklhsfdjdsflhkds
    @sdfhjklhsfdjdsflhkds 4 місяці тому +1

    Great topic and great video as always! I use both scenes and global context in a variety of Node-RED automations. But I also have a Fifth Beatle that you could add to the mix for special cases.
    The issue with most of these methods is that they don't survive HA reboots or power cycles (that said, history should be okay). For automations where I really, really need to 'for sure' be able to recover a previous state, I actually stuff whatever I want into an MQTT queue with an appropriate topic. I can then restore that later from MQTT if I have detected that HA has restarted (my MQTT server is running on a separate server with a beefy UPS).
    Maybe not the best way to use MQTT, but it's pretty simple to implement and doesn't require creating DB tables or anything else at a filesystem level. Easy to build and easy to maintain, which is important to me.
    Thanks again!

    • @technithusiast
      @technithusiast  4 місяці тому

      Thanks for sharing and I think the MQTT hack is clever!

  • @m4w
    @m4w 2 місяці тому

    Native automations can be set to run one at a time (change mode to Single). Any triggers while running will be ignored.

  • @PatrickBulteel
    @PatrickBulteel 4 місяці тому +1

    For the scene you're creating, couldn't the automation first check if that scene exists? If it does, it doesn't create/modify the scene? Then when the scene is restored, you delete it. Trigger fires again, "Oh, no scene"...

    • @technithusiast
      @technithusiast  4 місяці тому

      It never occurred that you could check for a scene. I guess since it die creat the entity I can theoretically check if that entity exists 🤔
      Thanks for the insight!!

  • @pannakoma
    @pannakoma 4 місяці тому +1

    Nice video! My problem with scenes created programmatically is that they are not persistent, so if HA needs to restart, the scenes created by the automations using the snapshot feature will be lost, and the next automation that wants to refer them after the restart will fail.
    As a workaround I ended up using input helpers, but those are not really suitable for storing entity states where multiple attributes need to be maintained. 😔
    Another “workaround” was simplifying automations. As an example, I have an automation that shuts off the AC in the room if the window is open for more than 10 minutes, then it would restore the AC’s previous state when the window is closed for more than 1 minute. I realized it is enough to just call the climate.turn_on service instead of applying the previous state as a scene, as the AC unit itself remembers what it was set to prior to power off.

    • @technithusiast
      @technithusiast  4 місяці тому

      You bring up very valid points! I think scenes should be used on a more transitory basis and not for long-term reverts. As a result I think your push’s to simplify automation is the right call. If you wanted a way to have a persistent method to hold a previous state i think home assistant may be able to writ data to its file system. (I did not confirm this though)

  • @a1dox
    @a1dox 5 місяців тому +1

    Great video Michael! How much time was recording vs post? Love the graphics.
    To minimize dependencies I try to do simple automations in HA, use Node Red for more complex ones and Node Red with heavy use of function nodes, for the most involved. I guess you have a fourth level with GPT on top of those. Do you have a similar hierarchy?

    • @technithusiast
      @technithusiast  5 місяців тому

      Hi, glad you like the visuals! I prefer using a single system but I’m finding that for some devices, they aren’t playing well with NodeRed so I use the native automations for those. For everything else I use node red and simplify things with subflows.

  • @Joseph-ko2kl
    @Joseph-ko2kl 4 місяці тому +1

    Very nice. Do not see the Chaperone link here however...

    • @technithusiast
      @technithusiast  4 місяці тому +1

      Thanks for the callout I’ll double check it!

  • @mareksv1947
    @mareksv1947 3 місяці тому

    I have unusual ''problem'" to solve😅 I have 2 power sources. One is on constant $/kw rate but other is dynamic rate. I want to plug my 2kw heat pump to dynamic rate source and it switches to constant $/kw source automatically when cost per kw on dynamic plan source exceeds certain value (0.13$/kw). There is very simple web page (excel sheet) with prices by hour for next 24h.
    What is the best way to put it all together?
    I was thinking plug both grids and heat pump to automatic switch that is made for generator backup use and trigger it via smart braker or smart plug. But how I could I program braker/smart plug to take data from web and automate it so I wouldn't have to look at web page with prices myself and put timers on smart plug? Maybe could use Zapier to scrape web page and put values in Home assistant app? I have no idea😅

  • @tedev
    @tedev 4 місяці тому +2

    Oh my god. This was seriously my first dislike to a video of yours and i don't even like that i disliked!!!! (amazing video editing by the way).
    i was starting to get bored with the scenes... and then.... you started mentioning GetHistory and i was like "OH MY FKING GOD IT IS HAPPENING! HE WILL EXPLAIN HOW TO MAKE AUTOMATIONS WITH GET HISTORY!" and then.... "bla bla blah.... LATER!" end of video.
    WHY!? everyone here is asking for bigger videos and more explanations on how to do the automations you are showing.
    i would prefer lower quality video editing for more effective and quality content on the videos.
    these videos are like "hey guys. did you know that you could do this with home assistant? well you can.... later!"

    • @technithusiast
      @technithusiast  4 місяці тому +2

      First of all, thank you for watching the video and secondly, Thanks for taking the time to provide feedback. 🙌🏾
      Im not sure if I understood everything but what I got was that you prefer less edited videos with deeper slower explanations? (Hopefully I got that right)
      I appreciate the feedback and will incorporate more thorough walkthroughs. I also have some in-depth tutorials out there but I’m not sure if everyone is seeing it (or perhaps they don’t find it interesting 🤷🏾‍♂️) For transparency there is something you and everyone that reads this should know about process behind the curtains.
      Some of my videos are created weeks to months in advance. If you provide feedback it may take weeks to months to see it to the videos with those changes, if the YT creator finds it applicable. This may hold true true for a lot of creators so we welcome your patience.
      There is also a tricky aspect to dissecting feedback on UA-cam. We can’t implement all feedback and often time I get conflicting feedback. Sometimes I have to commit to path that aligns with my goals to keep the channel going and other times I can split the difference. This may result in some videos appealing to one group more than another and you may find yourself in the “left out” group from time to time.
      The last fascinating observation is how your feedback is unfortunately sabotaged by others and perhaps UA-cam 🤔 For example you and a vocal minority may ask for longer in depth video. I may put out several in-depth videos but then the views on the videos are significantly smaller than the video you and others first raised concerns. Additionally, from those that watched the in-depth video I get little to no feedback. Coupled with the low views it seems like no one like the longer form. There is a disconnect between what people are saying versus where they spend their attention. Idk why this is. Maybe the majority really don’t want longer forms and you’re the minority, it could be that YT isn’t pushing it out, it could be that my content is trash. Idk really don’t know🤷🏾‍♂️ so it’s always a guessing game on the creator’s side.
      TLDR: Your concerns are heard! Please have patience as this takes a bit of nuanced balancing on our side.

    • @tedev
      @tedev 4 місяці тому

      @@makemakeishdude i literally supported @technithusiast in the last videos from other people that disliked his video!
      GTFO from here calling me a troll. I like this channel, i support his ideas and i believe that no one else is doing what he is doing.
      i even mentioned that i am willing to support him with his membership as long as the videos are TUTORIALS and not something that feels like a tiktok 15 second video!
      did you learn how to ACTUALLY do something from this video? can you do it? were the instructions clear for you on this video? no it wasn't because they were not there!

    • @tedev
      @tedev 4 місяці тому +1

      @@technithusiastthank you for your reply. yes.. this is what I would like to see in the future. "less edited videos (if it takes time from you) with deeper slower explanations" AND GUIDELINES.... because at the moment 90% of your videos just show nodes on node-red saying what they do.... but not HOW they do it. so if someone saw your videos..... they were not actually helpful but you are just passing down the idea, not the implementation.

    • @technithusiast
      @technithusiast  4 місяці тому

      I may not go into depth for all videos since not everyone appreciates them like you do. However I do provide Chaperone which contains copies of major automations to help folks who would like details see exactly the nodes I use and their contents. To help create/tailor videos that audience like, I introduce the concept (much like what you see in this video) and if there are people who ask for deeper tutorials, I add it to the list of content to create. This helps me spread interesting ideas without spinning my wheels creating things people don’t care for. Based on feedback from thousands of you, Most people simply like hearing the ideas and a minority wants an in-depth video. I do have a few questions for you.
      I don’t know if UA-cam is spreading all my videos as I have several videos (like the two below) which both goes into depth how the nodes work, and they have a link to chaperone where u can get a copy of the automation but they both have significant lower views from my average. Have you see these videos and do they fit your expectations?
      - ua-cam.com/video/oWP8es4g4D0/v-deo.html
      - ua-cam.com/video/T-cIfzZxTmc/v-deo.html
      I would like to know if UA-cam is skewing the experience for myself and the viewers.
      Lastly, you mentioned membership. There is a discord server available for members which provides a better line of communication and can get clarification on automations that aren’t clear. I’m trying to foster a community where members who have a more comfortable grasp on some automation ideas can help other others trying it out for the first time. This is still a work in progress but if it is something of interest, I would love to have you. Don’t feel obligated to join though as I am making changes to the server to make it more widely available with different levels of access.