HvdW wrote: Thursday 23 April 2020 22:59
Is it possible to do an api-call in python by name like:
Code: Select all
SENSOR = "http://192.168.2.1:8080/json.htm?type=devices&rid=Oregon"
Not possible in one pass. Not from Python nor from any other language. It is not available as API call in domoticz
What you can do is call
Code: Select all
http://192.168.2.1:8080/json.htm?type=command¶m=devices_list
to get a JSON of all deviceNames / idx and
process that list to extract the idx belonging to the name you want.
Or (probably quicker) just get all devices from domoticz using
Code: Select all
http://192.168.2.1:8080/json.htm?type=devices
and walk the list with the devicename as searchkey to find your device
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>>
dzVents wiki