Hi,
My domoticz installation received quit a large number of divices from my RFlink hardware (>3000) that are not mine and I think this makes my domotics slow. For instance when accessing the list of divices.
is there a problem executing "delete from DeviceStatus where used =0" on the database to get rit of these devices?
Peter
Cleanup unused devices Topic is solved
Moderator: leecollings
-
- Posts: 708
- Joined: Saturday 27 February 2016 12:49
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2020.2
- Location: NL
- Contact:
Re: Cleanup unused devices
In the list of devices, click on "not used devices" at the left top. After this, select "all" for "show entries.peter8wun wrote: ↑Monday 09 March 2020 15:04 Hi,
My domoticz installation received quit a large number of divices from my RFlink hardware (>3000) that are not mine and I think this makes my domotics slow. For instance when accessing the list of divices.
is there a problem executing "delete from DeviceStatus where used =0" on the database to get rit of these devices?
Peter
This will give you a complete list. Now select the little selectbox right next to the garbage bin, then click the garbage bin itself.
This gets rid of all unused devices.
Hans
- waaren
- Posts: 6028
- Joined: Tuesday 03 January 2017 14:18
- Target OS: Linux
- Domoticz version: Beta
- Location: Netherlands
- Contact:
Re: Cleanup unused devices
Not really butpeter8wun wrote: ↑Monday 09 March 2020 15:04 My domoticz installation received quit a large number of divices from my RFlink hardware (>3000) that are not mine and I think this makes my domotics slow. For instance when accessing the list of devices.
Is there a problem executing "delete from DeviceStatus where used =0" on the database to get rit of these devices?
- to be safe make sure you have a backup and only do this when domoticz is not active.
- If you have the allow new hardware set to yes they will come back.
- These devices will also have data in other tables.
Code: Select all
select name as Tables_containing_deviceRowid from sqlite_master where type='table' and sql like '%devicerowid%';
Code: Select all
delete from LightingLog where devicerowid in (select id from devicestatus where used = 0);
delete from Rain where devicerowid in (select id from devicestatus where used = 0);
delete from Rain_Calendar where devicerowid in (select id from devicestatus where used = 0);
delete from Temperature where devicerowid in (select id from devicestatus where used = 0);
delete from Temperature_Calendar where devicerowid in (select id from devicestatus where used = 0);
delete from Timers where devicerowid in (select id from devicestatus where used = 0);
delete from SetpointTimers where devicerowid in (select id from devicestatus where used = 0);
delete from UV where devicerowid in (select id from devicestatus where used = 0);
delete from UV_Calendar where devicerowid in (select id from devicestatus where used = 0);
delete from Wind where devicerowid in (select id from devicestatus where used = 0);
delete from Wind_Calendar where devicerowid in (select id from devicestatus where used = 0);
delete from Meter where devicerowid in (select id from devicestatus where used = 0);
delete from Meter_Calendar where devicerowid in (select id from devicestatus where used = 0);
delete from MultiMeter where devicerowid in (select id from devicestatus where used = 0);
delete from MultiMeter_Calendar where devicerowid in (select id from devicestatus where used = 0);
delete from Notifications where devicerowid in (select id from devicestatus where used = 0);
delete from LightSubDevices where devicerowid in (select id from devicestatus where used = 0);
delete from DeviceToPlansMap where devicerowid in (select id from devicestatus where used = 0);
delete from SceneDevices where devicerowid in (select id from devicestatus where used = 0);
delete from SharedDevices where devicerowid in (select id from devicestatus where used = 0);
delete from Percentage where devicerowid in (select id from devicestatus where used = 0);
delete from Percentage_Calendar where devicerowid in (select id from devicestatus where used = 0);
delete from Fan where devicerowid in (select id from devicestatus where used = 0);
delete from Fan_Calendar where devicerowid in (select id from devicestatus where used = 0);
delete from Pushlink where devicerowid in (select id from devicestatus where used = 0);
Code: Select all
delete from devicestatus where used = 0;
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
-
- Posts: 3
- Joined: Monday 25 July 2016 14:09
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Location: The Netherlands
- Contact:
Re: Cleanup unused devices
Thanks for the quick and complete answer. this helps tremendously.
- waaren
- Posts: 6028
- Joined: Tuesday 03 January 2017 14:18
- Target OS: Linux
- Domoticz version: Beta
- Location: Netherlands
- Contact:
Re: Cleanup unused devices
Not sure when the fix was applied but on older versions this approach (which should be the preferred one) caused domoticz to 'hang' when > 5 devices where selected for deletion.manjh wrote: ↑Monday 09 March 2020 15:56 In the list of devices, click on "not used devices" at the left top. After this, select "all" for "show entries.
This will give you a complete list. Now select the little selectbox right next to the garbage bin, then click the garbage bin itself.
This gets rid of all unused devices.
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
Who is online
Users browsing this forum: No registered users and 1 guest