Home Assistant Scripts Hidden Feature!

Поділитися
Вставка
  • Опубліковано 2 сер 2024
  • You may not be aware that you can define fields with your Home Assistant Scripts. These fields make it easy to create your own services. And with Home Assistant 2024.3, you can now interact with these scripts from your dashboard.
    In this video we will cover everything from what Fields are, How to setup a script to use fields, and how to edit existing scripts that might already be using parameters to use fields.
    Video References
    My Text Notify Script - github.com/thejeffreystone/ho...
    Video Chapters:
    00:00 - Home Assistant Scripts have a hidden feature you should be using - Intro
    00:54 - Prerequisites to follow along
    01:34 - What are fields in home Assistant Scripts?
    02:59 - Build a Home Assistant script that uses fields (Create a Script to add a todo)
    06:05 - Demo time - Using Fields with a Script to add a item to a todo list
    07:05 - Update an existing script to use fields - Modifying my text_notify script.
    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 -
    Buy a Slacker Labs T-shirt: slackerlabsmerch.square.site/
    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...
    Video Gear:
    Canon m50: amzn.to/3ftldPH
    Desk Mic: amzn.to/3wkum40
    Camera Mic: amzn.to/3tXk1cp
    Newer 660: amzn.to/3fwwejd
    Dazzne D50: amzn.to/3oGBK5y
    Audio Interface: amzn.to/3u07chK
    Gimble: amzn.to/3ouKAoe
    Music - Epidemic Sound: www.epidemicsound.com/referra...
    Video Assets - LenoFx: i.refs.cc/CJXU6Da9?smile_ref=e...
  • Наука та технологія

КОМЕНТАРІ • 19

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

    Nice tutorial Jeff! I've not really explored scripts very much and primarily use the visual editor for many of my automations but am working on getting more proficient with YAML I'm going to explore scripting a bit more. Thanks!

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

    Excellent video as always. Now I need to retweak my scripts.

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

    Great video today Jeff, thanks for sharing! 😊

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

    Very helpful subject and very good explained. Thank you!!!

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

    Can you use it to replace tap_action confirmation? E.g. currently I have a button to open the front gate, and a confirmation which triggers a popup "Are you sure?" (with OK/cancel buttons). Instead, I'd like to have 3 choices there: open, open&close, cancel (confirmation only allows for binary logic).

  • @jickmagger7323
    @jickmagger7323 3 місяці тому +1

    Is it possible to run a script with variables from lovelace in order to get a prompt to input the values?

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

      Not yet. I'm hoping. That gets added. But you could put an input select near the button on the dashboard and have the script read the value of that input select as the variable. That would give you a work around. Just requires knowing you need to pick one before hitting the button.

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

      @@SlackerLabs Is this how you got the window at 0:40 in your video? Is that a lovelace tile card you are using?

  • @PatrickDickey52761
    @PatrickDickey52761 5 днів тому

    Question. If I want three different actions based on conditions, I would create three automations, right? Say action if I'm not home, action 2 if I'm home and it's not quiet hours, and action 3, if I'm home and it is quiet hours.

    • @PatrickDickey52761
      @PatrickDickey52761 5 днів тому

      I'll clarify a bit more. I have an automation that turns on my outside lights if motion is sensed. If I'm away, I want to have it send me a notification and turn on the lights. If I'm home and quiet hours, then just turn on the lights. And, if I'm home and not quiet hours, announce over Alexa as well as turn on the lights.

  • @manliodiana2429
    @manliodiana2429 Місяць тому

    Hi i need help, i try to create a time filed to pass to a time condition like this:
    condition: time
    after: "{{ time_start }}"
    before: "{{ time_end }}"
    but i receve this error:
    malformed: Invalid time specified: {{ time_start }} for dictionary value @ data['sequence'][0]['if'][0]['after']
    @SlackerLabs eny suggestions?

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

    Can a field be populated with a list of items and be presented as a dropdown list in the UI?

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

      Not in the script functionality. But you could totally have a input select on a dashboard with the values you need to pass to the script under the script button. And then just have the script reference the current value of the input select for the value of the field.

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

      @@SlackerLabs thanks, I'll look into that!

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

    lucky me, I use core, so no editor other than SSH and nano. it's just as fun! /s

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

      edit: I have what you're showing, but I find myself in CLI editing stuff on occasion.

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

      @@DaveSomething that's more hardcode than me. Haha

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

      @@SlackerLabs it's been a learning experience, that's for sure

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

      The remote connections vs code plugin would work wonders for you