HIDDEN Home Assistant GEM

Поделиться
HTML-код
  • Опубликовано: 29 окт 2024

Комментарии • 82

  • @SmartHomeMakers
    @SmartHomeMakers  2 года назад

    Use my link bit.ly/SmartHomeMakersDCMar22 and check out the first chapter of any DataCamp course for FREE to unlock new career opportunities and become data fluent today!

  • @jjcarrion2
    @jjcarrion2 2 года назад +2

    This is super powerful!! I didn't know how to integrate this kind of scripts into home assistant and I think that with this, there is no limit, thanks for this tutorial!

    • @SmartHomeMakers
      @SmartHomeMakers  2 года назад

      I agree with you Jose! seems worth looking into python!

    • @ptrkmr
      @ptrkmr 9 дней назад

      When you integrate without a limit don't forget to add your "+ C"

  • @Donly1pt
    @Donly1pt 2 года назад +3

    Very good explanation. Syntax looks simpler than templating, or at least more similar to what I'm used to.

    • @SmartHomeMakers
      @SmartHomeMakers  2 года назад

      Thanks Filipe!

    • @lwizinski
      @lwizinski 2 года назад +1

      So many times I've said, I know how to do what I want to do in Python, but I don't get how to do in HA...

  • @RobinDeBecker
    @RobinDeBecker 2 года назад

    My first steps creating something from scratch in Python. Need to have a closer look at it as I do not use smart bulbs, but smart dimmable wall switches...

    • @SmartHomeMakers
      @SmartHomeMakers  2 года назад +1

      Hi Robin! Think that you can create any home assistant service with python!

  • @TomTheDutchy
    @TomTheDutchy Год назад

    Hi, great video. How would you go about makin API calls for example energieprices? Where would you store the data?

  • @KrastyoKrastev
    @KrastyoKrastev 2 года назад

    another great video! :) and I love Python. Did not know I can use it in HA :) Thanks!

  • @boomsig9069
    @boomsig9069 2 года назад

    Extremely powerful hidden gem and easy to follow tutorial. Fantastic job!

  • @mikeb1578
    @mikeb1578 2 года назад

    i want to control a group of lights and only the lights that are on. but it seems not the full api is available. no expand etc etc. or do you know a way? i hate the yaml stuff. it is cumbersome. so my question is how to implement dimming of a helper group of lights. but only dim the lights that are off. i implemented it in a script but can not get it to work in python script

  • @MagicJF
    @MagicJF Год назад

    Question:
    ¿Are this scripts being interpreted on HA server, or is there some sort of C++ translation and compiling into the sensors/ESP devices?
    In short, I would like to know if the automation scripts will keep running if internet service goes down.

  • @uSlackr
    @uSlackr 2 года назад

    this is fabulous! Question - when might I use a a service like this vs a script? Is it simply a matter of being able to use a real scripting language vs yaml?

    • @SmartHomeMakers
      @SmartHomeMakers  2 года назад +1

      Because Python is much more powerful you can write fewer lines of code to achieve something the sky is the limit !

  • @FrankGraffagnino
    @FrankGraffagnino 2 года назад

    very cool. thanks for sharing! this is powerful for python programmers. which is a lot of people.

  • @jcdock
    @jcdock 2 года назад

    This is an awesome feature. Python is very powerful language

  • @Max-ph5in
    @Max-ph5in 2 года назад

    Can you slowly dim a pir triggered zigbee light (say in the toilet) so that as the later it gets, the dimmer it gets? I've tried some static dimming while the light is not 'ON'. But it looks like it needs to be on to change the value in the light?

    • @SmartHomeMakers
      @SmartHomeMakers  2 года назад

      Hi Max, I think you can, think of the inputs you need for your function and the output

  • @austenpsmith
    @austenpsmith 2 года назад

    Would there be any benefit in using python over the yaml interface for something like this or would this really be for something more complex or just personal preference?

    • @SmartHomeMakers
      @SmartHomeMakers  2 года назад

      Personal preference is key, the more complex the piece of code it might be easier to write it in Python , consider future expandability also!

  • @AntonioVillanuevaB
    @AntonioVillanuevaB 2 года назад

    Great video!!! Thanks! 😁

  • @zigajamnik
    @zigajamnik 2 года назад

    Hi,
    i receive an error when trying to run this script. what is wrong?
    ERROR (SyncWorker_14) [homeassistant.components.python_script.light_fading.py] Error executing script: Not allowed to access HomeAssistant.service

  • @ptrkmr
    @ptrkmr 9 дней назад

    "This involves no programming knowledge"
    *starts subliminally teaching how to program so people don't think they need to program*

  • @Hookbeak
    @Hookbeak 2 года назад

    Confused here - services.yaml doesn't exist in my home assistant - i created one but it's not picked up by anything.
    can you explain where services.yaml is supposed to be and how to make that entire section work?

    • @Hookbeak
      @Hookbeak 2 года назад

      Figured it out - has to be created in the python_scripts folder

    • @SmartHomeMakers
      @SmartHomeMakers  2 года назад

      Hey Andrew! Glad you figured it out :) is it all working now?

  • @okanerdem
    @okanerdem 2 года назад

    Thanks for the great video. I've a question for another topic. I'm using MFA for homeassistant. Each login, i have to use code to login. There is a way to add trusted device? I tried some of things but i could not. On my iphone devices it's not needed. I can login without any code

    • @SmartHomeMakers
      @SmartHomeMakers  2 года назад +1

      Hi Okan! Is your HA externally exposed?

    • @okanerdem
      @okanerdem 2 года назад

      @@SmartHomeMakers First of all thanks for the answer, How can i to be sure for this? Normally i'm trying to logon from local network (192.168.1.x) if i enabled mfa on HA, i have to write security code for each login. I've a vpn server in home and for remote access will connect by vpn but right now trying from local network :)

    • @SmartHomeMakers
      @SmartHomeMakers  2 года назад +1

      @@okanerdem Thank you for watching! The reason I was asking was your risk profile is if MFA was worth the potential hassle in your case. If you can access HA outside your network / away from home or not. I haven’t seen a way to add trusted devices at this moment !

    • @okanerdem
      @okanerdem 2 года назад

      @@SmartHomeMakers Actually the main point of my question is that, if i connected to local network, there is a way/solution to pass mfa code? Because always i have to login with mfa pass. What i want to do, if i connected to my homenetwork, I don't want to have to do any validation. For example, i'm using synology nas with mfa but i login with mfa only first login. It's not needed to login again with mfa authentication code if i conneted with same device and with same network but if i open the synology web browser with hidden mode on chrome (for example) it's asking again authentication code. I want to use same with HA. But for HA, I have to write pascode for each login. But strange, on my mobile phone, i can login directly without any passcode. Sorry for my bad english, I may have mis-phrased :)

    • @SmartHomeMakers
      @SmartHomeMakers  2 года назад +1

      @@okanerdem It makes sense what you are saying don't worry about the English. I don't have MFA turned on so can't really help

  • @thebaldfox
    @thebaldfox 2 года назад

    Another good tutorial !

  • @catfish9873
    @catfish9873 2 года назад

    Thanks!

  • @amirhoseinakbarzadeh5088
    @amirhoseinakbarzadeh5088 2 года назад

    Perfect👌

  • @mikeerdely7248
    @mikeerdely7248 2 года назад

    You want to make sure current_brightness is not 0, or you'll get a divide by zero error.

  • @thngzys
    @thngzys 2 года назад

    Are we able to do network calls with services?

    • @SmartHomeMakers
      @SmartHomeMakers  2 года назад +1

      API calls? Made another video about that :)

    • @thngzys
      @thngzys 2 года назад

      @@SmartHomeMakers nice. Time to binge watch. It's also applicable to services?

  • @NoProblem76
    @NoProblem76 2 года назад +1

    Gee I can finally get rid of the annoying nodered

  • @jazautomation
    @jazautomation 2 года назад

    Super.

    • @SmartHomeMakers
      @SmartHomeMakers  2 года назад

      Thanks JAZ!

    • @jazautomation
      @jazautomation 2 года назад

      @@SmartHomeMakers I really like your more advance topic. That video was perfect. I thought you needed appdaemon to write python script and I did not feel really ready for that yet.

    • @SmartHomeMakers
      @SmartHomeMakers  2 года назад

      @@jazautomation I know really cool!

  • @threepe0
    @threepe0 11 месяцев назад

    While this is useful, what you’re doing is writing a script… so you don’t have to write a script. Nerds, including myself here, get way too excited about doing things other places/other ways. But sometimes it’s easy to lose sight of when you’re just moving the problem.
    If you’re smart, your code is reusable… almost like 🤔 templates.

  • @espressomatic
    @espressomatic 2 года назад +1

    Python = scripting, so this isn't better than a script, it *IS* a script. But... It's not YAML - thank god. YAML sucks. There's nothing out there today or yesterday that I can think of that's worse than YAML.

  • @larryo4480
    @larryo4480 2 года назад +2

    First, I appreciate your content very much. I watch all of your videos. However, why do you, and most RUclipsrs, do everything in DARK mode? I can barely make out anything on my screen, much less follow the code examples. Please look at one of your videos and consider using a white screen. Thanks.

    • @SmartHomeMakers
      @SmartHomeMakers  2 года назад

      Thanks Larry for your honest feedback! I will run a poll on the channel to decide if we got with white screen or black!

    • @cjrivo
      @cjrivo 2 года назад +1

      Because dark mode is superior and easier on the eyes. At least most programmers think this. I am watching this video in a phone, with far from max brightness, and see just fine. If you can’t make out the code, maybe you need to increase the quality of the video?

    • @SmartHomeMakers
      @SmartHomeMakers  2 года назад

      @@cjrivo Thanks Jan for your take

  • @AndreaGhensi
    @AndreaGhensi 2 года назад

    If this is what you learn in the datacamp course, please stop using it! It works, but it's ugly, and tere's too much ugly code out there! It's fine if you keep it for yourself, but not if you publish it in a RUclips video.
    - while loop that only decrement the variable should be replaced by a for loop
    - indentation should be 4 spaces (if someone pastes you code in other copied code, error would happen)
    - use f-strings instead of string concatenation

    • @SmartHomeMakers
      @SmartHomeMakers  2 года назад

      Just something simple non coders can pickup on

    • @SmartHomeMakers
      @SmartHomeMakers  2 года назад

      I disagree code doesn’t need to be perfect for a YT video it isn’t a production system, happy to publish an improved version of the code Andrea

    • @AndreaGhensi
      @AndreaGhensi 2 года назад

      @@SmartHomeMakers I understand this is not production code, but the problem is the users that see your code will use it/base their code(and code style) on it, thinking is good code. This propagates bad coding practices, and github is full of it! It's not your fault, but you'll end up being a part of it. Sorry if I sound too harsh, maybe I shouldn't watch coding videos early in the morning 😅

    • @SmartHomeMakers
      @SmartHomeMakers  2 года назад +1

      @@AndreaGhensi I didn’t get much sleep either with a new born :)

  • @danielhitch
    @danielhitch 2 года назад

    Is there a reason why you chose python over a while loop or a repeat until in a home assistant automation and script? www.home-assistant.io/docs/scripts/#while-loop

    • @DavidNijman
      @DavidNijman 2 года назад

      Probably he's using it as an example to show what you can do with Python scripts, not to replace home assistant automation and scripts

    • @danielhitch
      @danielhitch 2 года назад

      @@DavidNijman I am thinking the same but I was just wondering if there may have been a different driver behind it

    • @SmartHomeMakers
      @SmartHomeMakers  2 года назад

      Indeed, I had tried that in my 5 scripts video! Some people can write python and run locally so debug, many find coding scary