I was having the same issue and just found out what the issue was. Created an account here hoping to solve your issue here as well.
In your HTTP post, try swapping out params for data. This worked for me
Code
def execute_post(direction, id, auth_key, shelly_server):
url = f"https://{shelly_server}.shelly.cloud/device/relay/roller/control"
data = {
"direction" : direction,
"id": id,
"auth_key": auth_key
}
try:
response = requests.post(url, data=data)
if response.status_code == 200:
print("POST request successful.")
print(response.text)
else:
print(response.text)
except Exception as e:
print(f"An error occurred: {str(e)}")
Alles anzeigen