nadav
(Nadav)
September 9, 2019, 6:37pm
1
Hi,
I want to make a script that has the ability to import libraries, like urllib.
Rightt now, I’m getting this error:
2019-09-09 18:01:17 ERROR (SyncWorker_9) [homeassistant.components.python_script.hello_word.py] Error executing script: __import__ not found
I understood it’s because my script runs inside a sandbox.
What can I do?
I need my script to import this library.
Thank you.
claha
(Claes Hallström)
September 10, 2019, 6:11am
2
Depending on your needs you could always just write the script and then use a command line sensor https://www.home-assistant.io/components/sensor.command_line/ or maybe even just a https://www.home-assistant.io/components/rest/
Or if you would like to dive deeper into HA you could write a custom component. I started with a rest sensor but quickly moved to a custom component since I could then share it with everyone easily
olsoma13
(Matt Olson)
January 19, 2020, 8:24pm
3
What you’re attempting to do is the intent of the AppDaemon integration in HA: https://www.home-assistant.io/docs/ecosystem/appdaemon/