Problem updating device

Python and python framework

Moderator: leecollings

Post Reply
pilotlt
Posts: 1
Joined: Saturday 30 June 2018 9:57
Target OS: Windows
Domoticz version:
Contact:

Problem updating device

Post 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"
}
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest