Page 1 of 2
Add HardwareID (nodeID) to Device list page
Posted: Monday 20 June 2016 16:44
by SchattenMann
Hi there,
I'd say one of the most confusing part of Domoticz is to link devices with the corresponding "hardware device" - easy when we have half a dozen devices but it gets complicated over time.
Would help to have HardwareID column in Devices tab with the corresponding Hardware NodeID - this ensures we can link each device to the corresponding hardware.
Plus a way to filter "orphan devices", i.e. devices with no corresponding hardware, maybe cuz it was Excluded (Z-Wave) would be extremely helpful!
Re: Add HardwareID to Device list page
Posted: Monday 20 June 2016 22:23
by georgesattali
Hello SchattenMann,
You can name your hardware in Setup/Hardware (choose a unique name for each hardware);

- zz.JPG (79.35 KiB) Viewed 6950 times
and then the - unique - name you chose (maybe a number) appears here (Setup/Devices), you can click on the column title to sort by Hwd :

- Capture1.jpg (111.11 KiB) Viewed 6950 times
does that fit your needs ?
Bye,
GD
Re: Add HardwareID to Device list page
Posted: Tuesday 21 June 2016 10:27
by SchattenMann
Hi,
That will display the Hardware Name, not the Hardware Node Name

Re: Add HardwareID to Device list page
Posted: Tuesday 21 June 2016 17:20
by dhanjel
There are a couple of threads about this already
Sent from my Nexus 6P using Tapatalk
Re: Add HardwareID to Device list page
Posted: Thursday 23 June 2016 10:58
by SchattenMann
And the conclusion is?
Re: Add HardwareID to Device list page
Posted: Tuesday 02 August 2016 14:16
by piokuc
SchattenMann BTW tell me what theme you use ? Can you share it because looks good

Re: Add HardwareID to Device list page
Posted: Tuesday 02 August 2016 14:19
by SchattenMann
sure, I've shared it here -
viewtopic.php?f=8&t=11662
Re: Add HardwareID (nodeID) to Device list page
Posted: Thursday 04 August 2016 11:53
by SchattenMann
wondering if anyone can shed some light on this...at the moment I have hundreds of "devices" and it's a PITA to link them with corresponding "Z-Wave/RFX Devices)...
Plus some modules have been Excluded leaving "orphan devices" on the device list I would like to delete but there's no easy way to identify them.
Is there a particular reason why this can't be done?
Re: Add HardwareID (nodeID) to Device list page
Posted: Sunday 07 August 2016 12:20
by gizmocuz
For zwave, it is not so hard, and have been explained many times
In the openzwave setup, you see your nodes, the nodes have an ID (take a note of the hex id)
Now in the devices tab, in the filer type some part of your hardware name, like 'zwave' , next to it, type a space, then part of the hex id , like ' 14'
'zwave 14', you should now see the sensors of this zwave node
But if you can contribute to a better way, please do
Re: Add HardwareID (nodeID) to Device list page
Posted: Monday 08 August 2016 9:55
by SchattenMann
Thanks gizmocuz,
That does kinda help
I would say it's worth adding "Node ID" and "Hardware (device) Name" column on the device list table. Sure not all devices will have it filled in but the same thing happens with Battery and Range columns if that makes sense.
With these columns device identification would be extremely easy, plus in the future one can add fancy JS to group, sort, drag-n-drop columns etc
I would be more than happy to do it but unfortunately I can't seem to find my way around most the code

Re: Add HardwareID (nodeID) to Device list page
Posted: Wednesday 10 August 2016 13:22
by SchattenMann
I'm looking at the DB and it seems there's no relation between DeviceStatus and ZWaveNodes table...I would have expected a relational table or a NodeID field on DeviceStatus but guess I was wrong...
How does domo know that device X belongs to Z-Wave Node Y then? Clearly I'm missing the point here...
Re: Add HardwareID (nodeID) to Device list page
Posted: Sunday 14 August 2016 11:58
by gizmocuz
try converting your node_id to a hex number, then search for this hex number in the devices tab
Re: Add HardwareID (nodeID) to Device list page
Posted: Sunday 14 August 2016 12:22
by mischa
I think this is not going to be an easy thing, I have looked into the database. The devices you see on the devices tab are stored in the DeviceStatus table except for the Scenes the have there own table. The (zwave) nodes are stored in the ZWaveNodes table, but I can't find no corresponding relation between those two tables or a FOREIGNKEY.
It seems that there is no relation, which explains when you delete a (zwave) node the devices are not automatically deleted as well.
gizmocuz wrote:For zwave, it is not so hard, and have been explained many times
In the openzwave setup, you see your nodes, the nodes have an ID (take a note of the hex id)
Now in the devices tab, in the filer type some part of your hardware name, like 'zwave' , next to it, type a space, then part of the hex id , like ' 14'
'zwave 14', you should now see the sensors of this zwave node
But if you can contribute to a better way, please do
This method gizmocuz describes is not full proof. If I filter "Razz 13" (my zwave hardware is called: Razzbery 2.0 and the node 0x13) than it returns 25 devices.
It filters every thing with a one of the characters form my search string in any of the columns. It limits my search, but I still have to choose between 6 devices.
I would really make huge improvement for Domoticz. I know a thing or two about databases, but I'm no expert. Think to get this to work it will take a complete restructure of the database.
Re: Add HardwareID (nodeID) to Device list page
Posted: Monday 15 August 2016 12:35
by SchattenMann
mischa wrote:
This method gizmocuz describes is not full proof. If I filter "Razz 13" (my zwave hardware is called: Razzbery 2.0 and the node 0x13) than it returns 25 devices.
I second that.
I'm surprised there wasn't any foreign key between the two tables, I would expect when a device (DeviceStatus) is created (by a Z-Wave device) to store the node ID from the physical device (ZWaveNodes) in DeviceStatus - I'm sure there's a reason why that's not happening now but can't think of one myself
Re: Add HardwareID (nodeID) to Device list page
Posted: Monday 15 August 2016 20:19
by mischa
I see another issue, that of a contaminated Device list.
If devices not deleted when a (zwave) Node is excluded the will still be present in the device list (and table) and need to be removed by hand, but if you don't know which devices a Node has.
I use domoticz for over a year now and have excluded several devices in that time, of the +100 devices in my list there could be 25 or more orphan devices for all I know.
Simple fix would be to add a NodeID column to the DeviceStatus table, change the code to write the NodeID. This will only work for new added devices.
Re: Add HardwareID (nodeID) to Device list page
Posted: Tuesday 16 August 2016 12:36
by SchattenMann
yeah I have the same problem, after a few Excluded Z-Wave devices I end up with dozens of "orphan" devices to be removed but not idea how to identify them all
Re: Add HardwareID (nodeID) to Device list page
Posted: Tuesday 16 August 2016 13:24
by Egregius
Write down the hex value of the node before excluding it so you can filter the table on that to remove the devices.
Also, as stated before, always name all devices as soon as they arrive in the table.
Of course, if you let everything there as 'unknown', 'power meter', 'usage',... you don't know what is what anymore.
Re: Add HardwareID (nodeID) to Device list page
Posted: Tuesday 16 August 2016 23:02
by mischa
Egregius wrote:Write down the hex value of the node before excluding it so you can filter the table on that to remove the devices.
So example;

- Knipsel.PNG (23.63 KiB) Viewed 6483 times
I filter 18 from my hex address in the devices table gives me the following result;

- Knipsel2.PNG (124.03 KiB) Viewed 6483 times
This returns 16 devices. as you can see the are not only the devices from my Aeotec sensor, but also from other sensors.
Sometimes it filters more than 25 devices. So this is certainly not full proof workaround for the missing FOREIGN KEY in the DeviceStatus database table.
Or did I misunderstood the way you explained the filter process ?
@SchattenMann
There is one reason I can think of why the devices are not deleted when a node is excluded; if you delete a sensor your saved data will be lost.
Would be better to ask when you delete a node if you want to delete the associated devices and a option to backup your sensor data say for example in a csv file.
so when you replace a sensor you can import your data again.
Re: Add HardwareID (nodeID) to Device list page
Posted: Wednesday 17 August 2016 11:56
by SchattenMann
mischa wrote:
@SchattenMann
There is one reason I can think of why the devices are not deleted when a node is excluded; if you delete a sensor your saved data will be lost.
Would be better to ask when you delete a node if you want to delete the associated devices and a option to backup your sensor data say for example in a csv file.
so when you replace a sensor you can import your data again.
Yes definitely don't want them to be removed automatically, that's one of the things I love in Domo!
IMHO it could ask if we want to delete the device or simply keep the same behaviour but with the much needed nodeID column
Re: Add HardwareID (nodeID) to Device list page
Posted: Wednesday 17 August 2016 22:40
by mischa
SchattenMann wrote:
Yes definitely don't want them to be removed automatically, that's one of the things I love in Domo!
IMHO it could ask if we want to delete the device or simply keep the same behaviour but with the much needed nodeID column
It's not gonna work, Domo stores the tempeture values (as example) with the Idx id in the database. The only thing would be to add a import/export function to sensors ect.
I think going to exclude and include all my nodes next weekend and name everything accordingly.