Recently i bought an Denon X2400H. I managed to setup an easy script to control the AVR with all the commands i received from Denon.
I wanted to use some automations which simply calls my python scripts/places input in the script. However to control the AVR i need to import some modules (socket for example).
Unfortunatly home-assistant is blocking me from doing this…
Are there work arounds? Other ways to use full python scripts?
Yeah i noticed but seemed it implied a learning curve. Made a workaround where i use shell commands to call functions in my script or parse arguments. Not the cleanest but works well atm.
@bbrendon Yeah thats what i ended up using. Still cant comprehend the reasoning behind not allowing the import function. When shell commands are avaliable the reason of security simply isnt availabe anymore.
I think the preferred way to do this would be to make it a custom component and implement them as service calls. Custom components can specify REQUIREMENTS that will get installed during startup and can import whatever they need to use.
I am a total N00b, but quite good at copy and paste, so if my function name with argument is RotelRemote(‘PowerOn’). And the file name is Rotel.py. How will the code be?
So got my test script working when I use a function argument without space
But with space it throws an error. And I think it is the command line syntax.
How do I format the function argument with a space?
I want to use a space because I want to pick the argument in my script and make it an attribute in a HA-sensor.
May I ask you what you do with that? Hehe I’m trying to autoplay the 1st video in youtube search depending on the media artist - title on my media player.
The process probably won’t work for you. I don’t use it mainly because for the media extractor to play youtube songs, it has to play youtube video. I use the VLC player on the pi, so I need to run HA from ssh console so that it can play the video. It plays it with text, kinda cool.
I don’t use Hass.io but I don’t think you can install programs. It appears you need to install apiclient. I would try this on a Pi with HA installed in a venv.