Read all enabled devices with JSON in one step

Topics (not sure which fora)
when not sure where to post, post here and mods will move it to right forum.

Moderators: leecollings, remb0

Post Reply
Schorschi
Posts: 25
Joined: Thursday 30 November 2017 22:09
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Read all enabled devices with JSON in one step

Post by Schorschi »

Hi,

is it possible to read all devices in the device list in one step with JSON?

I know that it is possible to read one after one by selecting the divice by the index.
I am looking for a faster solution to read the states of all divices in a shortest time over JSON.

THX
Gravityz
Posts: 587
Joined: Wednesday 16 December 2015 19:13
Target OS: NAS (Synology & others)
Domoticz version: 2022.2
Location: Netherlands
Contact:

Re: Read all enabled devices with JSON in one step

Post by Gravityz »

i think this gives you everything
ofcourse you need to do some scripting to filter out the names and the status
http://192.168.1.xx:xxxx/json.htm?type=devices&used=true
Schorschi
Posts: 25
Joined: Thursday 30 November 2017 22:09
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Read all enabled devices with JSON in one step

Post by Schorschi »

Hi,

i tested your suggestion. It does not work.
But this work:

http://192.168.xxx.xxx:port/json.htm?type=devices

You get all enabled devices in one json file.

Perfect!!!!

THX
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Read all enabled devices with JSON in one step

Post by waaren »

Schorschi wrote: Wednesday 18 September 2019 20:52 http://192.168.xxx.xxx:port/json.htm?type=devices
This command will also show the unused devices. ( "Used" : 0, ). That is if you replace 192.168.xxx.xxx:port with your <domoticz IP>:<domoticz Port>
The command @Gravityz suggested will give you only the used devices. That is if you replace 192.168.1.xx:xxxx with your <domoticz IP>:<domoticz Port>)
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest