Script won't work with HA

Hi,

I built a simple script to test calling some internal API that I host on some of my computer.

I have several automation centralized in a custom WS, so right now I use HomeAssistant to call IFTTT maker to call my webservice to trigger the automation.
As my WS is locally on the same network of HA, I want to remove the middle man who’s IFTTT for this case.

That’s why i’m trying to use a python script to achieve my goal.

Here’s my test script :

import requests
r = requests.get(‘http://XXX.XXX.XXX.XXX:8080/json.htm?type=command&param=switchlight&idx=4&switchcmd=On’)
print®

When I run directly this script from python it is working great

python test_script.py

But when I trigger it from HA dev service I get "Service python_scripts/test_script.py called but it don’t really work.

Any idea ?

thanks

Problably the script cant handle the import. Not everything in python is available here.