Delete device with Json?

Moderator: leecollings

Post Reply
User avatar
Westcott
Posts: 423
Joined: Tuesday 09 December 2014 17:04
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: UK - Glos
Contact:

Delete device with Json?

Post by Westcott »

Is it possible to delete devices with Json?
Something like -
/json.htm?type=command&param=deletedevice&idx=IDX
This doesn't work, returning an ERR status
Zwave - Sigma Z+ stick, Fibaro, Horstmann, Neo Coolcam, EUROtronic
RFlink - IR detectors and temperatures
Wifi - YeeLights, ESP32s, Anoop sockets
Zigbee - lots with zigbee2mqtt and ZbBridge
User avatar
Egregius
Posts: 2592
Joined: Thursday 09 April 2015 12:19
Target OS: Linux
Domoticz version: v2024.7
Location: Beitem, BE
Contact:

Re: Delete device with Json?

Post by Egregius »

Think it should be something like:

Code: Select all

http://192.168.0.10:8084/json.htm?type=setused&idx=535&name=test&description=&used=false
That's the url that's called when you edit/remove a device.


Or

Code: Select all

http://192.168.0.10:8084/json.htm?type=deletedevice&idx=535
when deleting from the devices view.

Both urls tested and confirmed as working.
User avatar
Westcott
Posts: 423
Joined: Tuesday 09 December 2014 17:04
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: UK - Glos
Contact:

Re: Delete device with Json?

Post by Westcott »

Hi Egregius,

Thanks for the quick answer!
Yes, your 2nd example works for me, even simpler than I guessed.
Perhaps it should be documented in the Wiki?

I'm going to use it to delete spurious unused devices added by RFX and RFlink.
Zwave - Sigma Z+ stick, Fibaro, Horstmann, Neo Coolcam, EUROtronic
RFlink - IR detectors and temperatures
Wifi - YeeLights, ESP32s, Anoop sockets
Zigbee - lots with zigbee2mqtt and ZbBridge
User avatar
Egregius
Posts: 2592
Joined: Thursday 09 April 2015 12:19
Target OS: Linux
Domoticz version: v2024.7
Location: Beitem, BE
Contact:

Re: Delete device with Json?

Post by Egregius »

Be carefull...
I would just leave them there or disable new sensors.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest