Nice, thanks. Need something more complex actually. Need to start custom server to listen socket on specific port. And then start sending messages (via mqtt) with statuses. Works already fine on any Linux machines but I'd prefer to intergrate it with HA. My HA installed as an image for PI. So probably I'll need to setup new container instead to get access to real python... oh wish me luck
Thanks for this. Very informative. I've added few python libraries through requirements.txt, would you know where these python libraries are installed? I could not locate it. Thanks
I can see a few of the libraries that I defined set within this folder /home/dolding/HomeAssistant/config/pyscript/modules. However I can't see anything relating to openai and other libraries that I'm using. Check that /modules folder for yourself to see if that's where your libraries are getting stored. hacs-pyscript.readthedocs.io/en/latest/reference.html#importing I wonder if the missing libraries in my case is because I've already installed some of them globally prior to setting up this integration.
Yep you can do that. The instructions would still be the same. Setup your Home Assistant OS --> Install HACS --> Install Pyscript --> write your custom scripts
Yeah there's quite a bit to this method. There's an easier alternative where you can edit your scripts directly in the HA console -- www.home-assistant.io/integrations/python_script/ This method is great for simple python scripts but doesn't appear to support 3rd party libraries which leaves you very limited in what you can do.
Nice, thanks. Need something more complex actually. Need to start custom server to listen socket on specific port. And then start sending messages (via mqtt) with statuses. Works already fine on any Linux machines but I'd prefer to intergrate it with HA. My HA installed as an image for PI. So probably I'll need to setup new container instead to get access to real python... oh wish me luck
This was really impressive & informative - thanks David!
No worries.
Glad it was helpful!
Big Thx
Will try the same . keep Going
Thanks for this. Very informative.
I've added few python libraries through requirements.txt, would you know where these python libraries are installed? I could not locate it. Thanks
I can see a few of the libraries that I defined set within this folder /home/dolding/HomeAssistant/config/pyscript/modules.
However I can't see anything relating to openai and other libraries that I'm using.
Check that /modules folder for yourself to see if that's where your libraries are getting stored.
hacs-pyscript.readthedocs.io/en/latest/reference.html#importing
I wonder if the missing libraries in my case is because I've already installed some of them globally prior to setting up this integration.
What if u want to install package in python such as beautifullsoup and runs homeassistant os without docker?
Yep you can do that.
The instructions would still be the same.
Setup your Home Assistant OS --> Install HACS --> Install Pyscript --> write your custom scripts
LOL waaaay to complex.
Yeah there's quite a bit to this method.
There's an easier alternative where you can edit your scripts directly in the HA console -- www.home-assistant.io/integrations/python_script/
This method is great for simple python scripts but doesn't appear to support 3rd party libraries which leaves you very limited in what you can do.