Cleaning IDX
Moderators: leecollings, remb0
-
- Posts: 94
- Joined: Monday 26 October 2015 10:41
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Cleaning IDX
Hi,
Is it possible to "clean" the various IDX ?
I recently began my Domoticz and I have installed several times some devices, or I installed similar devices after having installed other types of devices in meantime.
For instance, I always had to make several attempts to add zwave devices (I think I had not udnerstood properly the actions to take between the push on dongle and then addition through menu of Domoticz..), so I have plenty of IDX which are unused since I deleted the "failed attempts".
Or I also included some switches for blinds for testing, then included some virtual switches for other purpose (like adding timers for heaters), then added again some other switches for blinds. As a result, I have consecutive IDX for blinds at 22, 23, 24, and then the remaining ones at 34 and 37.
Is there anyway to clean the IDX by reallocating the various IDX to new ones to have kind of logic with ranges per category ? Something like: 1-10 : for blinds; 11-20 for heaters; 21-50 for virtual switches; etc. ? I ould avoid also reaching "high numbers" for IDX while having only a few dozens of IDX really active.
(of course, cleaning would mean also updating all external scripts, calls, etc. A pain, but why not)
br,
ricorico94
Is it possible to "clean" the various IDX ?
I recently began my Domoticz and I have installed several times some devices, or I installed similar devices after having installed other types of devices in meantime.
For instance, I always had to make several attempts to add zwave devices (I think I had not udnerstood properly the actions to take between the push on dongle and then addition through menu of Domoticz..), so I have plenty of IDX which are unused since I deleted the "failed attempts".
Or I also included some switches for blinds for testing, then included some virtual switches for other purpose (like adding timers for heaters), then added again some other switches for blinds. As a result, I have consecutive IDX for blinds at 22, 23, 24, and then the remaining ones at 34 and 37.
Is there anyway to clean the IDX by reallocating the various IDX to new ones to have kind of logic with ranges per category ? Something like: 1-10 : for blinds; 11-20 for heaters; 21-50 for virtual switches; etc. ? I ould avoid also reaching "high numbers" for IDX while having only a few dozens of IDX really active.
(of course, cleaning would mean also updating all external scripts, calls, etc. A pain, but why not)
br,
ricorico94
- gizmocuz
- Posts: 2552
- Joined: Thursday 11 July 2013 18:59
- Target OS: Raspberry Pi / ODroid
- Domoticz version: beta
- Location: Top of the world
- Contact:
Re: Cleaning IDX
No, you can delete sensors from the devices table, the idx values are just indexes, and do not need to be in order
Quality outlives Quantity!
-
- Posts: 94
- Joined: Monday 26 October 2015 10:41
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Cleaning IDX
Hi ,
Too bad we can't organise those indexes later on.
It's like IP subnetworks.. it can work with IP addresses here and there, but it looks nicer when it's ordered. I understand these numbers are database indexes (primary key, maybe ?), but it would ease readibility if we could organise them by categories: for instance, when writing scripts, having IDX organised with a "logic" behind could be interesting.
br,
ricorico94
Too bad we can't organise those indexes later on.
It's like IP subnetworks.. it can work with IP addresses here and there, but it looks nicer when it's ordered. I understand these numbers are database indexes (primary key, maybe ?), but it would ease readibility if we could organise them by categories: for instance, when writing scripts, having IDX organised with a "logic" behind could be interesting.
br,
ricorico94
-
- Posts: 12
- Joined: Sunday 15 November 2015 19:10
- Target OS: Windows
- Domoticz version:
- Location: Norway, Kongsberg
- Contact:
Re: Cleaning IDX
Is it in some way possible to see wich IDX belong to for example a Fibaro dimmer?
Because sometimes you add more than one new z wave unit and over a little time they add some extra devices.
Because sometimes you add more than one new z wave unit and over a little time they add some extra devices.
Domoticz running on Windows Server 2008 in VMware (ESXi), UZB1 stick, 3x FIBARO FGD212 Dimmer, 1x FIBARO RGBW Controller FGRGBWM-441, 2x FIBARO FGMS001 Motion Sensor and 2x Popp 009006 Plug-in Switch
- gizmocuz
- Posts: 2552
- Joined: Thursday 11 July 2013 18:59
- Target OS: Raspberry Pi / ODroid
- Domoticz version: beta
- Location: Top of the world
- Contact:
Re: Cleaning IDX
These are database indexes and should not be changed
yes, goto the devices overview, and sometimes adding new devices should not happen, after a good include it should be stable
yes, goto the devices overview, and sometimes adding new devices should not happen, after a good include it should be stable
Quality outlives Quantity!
- nayr
- Posts: 354
- Joined: Tuesday 11 November 2014 18:42
- Target OS: Linux
- Domoticz version: github
- Location: Denver, CO - USA
- Contact:
Re: Cleaning IDX
I just broke into the 200's IDX, im sure Gizmocuz here likely has device id's in the 4 digits..
If your that OCD about it wipe everything out and start over, but there really is no problem.. who cares what number that is, the requirement is that it be unique and static.. not in order, or small or big or anything else an unhealthy mind will consider important.
implementing your request breaks one of the requirements.. that it remain static.
If your that OCD about it wipe everything out and start over, but there really is no problem.. who cares what number that is, the requirement is that it be unique and static.. not in order, or small or big or anything else an unhealthy mind will consider important.
implementing your request breaks one of the requirements.. that it remain static.
Last edited by nayr on Thursday 11 February 2016 18:01, edited 1 time in total.
Debian Jessie: CuBox-i4 (Primary) w/Static Routed IP and x509 / BeagleBone with OpenSprinkler / BeagleBone Planted Aquarium / 3x Raspbery Pi2b GPIO Slaves
Elemental Theme - node-domoticz-mqtt - Home Theatre Controller - AndroidTV Simple OSD Remote - x509 TLS Auth
Elemental Theme - node-domoticz-mqtt - Home Theatre Controller - AndroidTV Simple OSD Remote - x509 TLS Auth
- gizmocuz
- Posts: 2552
- Joined: Thursday 11 July 2013 18:59
- Target OS: Raspberry Pi / ODroid
- Domoticz version: beta
- Location: Top of the world
- Contact:
Re: Cleaning IDX
The only reason why the IDX value is visible to end-users is for people that use it with scripts/lua
If you dont use that, ignore it
yep... 4 digits (2924)
If you dont use that, ignore it
yep... 4 digits (2924)
Quality outlives Quantity!
-
- Posts: 370
- Joined: Monday 05 October 2015 10:16
- Target OS: -
- Domoticz version:
- Contact:
Re: Cleaning IDX
If youre despirate in reordering, i would suggest replicate your devices by creating new devices with the json api. Then you are able to assign your logical device type related numbering.
But keep it simple. Namingschemas are easier to understand then manualy rebuilding your device numbering
And dont forget that the last number youve used 'manualy' will be followed by a next number when domoticz finds a new devices.
Grtz,
Stephan
But keep it simple. Namingschemas are easier to understand then manualy rebuilding your device numbering

And dont forget that the last number youve used 'manualy' will be followed by a next number when domoticz finds a new devices.
Grtz,
Stephan
- nayr
- Posts: 354
- Joined: Tuesday 11 November 2014 18:42
- Target OS: Linux
- Domoticz version: github
- Location: Denver, CO - USA
- Contact:
Re: Cleaning IDX
How dare you say that to someone with OCD!?gizmocuz wrote:it is just a number....

they are tormented by stuff like this.

Debian Jessie: CuBox-i4 (Primary) w/Static Routed IP and x509 / BeagleBone with OpenSprinkler / BeagleBone Planted Aquarium / 3x Raspbery Pi2b GPIO Slaves
Elemental Theme - node-domoticz-mqtt - Home Theatre Controller - AndroidTV Simple OSD Remote - x509 TLS Auth
Elemental Theme - node-domoticz-mqtt - Home Theatre Controller - AndroidTV Simple OSD Remote - x509 TLS Auth
-
- Posts: 370
- Joined: Monday 05 October 2015 10:16
- Target OS: -
- Domoticz version:
- Contact:
Re: Cleaning IDX
Nayr / Gizmocuz... Please
) . I like ("my") order to...
Someone asked for renumbering idx.
Grtz,
Stephan

Someone asked for renumbering idx.
Grtz,
Stephan
-
- Posts: 121
- Joined: Sunday 11 October 2015 8:50
- Target OS: Raspberry Pi / ODroid
- Domoticz version: V3.6224
- Location: Holland
- Contact:
Re: Cleaning IDX
It would be silly to do.stlaha2007 wrote: Someone asked for renumbering idx.
Its an intern database number
Anything else is more important to do then altering database ID's just because it is not in the order you like.

The people here are trying to create an new stable release, much, I say much more important then not relevant optics.
RPI-2 + SSD / ESPEasy Sensors & Switches / Sonoff / RFLink / Action Switches / TP-Link switch / Node-Red / Reacticz
-
- Posts: 370
- Joined: Monday 05 October 2015 10:16
- Target OS: -
- Domoticz version:
- Contact:
Re: RE: Re: Cleaning IDX
Totally agreeNietGiftig wrote:It would be silly to do.stlaha2007 wrote: Someone asked for renumbering idx.
Its an intern database number
The people here are trying to create an new stable release, much, I say much more important then not relevant optics.
Waiting for the new stable with selector switches etcetera....
But again. Someone (Topic Starter) asked for it, which is not ME.
Grtz,
Stephan
-
- Posts: 121
- Joined: Sunday 11 October 2015 8:50
- Target OS: Raspberry Pi / ODroid
- Domoticz version: V3.6224
- Location: Holland
- Contact:
Re: RE: Re: Cleaning IDX
Yes that's correct and an answer was givenstlaha2007 wrote: But again. Someone (Topic Starter) asked for it, which is not ME.
http://www.domoticz.com/forum/viewtopic ... 859#p74589
RPI-2 + SSD / ESPEasy Sensors & Switches / Sonoff / RFLink / Action Switches / TP-Link switch / Node-Red / Reacticz
-
- Posts: 81
- Joined: Tuesday 03 November 2015 5:07
- Target OS: Linux
- Domoticz version: beta
- Contact:
Re: RE: Re: Cleaning IDX
I presume the limit on DZ device indexes is high but what happens with Z-Wave node IDs? Once the 232 node limit is reached, does DZ/OZW start cycling through the IDs that may not have been used? I suspect I'll never reach such limits... Just curious.nayr wrote:I just broke into the 200's IDX, im sure Gizmocuz here likely has device id's in the 4 digits..
If your that OCD about it wipe everything out and start over, but there really is no problem.. who cares what number that is, the requirement is that it be unique and static.. not in order, or small or big or anything else an unhealthy mind will consider important.
implementing your request breaks one of the requirements.. that it remain static.
- Egregius
- Posts: 2592
- Joined: Thursday 09 April 2015 12:19
- Target OS: Linux
- Domoticz version: v2024.7
- Location: Beitem, BE
- Contact:
Re: Cleaning IDX
The device IDX aren't anything to worry about. You are not getting to 9223372036854775807 very quickly.
And then, if it's the autonumbering of SQLite3 that is used there's no problem:
And then, if it's the autonumbering of SQLite3 that is used there's no problem:
The Zwave IDX on the other hand, I'm now at 89 and also curious what happens when the limit is there...Longer answer: If you declare a column of a table to be INTEGER PRIMARY KEY, then whenever you insert a NULL into that column of the table, the NULL is automatically converted into an integer which is one greater than the largest value of that column over all other rows in the table, or 1 if the table is empty. Or, if the largest existing integer key 9223372036854775807 is in use then an unused key value is chosen at random.
-
- Posts: 370
- Joined: Monday 05 October 2015 10:16
- Target OS: -
- Domoticz version:
- Contact:
Re: RE: Re: Cleaning IDX
A quick google let to some maintenance questions about the effects of reindex and vacuum.Egregius wrote:The device IDX aren't anything to worry about. You are not getting to 9223372036854775807 very quickly.
And then, if it's the autonumbering of SQLite3 that is used there's no problem:The Zwave IDX on the other hand, I'm now at 89 and also curious what happens when the limit is there...Longer answer: If you declare a column of a table to be INTEGER PRIMARY KEY, then whenever you insert a NULL into that column of the table, the NULL is automatically converted into an integer which is one greater than the largest value of that column over all other rows in the table, or 1 if the table is empty. Or, if the largest existing integer key 9223372036854775807 is in use then an unused key value is chosen at random.
Depends on what maintenance procedures are implemented in such case.
I think the one developing Domoticz and its database, Gizmocus??, can give some info about this. Im curious too, however i dont expect there would be a problem as there are protocols that are limited earlier then the database limits.
Grtz,
Stephan
- gizmocuz
- Posts: 2552
- Joined: Thursday 11 July 2013 18:59
- Target OS: Raspberry Pi / ODroid
- Domoticz version: beta
- Location: Top of the world
- Contact:
Re: Cleaning IDX
ZWave, the limit will be 254 nodes
SQLite, when you backup your database in domoticz from the settings page, there is an automatic vacuum done
If you renumber the indexes, then all is lost, like the temperature tables references id's from the device table and so on
SQLite, when you backup your database in domoticz from the settings page, there is an automatic vacuum done
If you renumber the indexes, then all is lost, like the temperature tables references id's from the device table and so on
Quality outlives Quantity!
-
- Posts: 370
- Joined: Monday 05 October 2015 10:16
- Target OS: -
- Domoticz version:
- Contact:
Re: Cleaning IDX
Big thanks.
But is the vacuum done before on 'live' db or only into backup?
Grtz,
Stephan
But is the vacuum done before on 'live' db or only into backup?
Grtz,
Stephan
- gizmocuz
- Posts: 2552
- Joined: Thursday 11 July 2013 18:59
- Target OS: Raspberry Pi / ODroid
- Domoticz version: beta
- Location: Top of the world
- Contact:
Re: Cleaning IDX
Only when a backup is made, before the backup is made, the backup is vacuumed
Quality outlives Quantity!
Who is online
Users browsing this forum: No registered users and 1 guest