Page 1 of 1

Problem updating device

Posted: Saturday 30 June 2018 10:07
by pilotlt
Hi,
need help with updating virtual sensor status (virtual alert sensor). I am using windows 10 for server. I can update the status via any browser with:
http://192.168.1.105:8080/json.htm?type ... lue="Water has been detected"
But I am not able to do it with my Python script. What I am doing wrong? By the way - my Domoticz server does not requires auth for local network.

import requests

url = "http://192.168.1.105:8080/json.htm"
data = {'type':'command','param':'udevice', 'idx':'1', 'nvalue':'4', 'svalue':'water'}
r = requests.post(url, verify=False, json=data)
print(r.status_code)
print(r.reason)
print (r.text)

The output is:
200
OK
{
"status" : "ERR"
}